Open
Conversation
62ec9c3 to
56b075a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I spent some time looking in to #7025 and it's actually a touch more complex than expected. The AI code limits the guard range with various hardcoded multipliers based on the offending object (weapon, hostile ship, asteroid, etc) and in one instance has an actual hardcoded distance in meters. These values also take in to account the size of the guardee. So it's really pretty complex.
I felt a Guard Tight order would further muddy this up by adding more hardcoded values or multipliers and it wouldn't be easily tunable or readily apparent what the actual difference is for players or mission designers.
After some experimentation I landed on a design that is maybe a touch overly simplistic in some ways but also more configurable. I've added a
set-guard-rangesexp that works as a clamp for the guard order ranges. The game will use the normal hardcoded logic but if the guard range is > 0 for the guardee ship then it will clamp the calculated range to the guard range. This can be done per-ship which gives mission designers flexibility to tune the guard range based on context. There is not any checking for positive values so you could probably get some pretty interesting AI behavior if the range is set to a value that's too small for the guardee ship class (50m for an Orion might be strange). However, I felt that adding a bunch of dynamic checks was overkill here and mission designers are smart enough to set realistic ranges.This setup has the advantage of allowing the opposite as well. With set-guard-range you could expand the guard distance if the mission design calls for that sort of thing. Bonus!
Fixes #7025