Tomb-Editor icon indicating copy to clipboard operation
Tomb-Editor copied to clipboard

TE: Build Cache

Open Raildex opened this issue 2 years ago • 1 comments

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 )

Raildex avatar Apr 26 '24 14:04 Raildex

Maybe it is enough to store a timestamp within Room. On Compilation, the timestamps between the current data and the cache are compared. If the current data is newer, it needs to be rebuilt.

Questions to clarify: TexInfos are part of the room/vertex data. How should that be handled, since tex infos are dependent on their order and are basically unique between level compilations

Raildex avatar Apr 27 '24 10:04 Raildex