2
« on: November 25, 2019, 05:35:24 pm »
I've thought about how to implement this in a memory-efficent manner, since there are a lot of voxels, and we don't want to excessively increase the size of all of them. Currently every tile has two flags/counters: one for "is this on fire" and another for "is there smoke here". If we replace both flags with a small index to an array of environmental conditions, index 0 would be "nothing special here", making the common case fast. Other indexes could be reference-counted for how many tiles they represent (allowing unused indexes to be reused) and specify what conditions (fire, smoke, elerium fire, stun gas, anti-alien gas, fog, rain, tear gas, nerve gas, flooded with water, etc) apply to those tiles, as well as the counters for how long the conditions will last. Then we'll just need to implement all the code for how those conditions affect units entering the tiles, and how they affect line-of-sight, weapon fire, etc.