Welcome To Darwinbots > Newbie

Hi!

<< < (3/3)

Carlo:

--- Quote ---There is no artificial cap on velocity any more.
--- End quote ---
Are you still able to calculate collisions without errors? The artificial cap was exactly the half of the robot's size, so that two robots, moving in opposite directions at max vel, always collided instead of passing through each other.

PurpleYouko:
The collisions are actually much simpler now.
The "repel" routine has been ditched in favor of a system which uses conservation of momentum. This make more sense as bots are different masses now.
Runs faster too.

I haven't seen any problem with bots passing through each other.

Effective absolute max speed is about 60 now though I have never known a bot to get there yet. It is necessary for it to have a mass of 1/2 to acheive this. That means no shell and a body of 20. Robots that small are pretty sickly really. They can't shoot worth a shit.

Minimum bot size is 120 so they shouldn't be able to go through each other at max speed.

The way it all works now is that when a collision is detected, the robots are first moved back along the path they came in on until they are just touching (variable with physical size). Then the difference in their momentum is calculated (in x and y vectors) and re-assigned such that both robots move away from the collision point. NO ACCELERATIONs are applied to either.
It is now possible for a fat slow bot to plow through a gang of little skinny bots without slowing down much while the "skinnies" are knocked all over the place.

Sprotiel:

--- Quote ---The collisions are actually much simpler now.
The "repel" routine has been ditched in favor of a system which uses conservation of momentum. This make more sense as bots are different masses now.
Runs faster too.
--- End quote ---
Great! Though I wish you'd told me this before I decided to rewrite repel.


--- Quote ---It is necessary for it to have a mass of 1/2 to acheive this. That means no shell and a body of 20.
--- End quote ---


--- Code: ---.mass = 1 + (.body / 10000) + (.Shell / 200)
--- End code ---
Or has it changed as well ?


--- Quote ---So whatever you can figure out in the 2.36.5 code should hold true for everyone.
--- End quote ---
Well... mostly I figured that the code is more readable when unused procedures and commented out bits of code are deleted and that every time you fix something, you create a new source of crashes.

PurpleYouko:

--- Quote ---
--- Code: ---  
.mass = 1 + (.body / 10000) + (.Shell / 200)
--- End code ---

Or has it changed as well ?
--- End quote ---

OK you caught me out here. Mass/2 has a minimum of 1/2 therefore mass cannot be lower than 1.
That's what I get quoting from memory instead of checking the code.



--- Quote ---Well... mostly I figured that the code is more readable when unused procedures and commented out bits of code are deleted and that every time you fix something, you create a new source of crashes.
--- End quote ---

Yup. We all figure that one out pretty quickly.
That's the reason so much old code is left in there and commented out. You never know when you might need it back again to fix something that you inadvertently screwed up elsewhere.
V2.35 was an example of that. Something in the ties got screwed right up (phantom ties to nothing and weird long ties going across the whole screen)
We spent hours trying to figure out what was wrong and eventually just imported the whole routine back from the last known working version. Fixed it but we still have no idea how.  :blink:

Sprotiel:

--- Quote ---V2.35 was an example of that. Something in the ties got screwed right up (phantom ties to nothing and weird long ties going across the whole screen)
--- End quote ---
I've seen something like this when trying to modify the collision routines. Switching all private variables to Single seems to have cured it.

Navigation

[0] Message Index

[*] Previous page

Go to full version