Ah, glad you noticed (:
There's a meaning behind those colours which I'll explain further in a technical post sometime.
But here's a brief explanation: to calculate if a segment of the world has become detached from the ground, I maintain a separate 3-bit map. The values are:
0: no voxel
1-6 has a grounded neighbour
1-6 specify which neighbour to follow in a chain that leads down to the ground.
When a room is initialised, I calculate the shortest paths down to the ground.
When a voxel is removed during the action, its neighbours all become volatile (recursively).
At the end of each frame, this connectivity graph is 'healed'. Voxels that are still known to be grounded (1-6) recursively spread their connectivity to neighbouring volatile voxels. Any remaining volatile voxels are disconnected and become falling particles.
So if you hold down 5 while you shoot a wall or something, you can see the connectivity graph change as the bullet holes disrupt paths to the ground.
Okay, that’s amazing. Thanks for the explanation! Nice algorithm. (When a voxel is removed, I guess the voxels that you mark volatile are the ones whose path-to-ground goes through the removed voxel, rather than literally all neighbours.)
I found a couple of other secrets too, but I’m not going to spill them here. There aren’t nearly as many undocumented key commands as in Jasper’s Journeys. ;-)
[Please log in to post a comment]