Collision Masks 

I am trying to unravel the meaning of different collision masks.
For example: The standard experiment definition states for Creaturegroup1,
frams, a colmask of 13 (the sum of 1+4+8) and for Creaturegroup 2, food, a
colmask of 148 (= 4+16+128).

How can I find out the different functions of the individual colmasks
(1,4,8,16, ...,128) without having to test each combination? Is there a
logic to it that I missed?
Or could somebody provide a list of the functions of the colmasks?

Thanks in advance,

Walter

Forums: 
Maciej Komosinski's picture

See 'colmask' in Framsticks' class browser.

MacKo

Maciej Komosinski's picture

> I am trying to unravel the meaning of different collision masks.
> For example: The standard experiment definition states for Creaturegroup1,
> frams, a colmask of 13 (the sum of 1+4+8) and for Creaturegroup 2, food, a
> colmask of 148 (= 4+16+128).
>
> How can I find out the different functions of the individual colmasks
> (1,4,8,16, ...,128) without having to test each combination? Is there a
> logic to it that I missed?
> Or could somebody provide a list of the functions of the colmasks?

This was answered somehow in the previous post. Here it is
again (a detailed documentation will be soon available):

...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).

MacKo