Skip to content

Cache highest cover#4517

Open
perkinslr wants to merge 14 commits intoDevelopmentfrom
cache-highest-cover
Open

Cache highest cover#4517
perkinslr wants to merge 14 commits intoDevelopmentfrom
cache-highest-cover

Conversation

@perkinslr
Copy link
Contributor

@perkinslr perkinslr commented Mar 20, 2026

Additions

Adds highest cover cache to the lighting tracker

Changes

Uses cache-based early out for impact and shot line calculations

References

Reasoning

When scanning for targets in large battles, multiple pawns and multiply flying projectiles all end up cycling through all Things in cells to find the tallest. That answer effectively cannot change mid-tick (strictly, it can, if something is destroyed, but with the way the cache is used, this doesn't matter, at worst it causes an off-by-one-tick issue with projectiles not impacting pawns which pop up from downed right as the projectile flies overhead).

This substantially reduces the shot line calculation costs, and the bullet flight costs in large battles.

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)

@perkinslr perkinslr requested review from a team as code owners March 20, 2026 22:09
@github-actions
Copy link

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

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Mar 20, 2026
@perkinslr perkinslr force-pushed the cache-highest-cover branch from c20578b to 3cc0825 Compare March 20, 2026 22:23
@github-actions
Copy link

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

@perkinslr perkinslr changed the base branch from Development to hitchance March 21, 2026 04:11
Copy link
Contributor

@ViralReaction ViralReaction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good except for possible conflict with another pending PR.

ViralReaction
ViralReaction previously approved these changes Mar 21, 2026
@perkinslr perkinslr force-pushed the cache-highest-cover branch from 9145330 to 73be356 Compare March 21, 2026 04:29
@perkinslr perkinslr changed the base branch from hitchance to Development March 21, 2026 04:31
@perkinslr perkinslr dismissed ViralReaction’s stale review March 21, 2026 04:31

The base branch was changed.

ViralReaction
ViralReaction previously approved these changes Mar 21, 2026
@perkinslr perkinslr dismissed ViralReaction’s stale review March 22, 2026 01:59

The merge-base changed after approval.

@github-actions
Copy link

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

mszabo-wikia
mszabo-wikia previously approved these changes Mar 22, 2026
@perkinslr perkinslr dismissed mszabo-wikia’s stale review March 22, 2026 20:07

The merge-base changed after approval.

N7Huntsman
N7Huntsman previously approved these changes Mar 23, 2026
@perkinslr perkinslr dismissed N7Huntsman’s stale review March 23, 2026 21:41

The merge-base changed after approval.

N7Huntsman
N7Huntsman previously approved these changes Mar 23, 2026
@perkinslr perkinslr dismissed N7Huntsman’s stale review March 23, 2026 21:56

The merge-base changed after approval.

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.

4 participants