tiwaz1994 / DynamicBulwarks

Fork with improvements for Dynamic Bulwark.
2 stars 1 forks source link

Deferred loot spawning, perf, refactor #33

Closed ChronosWS closed 4 years ago

ChronosWS commented 4 years ago

Loot spawning is now split into two phases - generation and reveal. Generation happens at the end of the wave because it takes a long time. Objects are created but hidden and not simulated. Once the wave starts, all of the old loot is cleaned up and the hidden loot is revealed, which happens much more quickly. Also, the start of the wave is no longer blocked by loot spawning - if for some reason it takes a long time to spawn, the wave will still start on time, and spawning will occur over time.

Loot spawning code has been refactored and separated out for clarity. Randomization of loot locations is now unified across all loot types, and failures to find locations are handled gracefully.