-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block monster and map extra from being generated repeatedly #74703
Conversation
Will this change prevent the EOCs that allow random encounters like the traveling free merchant trader from firing since those events only load on already created maps? edit: |
I don't know, but I don't expect that to be the case. The code not called again is the map extra code and the monster generation code. I would expect the EOC code to not be part of that, but rather being triggered by you actually loading the tile into the reality bubble, whether from memory or file. A further reason for why this would be the case is that if this code DID generate those then they'd only trigger on tiles you haven't visited within the current game session (because generate shouldn't be called when all Z levels of the tile is generated already while "uniform" tiles are regenerated only if they aren't in memory, and I think this only happens when loading from file, and I don't think there is anywhere the tiles are discarded (apart from not saved on saving, as they're regenerated on load instead). However, it's something that would be good to test (and I'd need help with that, as I think I've only encountered these things once or twice in total, so the spawn rate would have to be increased massively to see if they do trigger). |
Ok if I have time tonight I’ll test that and see what happens. Thank you! |
Ok I don't think that impacted the eoc updates. |
Summary
None
Purpose of change
Fix #74697, i.e. map extras and monsters spawning on already spawned terrain when revisited.
Fix #74715, i.e. monsters in tunnels spawning at the surface.
Describe the solution
Describe alternatives you've considered
Introduce a version of the operation that gives you points within a range that only returns the points on a single Z level and use that one rather than generate points on all levels only to reject all hits on other levels. That should probably be done, but this change is faster and less complicated, so I'll leave this for a separate PR.
Testing
Loaded the bug report save and traveled around, looking out for new map extras spawning on previously visited terrain, without finding any new anomalies.
Then continued out into the unexplored territory to verify they do still spawn there when the terrain is generated.
Teleport on top of mine tunnels using the bug report save. Before the change miners were spawning in droves on the surface and only a few in the tunnels. Now they stay in the tunnels where they belong.
Additional context
I've been highly suspicious of the processing of this code because I did not see anything blocking its execution when terrains wasn't generated in the location where the code was moved from. Thus, the code was moved without introduction of any such guard. Apparently I must have missed something that did provide such protection.