Ignore isolated fish resources for fisheries#1925
Conversation
|
Updated. I cleaned up the test as requested. The extra Validation:
|
2f16b65 to
58c0217
Compare
|
Thinking about this again: Wouldn't it make more sense to "fix" the map during loading? |
58c0217 to
7e4777e
Compare
I reworked this in the direction you suggested. The isolated/non-water fish cleanup now happens once in Connected water with fish is unchanged; isolated one-node water and non-water fish resources are normalized away during world resource setup. Validation:
|
Flamefire
left a comment
There was a problem hiding this comment.
Please no force-pushes during a review. If necessary a revert works too. This way I have to check more changes.
Doesn't matter much for this small PR though.
With the added method in GameWorld: I think GameWorld::SetupResources() belongs more to MapLoader. Because that is the only context where it makes sense to call it, doesn't it?
So if I'm not missing anything please move those methods. SetupResources can be a public method, and the others can be private.
0fde365 to
5e47234
Compare
Sorry about the force-push. I’ll avoid force-pushing this PR from here on and use normal follow-up commits instead. |
|
I moved the resource setup logic from The fish cleanup behavior is unchanged: fish on non-water and isolated one-node water is removed, while connected/larger water keeps fish. The row-local optimization for consecutive fish water is still in place. Validation:
|
Some, yes: For replays starting at zero, i.e. with a map as the base it will now remove some fish so fishers may not go out or somewhere else instead. Double-checking and will update the replays in this branch if required. Maybe in a way that won't break them in similar ways if possible |
F10 is used by the settings dialog now. F7 is already a cheat key so reuse that.
Removing "invalid" fish spots makes the replay go async. Update the instruction on where to find the map and use a savegame for one of the 2 replays to ensure savegame-relevant changes do not affect replays not started from GF 0.
The 200kGFs replay has been updated to use a savegame.
b69a114 to
4d04897
Compare
|
Ok, done. The async in those replays is avoided now, I also changed the test to include a replay started from a savegame to cover the 2 different cases that are exposed here: Starting a replay that was started from a save game would have worked |
|
Pushed a small follow-up fix for the CI warning. The Linux clang build treated the intentionally unused named parameter in the autoplay |
|
And hopefully the last one: The Boost version we use on Jenkins doesn't handle output of |
Summary
MapLoaderMotivation
Fisheries could still produce fish from an isolated one-node water pond if that node had a fish resource. In the original behavior described in #1171, such isolated water should be exhausted without producing fish.
This change keeps larger/connected water usable, but removes fish resources from unusable water during map resource setup.
Implementation details
Resource setup is now handled by
MapLoader::SetupResources(GameWorldBase&).The setup step normalizes resources after map loading:
The fisher runtime path remains simple and only checks whether fish resources exist.
The fish cleanup iterates row-by-row and uses a row-local shortcut: if the previous point in the same row was kept as fish-on-water, the current water fish point does not need the full neighbor-water scan. This shortcut is not carried across row boundaries.
Validation
Test_integrationlocally with Visual Studio 2022 / DebugTest_integration.exe --run_test=BuildingSuite/FisherIgnoresIsolatedFishWater --report_level=shortTest_integration.exe --run_test=BuildingSuite --report_level=shortgit diff --check upstream/master...HEADFixes #1171