Plant and animal coevolution 

I'm working on modelling plant and animal coevolution in Framsticks. I've
ran into a couple of problems that I'm not sure how to address.

1) Sunlight is modelled as simple fast moving creatures, created in the sky,
which have no collision with animals, but collide with plants in a custom
handler that give the plants energy. I need to set the initial velocity
vector for the sunlight creatures; however, I cannot figure out how to do
this in Framsticks.

2) I'm implementing a destructive collision model as follows: if an object
collides with another object, and the part hits head-on (i.e., along the
long axis of the part), no damage occurs to the part. If it is struck
directly on the side, full damage occurs. In between, an intermediate
amount of damage occurs. The given amount of damage is scaled relative to
the stamina of the objects. I can do this if I simply have a vector for
each part's movement (two total), and a vector for each part's orientation
(along the axis of the part). I can get the former easily - MechPart.vx,
vy, and vz. However, I don't know how to get the vector for the
orientation of the part

3) In the collision function, there are Part and MechPart. However, stamina
doesn't exist in either of these - it exists in Joint objects. What would
be a good way, given the colliding parts, to get stamina values?

If anyone can help with these, it'd be a big help. :)

Forums: 

"Karen Pease" wrote in message
news:cijvvl$998$1@cancer.cs.put.poznan.pl...
> I'm working on modelling plant and animal coevolution in Framsticks. I've
> ran into a couple of problems that I'm not sure how to address.
>
> 1) Sunlight is modelled as simple fast moving creatures, created in the
> sky,
> which have no collision with animals, but collide with plants in a custom
> handler that give the plants energy. I need to set the initial velocity
> vector for the sunlight creatures; however, I cannot figure out how to do
> this in Framsticks.

Asuming the sunlight animals only have 1 part.
var mp = creature.getMechPart(0);
mp.vx = XVelocity;
mp.vy = YVelocity;
mp.vz = ZVelocity;

Now since there is gravity you should probly set this at each step
>
> 2) I'm implementing a destructive collision model as follows: if an object
> collides with another object, and the part hits head-on (i.e., along the
> long axis of the part), no damage occurs to the part. If it is struck
> directly on the side, full damage occurs. In between, an intermediate
> amount of damage occurs. The given amount of damage is scaled relative to
> the stamina of the objects. I can do this if I simply have a vector for
> each part's movement (two total), and a vector for each part's orientation
> (along the axis of the part). I can get the former easily - MechPart.vx,
> vy, and vz. However, I don't know how to get the vector for the
> orientation of the part

Well since a part can have multiple joints associated with it, you need to
convert the effected part to all the other parts connected directly via
joints. and you get the Orientation of the joint, by subtracting point1
position from part2. So maybe take the averge of the orientation of all
joints connected to that part. And the average stam. As to how to do that
see below
>
> 3) In the collision function, there are Part and MechPart. However,
> stamina
> doesn't exist in either of these - it exists in Joint objects. What would
> be a good way, given the colliding parts, to get stamina values?

Now you'll need to beable to quickly get all joints associated with a part.

On creature initaialion you should make one of the user vars a vector of
vectors. Where each sub vector is a list of joint numbers associated with
it. (Replace Creature, withwhat ever creature reference you are using)

user1=Vector.new();
for (i=0;i

Maciej Komosinski's picture

Hi Karen,

> I'm working on modelling plant and animal coevolution in Framsticks. I've
> ran into a couple of problems that I'm not sure how to address.
>
> 1) Sunlight is modelled as simple fast moving creatures, created in the sky,
> which have no collision with animals, but collide with plants in a custom
> handler that give the plants energy. I need to set the initial velocity
> vector for the sunlight creatures; however, I cannot figure out how to do
> this in Framsticks.

Wouldn't it be better to model sunlight as it already was in
Framsticks? I.e. a global parameter (like amount of sunlight),
and some function that each number of simulation steps
enumerates all creatures and all their parts/joints to add
some energy depending on some chosen properties of these parts/joints?

MacKo

No; unfortunately, the current system is just too simplistic. It doesn't
cover shading, so there's no competitive pressures between plants. By
modelling "sunlight particles", they'll be absorbed by the first thing that
they hit; plus, you can take into account the effect of sun at different
angles.

- Karen

Maciej Komosinski wrote:

> Hi Karen,
>
>> I'm working on modelling plant and animal coevolution in Framsticks.
>> I've ran into a couple of problems that I'm not sure how to address.
>>
>> 1) Sunlight is modelled as simple fast moving creatures, created in the
>> sky, which have no collision with animals, but collide with plants in a
>> custom
>> handler that give the plants energy. I need to set the initial velocity
>> vector for the sunlight creatures; however, I cannot figure out how to do
>> this in Framsticks.
>
> Wouldn't it be better to model sunlight as it already was in
> Framsticks? I.e. a global parameter (like amount of sunlight),
> and some function that each number of simulation steps
> enumerates all creatures and all their parts/joints to add
> some energy depending on some chosen properties of these parts/joints?
>
>
> MacKo

Maciej Komosinski's picture

Hi Karen,

> No; unfortunately, the current system is just too simplistic. It doesn't
> cover shading, so there's no competitive pressures between plants. By
> modelling "sunlight particles", they'll be absorbed by the first thing that
> they hit; plus, you can take into account the effect of sun at different
> angles.

You can still do it global, i.e. without sun particles.
I would do that like this:

Each 100 (or so) simulation steps, I would sort all creatures' Parts
according to their height above ground, and then supply "sunlight
particles" to the highest Parts for each location in a grid.
Taking into account (simply computed) angles, if necessary.

But it can be also done the way you proposed. Please wait a little
bit for answers...

MacKo