The forest for the trees

November 21st, 2008 by Michael

At the joyous occasion of finalizing the forest (not really: we wish we didn’t need to finish anything… -old internet habits die hard), I’m working on the final collision objects for the trees today. It’s a hilariously convoluted process. This is what the “code” looks like for the tree collision objects in the main forest area:

We actually need two collision objects for every tree. One that the characters can see, so they can try to avoid them. And another for the system to try and keep characters from intersecting with the tree in case they didn’t succeed in avoiding it (physics simulation). The row of little blocks at the bottom of the screenshot contains the positions of all trees, one block for every tree. Multiply this by 16 to get the entire forest.

In a test version of the game, the collision objects look like this:
Mmm… Candy cane forest!