Skip to content

Conversation

Keshash
Copy link
Contributor

@Keshash Keshash commented Sep 9, 2025

Additions

Describe new functionality added by your code, e.g.

  • Adds a minimum duration for hunkering of 240 ticks (~4 seconds) to prevent pawns from rapidly switching between states of standing and hunkering.
  • Adds a delay to entering laying down posture when hunkering. Based on move speed, capped to be no less than 10 ticks and no higher than 110 ticks.

Average pawn will get a 30 tick delay, someone shot in the leg gets 110, someone on go juice or with a bionic leg gets 20-25.
Calculated via formula:
changePostureDelay = 10 + Mathf.RoundToInt(60f / Mathf.Max(0.6f, pawn.GetStatValue(StatDefOf.MoveSpeed) - 1.25f))

References

Links to the associated issues or other related pull requests, e.g.

  • Attempts to fix the depicted issue:
  1. https://www.reddit.com/r/RimWorld/comments/1fng9rw/combat_extended_bro_fell_from_the_sky_recovered/
  2. https://discord.com/channels/278818534069501953/278818534069501953/1065251684684681257

Reasoning

Why did you choose to implement things this way, e.g.

  • This issue happens with slow firing weapons. When gunshot frequency matches suppression decay rate, raiders might get stuck dodging bullets but being unable to do anything else. This change makes sure they will stay down long enough to make at least 1 shot against them
  • Adding a posture change delay allows explosion frags and some bullets to reach pawns before they hunker down.
  • Varying posture delay by movespeed allows some fast pawns to ninja-dodge a little

Alternatives

Describe alternative implementations you have considered, e.g.

  • Different delay time?

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • (For compatibility patches) ...with and without patched mod loaded
  • Playtested a colony (specify how long)

@Keshash Keshash requested review from a team as code owners September 9, 2025 23:05
Copy link

github-actions bot commented Sep 9, 2025

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-17597954004.zip

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Sep 9, 2025
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-17610993910.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Download in Comments This PR has a zipfile download available.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant