Skip to content
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

Update Princess hazard calcs and settings #5857

Merged

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Aug 5, 2024

Adds a hazard estimate for Deep Snow and Rubble to Princess' path planning, which previously would cause frequent bog-down rolls due to ignorance Deep Snow's effects and PSRs from entering Rubble willy-nilly.

Deep Snow has no innate damage hazard, but contributes two hazards that could lead to sub-optimal performance for most units:

  1. +1 to all PSRs made within the hex.
  2. Chance to bog down, leading to the unit taking more damage or being unable to fight effectively.

Like Mud, I've used a base hazard of 10.0 to represent the difficult-to-quantify negative score of the possibility of making a PSR or bogging down in the Deep Snow hex.
This is further modified by the units' piloting abilities and the estimate of how easily the unit might bog down, added to the number of turns it would take on average for this unit to escape being bogged down.

Conversely, Rubble can cause a PSR to affected units but only Ultra Rubble increases the PSR target by +1.

This patch now also includes updated titles for the bot config dialog's sliders, as well as corrected Bravery slider labels.

Note: given that Deep Snow does provide some benefits (additional heat dissipation for leg-mounted heat sinks; -2 to ejection rolls) we may wish to rank this hazard slightly lower than mud; in that case, I'd guess a hazard of between 5.0 and 8.0 would be appropriate.

Testing:

  • Ran bot-vs.-bot tests with average IS skill pilots on a map with many centrally-located Deep Snow hexes.
  • Ran all 3 projects' unit tests.

@pavelbraginskiy
Copy link
Collaborator

Would it be possible for the hazard level to be lower only in the case that the unit in question actually has leg-mounted heat sinks? Because it's not a very common feature at all.

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.97%. Comparing base (2582273) to head (4532350).
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5857      +/-   ##
============================================
- Coverage     28.98%   28.97%   -0.01%     
+ Complexity    13909    13908       -1     
============================================
  Files          2512     2512              
  Lines        267268   267308      +40     
  Branches      47786    47798      +12     
============================================
  Hits          77464    77464              
- Misses       185854   185895      +41     
+ Partials       3950     3949       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Aug 5, 2024

Would it be possible for the hazard level to be lower only in the case that the unit in question actually has leg-mounted heat sinks? Because it's not a very common feature at all.

It would be possible, but would require either plumbing in that information as a parameter, saving it in the basicPathRanker, or calling some equipment access functions on the unit from within the hazard assessment functions, which I really don't want to do - these get called multiple (possibly hundreds) of times for each unit / possible path / hex and I'm worried about the performance hit.

Actually, now that I look at this, we probably want to be caching the hazard value for each unit / hex / movement mode combo. And in fact there's a TODO in the PathRanker.java file requesting this...

@Sleet01 Sleet01 requested a review from SJuliez August 5, 2024 14:39
@NickAragua
Copy link
Member

I would recommend adding "leg heat sink presence" to the CachedEntityState (more generally, add a hasWorkingEquipment(location) function and supporting data structure).

@Sleet01
Copy link
Collaborator Author

Sleet01 commented Aug 5, 2024

I would recommend adding "leg heat sink presence" to the CachedEntityState (more generally, add a hasWorkingEquipment(location) function and supporting data structure).

This sounds like the best option, but at this late stage of 0.50.0 development I don't want to start work on it. Seems like a good candidate for 0.50.1.

@Sleet01 Sleet01 marked this pull request as draft August 6, 2024 20:24
@Sleet01
Copy link
Collaborator Author

Sleet01 commented Aug 6, 2024

Going to add Rubble handling as well.

@Sleet01 Sleet01 force-pushed the Add_Deep_Snow_Hazard_Calcs_For_Princess branch from 1f05489 to bb2d1db Compare August 6, 2024 21:35
@Sleet01 Sleet01 marked this pull request as ready for review August 6, 2024 21:38
@Sleet01 Sleet01 changed the title Add hazard calculation for Deep Snow Update Princess hazard calcs and settings Aug 7, 2024
@Sleet01 Sleet01 merged commit f93d5b2 into MegaMek:master Aug 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants