Open schauveau opened 3 years ago
I started another Lab game today and that did not happen so this is not systematic. I still think that this is related to reaching a new z-level but there is probably one or more additional factors to consider.
Tested on (cdda-windows-tiles-x64-2021-06-20-0737) with no mods core content pack only. Setup an unsorted loot zone and a custom zone with no limitations on the ground floor of a hospital then climbed to the roof and back down. the zones were still there. Going to the basement also did not remove the zones.
You can check the z level thing by using the show all zones command in the zone menu.
As I wrote I my second comment, the bug does not always happen. However, I was just able to reproduce it from a brand new Lab game by doing pretty much nothing. I did not take note of al my steps but that basically went like that:
Interestingly, the distance was wrong both vertically and horizontally (e.g. 10 UP_NE vs 3 NE)
I will try to reproduce it while recording the screen.
Here it is https://www.youtube.com/watch?v=SmIs-E5IZQw
At 1:23, the zones are duplicated with crazy distances when I list them at level -1 and they are gone when I reach the initial level.
And in case that is not obvious, the zones are not gone (yet) at 1:13. I was a bit confused and I forgot to enable "Show All" so I had to reopen the Zone menu a few seconds later.
I wonder if leaving the room at 1:05 could be important (because that would cause the whole map to be resized).
I just figured out that the zones with crazy distances are from my previous game which is strange because my option "World End Handling" is set to "Reset". Could it bethat an incorrect reset of the Zones is causing the problem?
Yeah! There is definitely a problem with the Zones when a game is finished and a new one is immediately restarted without closing the cdda program. The old zones still appear when using "Show all". That also happens if the world is physically destroyed between the two games.
Steps to reproduce:
I browsed through the code and the problem described in my last two comments is because the static zone_manager is neither cleared after quitting a game nor when creating a new game. However, it is cleared by zone_manager::deserialize()
while loading the save file.
For a quick and dirty verification, I added zone_manager::get_manager() = zone_manager();
in game::cleanup_at_end()
and that seems to solve the problem. zone_manager
is quite complex, so I cannot say for sure that this is not introducing other problems. A proper 'clear()' member would be better.
Clearing it in DynamicDataLoader::unload_data
seems like the solution here.
Indeed! I will create a zone_manager::reset()
and submit a pull request.
I am using the Debian package 0.E so not quite up to date. The bug may already be solved but I could not find any related bug report.
For a long time, my loot zones were disappearing in a rare but unpredictable manner. Fortunately, they can be restored by saving and reloading. I now believe that the problem is quite reproducible by reaching a new Z-level.
For example, I am currently playing a Lab Escape below a research facility. I was lucky to spawn near the lab exit so I setup my loot areas in the guard room. Then I climb the stairs to reach the roof and when I come back to the guard room, my loot zones are gone. I suspect that they are now at a wrong level but that needs to be verified. I save and reload the game to restore the loot areas. Then I start exploring down until I reach z-level -3 for the first time and when I come back my loot areas are gone again.
Versions and configuration