branchrust_reboot/main/procpop_debugcancel
11 Commits over 0 Days - ∞cph!
Update: dump_map exports to identity/debug/ folder
- client buildfixes
Tests: built all modes in editor, ran dump_map on craggy
Optim: DensitySpawnPopulation - stop trying to spawn prefabs when used up available prefabs
This eliminates a lot of wastefull attempts
Tests: while at full population, ran dump_map with 1000 items to fill - reported 0 attempts
Bugfix: DensitySpawnPopulation - avoid weighted prefab pool starvation
Bug from 2022 - we never checked if prefab instantiation ever failed, as it has it's own internal checks
Tests: ran spawn.report - saw that junkpiles population was full after boot. deleted junkpiles pop then immediately simulated spawning - saw green pixels, got the count
Update: spawn.dump_map - also report how many spawned and how many attempts were taken
Looking at the texture it's hard to believe it has 800 green pixels, but apparantly it does.
Tests: used dump_map right after delete_populations
Update: differentiate SpawnPosOverride and Density errors
Noticed a bug that can cause random prefab picking starvation (we don't return prefabs if instantiating a prefab fails), will fix in a separate CL to confirm via debug maps
Tests: ran dump_map junkpiles 1000 on 4.5k procgen
Update: refactor SpawnPopulationBase to work with ISpawnHandler
- got rid of SimulateSubFill, consolidated logic
- changed dump_map default simulation count to 100 (to avoid iteration explosion)
- added more fail reasons
This both reduces code duplication and makes sure we run exactly the same SubFill logic when simulating to generate debug maps
Tests: ran it on 4.5k procgen with dump_map junkpiles 1000 - found why they don't spawn
Bugfix: fix spawn ticks counting non-max pop as a fail, instead of requested spawn count
Tests: none, trivial change
Update: add ability to dump pngs of simulated spawning of a population
Tests: used locally
Update: spawn.report now also reports failed tick and how much were spawned recently on average when failing
Can use this as a further estimate which population is costing us when trying to spawn full pop
Tests: used in editor
Update: spawn.report now outputs max attempts it can do for next tick
Helps quickly spot what's the worst contributor to spawn overhead
Tests: used in editor on Craggy