Automatically avoiding collisions? 

I'm conducting experiments in Evolutionary Psychology (evolving sexual
strategies like courting behavior).

For this, I need to set the fitness function to some kind of reproduction. I
chose to take collissions between creatures as an analogy to mating. I
modified the standard experiment definition accordingly.

However, the creatures don't collide at all! Could this be because some
collission-avoidance process runs outside of the experiment definition? Or
can this be set from within the definition?

Thank you in advance.

Walter de Back
Utrecht University
Robotics Lab

Forums: 
Maciej Komosinski's picture

Dear Walter,

> However, the creatures don't collide at all! Could this be because some
> collission-avoidance process runs outside of the experiment definition? Or
> can this be set from within the definition?

First, the creatures are born in free places, so the
simulator tries not to cause collisions when putting
them in the world. This is done by the following code:

:place_again
call :place_randomly
call LiveLibrary.creatBBCollisions,0
if s0,==,0,:placed_ok
dec m8
if m8,>=,0,:place_again

-

Second, if you want to write your own handler procedure
for the collision event: detecting collisions depends on
the value of collision mask (it is a 'colmask' field
within each creatures group). Various combinations
of this mask produce various effects, like:

- pushing or not
- calling OnXXXCollision or not
- considering same-group individuals or not.

I won't explain it in detail here, just three examples:

colmask=1 : creatures push each other within the same group
colmask=1+4 : as above, but onXXXXCollision is also called

group1.colmask=1+4+8
group2.colmask=4+16+128 : as in 'standard.expdef': objects
within group1 push each other, the same for group2. If
object from group1 collides with group2 object, OnXXXCollision
is called, but no pushing (they are 'transparent' to each
other, like food and creatures).

-

Third, working with the 'assembler' scripts is not easy.
We introduce an easier language (c++-like) in the next
release, so creating your own code will be much more friendly!

Best wishes and good luck,

MacKo