-
Notifications
You must be signed in to change notification settings - Fork 329
feat: adds CONVOY behavior setting preset and flag to ignore damage output on pathing #6944
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
base: master
Are you sure you want to change the base?
Conversation
…king, also adds special case where unit will face destination
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new CONVOY behavior preset along with a flag to ignore damage output, affecting both path ranking and behavior settings. Key changes include:
- Introduction of new clamp methods (clamp01 and clampUlp1) in MathUtility.
- Updates to BotConfigDialog and various bot components (UtilityPathRanker, BasicPathRanker, BehaviorSettings, etc.) to incorporate the ignoreDamageOutput flag.
- Enhanced Javadoc documentation and minor logging improvements.
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
megamek/src/megamek/codeUtilities/MathUtility.java | Added helper clamp methods with accompanying Javadoc |
megamek/src/megamek/client/ui/dialogs/BotConfigDialog.java | Added UI component and action handling for ignoreDamageOutput flag |
megamek/src/megamek/client/bot/princess/UtilityPathRanker.java | Updated path ranking logic to account for ignoreDamageOutput flag |
megamek/src/megamek/client/bot/princess/Princess.java | Logging improvements with parameterized messages |
megamek/src/megamek/client/bot/princess/PathRanker.java | Expanded Javadoc and minor logic updates for path ranking |
megamek/src/megamek/client/bot/princess/BehaviorSettingsFactory.java | Added new CONVOY preset and null-checks for behavior presets |
megamek/src/megamek/client/bot/princess/BehaviorSettings.java | Added new field and XML serialization for ignoreDamageOutput flag |
megamek/src/megamek/client/bot/princess/BasicPathRanker.java | Enhanced documentation and integrated ignoreDamageOutput flag in scoring |
Files not reviewed (1)
- megamek/i18n/megamek/client/messages.properties: Language not supported
Comments suppressed due to low confidence (1)
megamek/src/megamek/client/bot/princess/UtilityPathRanker.java:150
- [nitpick] When the ignoreDamageOutput flag is enabled, both physicalDamage and firingDamage are set to 0. Please confirm that disabling both damage types is the intended behavior in all scenarios.
if (getOwner().getBehaviorSettings().isIgnoreDamageOutput()) {
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6944 +/- ##
=========================================
Coverage 30.22% 30.23%
- Complexity 15789 15797 +8
=========================================
Files 2885 2885
Lines 283286 283333 +47
Branches 49335 49342 +7
=========================================
+ Hits 85633 85661 +28
- Misses 192052 192056 +4
- Partials 5601 5616 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The clamp01() method indicates "The value if it is inside the range given by the limits (inclusive)", but it only has one input - the value to be clamped. It should include either values to clamp between as arguments, or the JavaDoc updated to show that it is clamping between 0.0 and 1.0 (or whatever values are hard coded). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im glad to see more documentation get added in.
That being said, the nitpick CoPilot picked out is valid. :)
What is it about?
Adds CONVOY behavior setting preset, a behavior controlling flag to ignore damage output (damage that would be caused by this unit onto enemies) when calculating pathing utility score was added, also adds special case where unit will give priority to face towards its destination when fleeing but only if it has the flag
ignore damage output
enabled.What it does?
This small feature adds a simple behavior control toggle
Anything else?
Alot of Javadoc was added on BasicPathRanker to better explain what is happening.
Issues:
This PR potentially resolves the following RFE's