I’m making a building system with a feature where the player can only place certain types of blocks in an enclosed room which they have to build first. To detect said enclosed rooms, I would use flood fill to check each tile. So far I have 4 options:
-
To use Region3s or OverlapParams (or something similar)
This would involve creating thousands of Region3s since even a small 10x10x10 plot would still amount to 1000 tiles. -
To store the occupied tiles in a table
This is similar to the first option since it involves possibly creating thousands of tables for each block placed. For example, A 4x4x4 block would amount to 64 tables (1 table for each tile). If a player is dedicated enough to fill a 20x20x20 plot with 4x4x4 blocks, it would amount to 8000 tables. (if my math is correct). -
To use some sort of external API to do the calculating + storing
I am not exactly familiar with APIs. I don’t even know if this is possible or efficient. -
To not do it at all. (not preferred)
I haven’t seen any game do this before (at least in roblox) and probably for good reasons. Is this too ambitious?
- Option 1: Region3s
- Option 2: Tables
- Option 3: External APIs
- Option 4: no.
0 voters