Currently we've got floating islands of generated fluff that just sort of hangs out like cartoon characters standing on air that haven't looked down yet - so they don't fall. Well, we're making those blocks look down and react accordingly!
First pass is simply assigning "integrity" to blocks in newly generated chunks starting from the bottom up. The very bottom layer is set to 255 and propagates up, excepting where air gets in the way - any block without support from a block below gets no integrity and is erased! Leading to funny worlds with ceiling-less caves, weird looking trees, and no overhangs for mountains:
Next step after that is letting integrity propagate horizontally and even down, to where it hasn't been applied yet, later possibly also degrading integrity on blocks below due to the mass of blocks above. Different block types wouldn't propagate integrity the same way, so sand can't support sand horizontally. One thing at a time though.
Non-air blocks that end up without sufficient integrity will be immediately erased on chuck gen, so we drop the floating stuff (which could return with special rare buoyant materials in floating island biomes that provide support without being attached to the bottom of the world...)
The integrity values could be stored in a TeraArray and infrequently accessed. Some magic would be needed by chunk edges tho.
Next scenario after that is then recalculating integrity values on block removal (player, explosives, whatever) - normally only needed on the active chunk the player is on. If integrity of surrounding blocks impacted by the removal (which could be a whole mountainside) drop too much they don't just wink out of existence this time....
(you can now theorize why I asked Begla for more modular physics - same thing could be used to chop down trees, break walls weakened by catapulted stones, etc - as long as the blocks-gone-cartoon-characters only gradually realize they're about to fall, so we don't kill the game by over-physics)
Current theorycrafting code goes in Chunk.java but will need lots of tweaks etc: http://pastebin.com/uG4iQa37
Might also be related to me wanting to work on explosive blocks that may or may not be hooked up in series as meta-blocks triggered by a new detonator tool...
Edit: Updated some along with introducing the overall Block Dynamics concept.
Item in issue tracking system has more technical detail (or will soon as I get it in there soon): https://github.com/MovingBlocks/Terasology/issues/137
First pass is simply assigning "integrity" to blocks in newly generated chunks starting from the bottom up. The very bottom layer is set to 255 and propagates up, excepting where air gets in the way - any block without support from a block below gets no integrity and is erased! Leading to funny worlds with ceiling-less caves, weird looking trees, and no overhangs for mountains:
Next step after that is letting integrity propagate horizontally and even down, to where it hasn't been applied yet, later possibly also degrading integrity on blocks below due to the mass of blocks above. Different block types wouldn't propagate integrity the same way, so sand can't support sand horizontally. One thing at a time though.
Non-air blocks that end up without sufficient integrity will be immediately erased on chuck gen, so we drop the floating stuff (which could return with special rare buoyant materials in floating island biomes that provide support without being attached to the bottom of the world...)
The integrity values could be stored in a TeraArray and infrequently accessed. Some magic would be needed by chunk edges tho.
Next scenario after that is then recalculating integrity values on block removal (player, explosives, whatever) - normally only needed on the active chunk the player is on. If integrity of surrounding blocks impacted by the removal (which could be a whole mountainside) drop too much they don't just wink out of existence this time....
(you can now theorize why I asked Begla for more modular physics - same thing could be used to chop down trees, break walls weakened by catapulted stones, etc - as long as the blocks-gone-cartoon-characters only gradually realize they're about to fall, so we don't kill the game by over-physics)
Current theorycrafting code goes in Chunk.java but will need lots of tweaks etc: http://pastebin.com/uG4iQa37
Might also be related to me wanting to work on explosive blocks that may or may not be hooked up in series as meta-blocks triggered by a new detonator tool...
Edit: Updated some along with introducing the overall Block Dynamics concept.
Item in issue tracking system has more technical detail (or will soon as I get it in there soon): https://github.com/MovingBlocks/Terasology/issues/137
Attachments
-
473.3 KB Views: 809