Darwinbots Forum

Code center => Suggestions => Topic started by: Numsgil on March 21, 2006, 03:29:54 PM

Title: Robot Physics
Post by: Numsgil on March 21, 2006, 03:29:54 PM
I'm cleaning up the last few bits of the basic physics system for the C++ version.  I'm at the voluntary motions (.up, etc.) for bots.

Should the values stored in .up, etc. be impulses or accelerations.

Old versions (such as 2.37) were acceleration based.

2.4 was impulse based (if you used the "use NewMove" thing).

If I remember right the fact that bots behaved oddly in 2.4 was a problem for many people, so I'm offering to change it to help smooth the transition.
Title: Robot Physics
Post by: EricL on March 21, 2006, 03:45:44 PM
Can you expound a little on the differences?  Does acceleration last longer than a cycle for example?   I don't understand enough to vote intelligently.
Title: Robot Physics
Post by: PurpleYouko on March 21, 2006, 04:39:35 PM
Why not haves both?

Is that not pretty much what "zero momentum" mode does?

I have recently taken to running all my sims in that mode anyway
Title: Robot Physics
Post by: Griz on March 21, 2006, 05:17:20 PM
yeah, what PY said.
and ... I LIKE the motion from the physics of 2.4.A as is ...
they seem much more realistic than 2.3X ...
the 'mass' of bots being apparent when they are bumped or are attempting
to accerate ...
this looks good when using a bot that ties to the MultiVeg that is unfixed ...
attempting to drag them around.
Title: Robot Physics
Post by: Numsgil on March 21, 2006, 05:25:11 PM
I should expound a little more...

What I mean is:

Impulse is acceleration times mass.  In older versions, the program would automatically worry about how hard you had to push to get going at some desired acceleration depending on your mass.

In early versions of 2.4, the program didn't do this for you.  How fast you actually went depended on your mass, so smaller bots tended to 'jerk' around because they were using too much effort.

Sort of the 'strap a jet pack on a gold fish' dilemma. ;)

In newer versions of 2.4, you'll need to add "use NewMove" at the top of a bot's DNA to see this effect.
Title: Robot Physics
Post by: shvarz on March 21, 2006, 05:30:19 PM
If it's really going to be impulse=mass*accel, then let the bot know it's own mass and the problem is gone - just pick whatever you like.  It would be easy to convert from one to the other.
Title: Robot Physics
Post by: Numsgil on March 21, 2006, 05:33:51 PM
There should be a .mass sysvar already, though it isn't find enough to help bots with less than a mass of 1 (1000 body is 1 mass).

I could refine it so it displays more precision.