Tomb-Editor
Tomb-Editor copied to clipboard
TE: Build Cache
When you have more than 100~ rooms in a level, building it becomes extremely lengthy, depending on the complexity of the rooms.
I suggest adding a "build cache" system that saves a room mesh to disk. I propose a text format such as JSON for the cache, since it's quicker and safer to implement compared to a binary format. After a room was successfully built, a cache representation is written to disk (maybe in the OS temp folder, distinguished by level and room id). The proposed contents are (for legacy) :
- a representation of the sectors
- a representation of lights in the room
- a representation of neighbouring rooms
Before a room is built, a representation is built and compared to the one on disk. if any of the things does not match, the room needs to be built.
Different Engines should be able to write different cache content. (I.e. the cache is part of the compilation process, not part of the models such as Room.cs )