feat(port): increase default search range for mission placement, sanity-check search properties for scenario missions #5900
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Required
main
so it won't cause conflict when updatingmain
branch later.Optional
Purpose of change
This extends the range of mission search if search range is undefined, along with some other improvements ported from DDA. Shifting missions to not be limited in search radius will be useful for when #5723 is merged, as it may become a drunken crapshoot how far off a true-unique location will end up being.
Describe the solution
C++ changes:
JSON changes:
Describe alternatives you've considered
Doing it closer to how DDA's implementation does it would have it also print a load error for even bother to use search radius for non-random mission targets. While the feature is not strictly needed now that the default search range is huge, there is the possibility that for performance one might want to limit search range for missions where the mission designer can be reasonably certain the target location will be found within that range.
Testing
One thing I noticed during testing: If a scenario is set to start a mission, it can hang up and take forever to search if it's using a big enough search distance:

One Last Assassination and The Last Delivery should be more likely just fail with a quick skippable error message and break the mission instead of being stuck searching forever with these mission settings when used on particular finicky city size settings, which is still not ideal but better than it being stuck loading forever. Checked in my old desktop build (still on build
2024-11-26
) to confirm that the mission can already fail on oddball city size/distance settings in existing builds.Additional context
PR being ported, "Remove mission search radius from most missions" by @RenechCDDA: CleverRaven/Cataclysm-DDA#78949