Destructive collisiions with the world 

anyway I can make hard collisions with a wall or the ground destructive?
Trying to come up with a way to make even gentle flight from my
psuedo-thrust nueron, and destruction with the ground maybe the best way for
any morphology and allow for more interesting behaviors to evovlve.

Forums: 
Szymon Ulatowski's picture

Matthew Corey Brown wrote:
> anyway I can make hard collisions with a wall or the ground destructive?
> Trying to come up with a way to make even gentle flight from my
> psuedo-thrust nueron, and destruction with the ground maybe the best way for
> any morphology and allow for more interesting behaviors to evovlve.

it depends on what do you want to do
(but it won't be really destructive ;-))

you can use touch sensors (T) to make the creature feel the collisions
(and learn to avoid them).
a custom neuron (or expdef) can test if the creature is touching the
ground and take some action (kill or decrease fitness?).

WorldMap.getHeight(x,y) returns the z coordinate of the world surface.
you can compare this value with mechpart.z and detect the collision.
the following neurons outputs (part.z-surface.z)

function go()
{
var part = Neuro.creature.getMechPart(n.p);
var z=part.z-WorldMap.getHeight(part.x,part.y);

if (z<-1.0) z=-1.0; else if (z>=1.0) z=1.0;
// replace with the following line to get 0 (no contact) or 1 (contact)
// if (z<=0.0) z=1.0; else z=0.0;

Neuro.state=z;
}

and you could iterate through all parts if you need the aggregated
information about the creature touching the ground or not.

sz.

"Szymon Ulatowski" wrote in message
news:ciai9r$ris$1@cancer.cs.put.poznan.pl...
> Matthew Corey Brown wrote:
> > anyway I can make hard collisions with a wall or the ground destructive?
> > Trying to come up with a way to make even gentle flight from my
> > psuedo-thrust nueron, and destruction with the ground maybe the best way
for
> > any morphology and allow for more interesting behaviors to evovlve.
>
> it depends on what do you want to do
> (but it won't be really destructive ;-))
>
> you can use touch sensors (T) to make the creature feel the collisions
> (and learn to avoid them).
> a custom neuron (or expdef) can test if the creature is touching the
> ground and take some action (kill or decrease fitness?).
>
> and you could iterate through all parts if you need the aggregated
> information about the creature touching the ground or not.
>
> sz.
>

yeah iterating through the points is what i'm gonna be doing. But to speed
things up, would be nice to have an onWorldCollision event with the surface
normal of the world at the collision point. This allows you to get the
impact force. Example hiting the road going 50kph where most of the velocity
is parrelel to the road hurts alot less then hiting a brick wall at 50kph.
But absolute velocity for now should be close enough for evovling gentle
landers.