Skip to content

fix: cap physics push and reduce combat spreading to prevent unit sca…#1381

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-ai-unit-engagement-lzsHo
Feb 5, 2026
Merged

fix: cap physics push and reduce combat spreading to prevent unit sca…#1381
braedonsaunders merged 1 commit into
mainfrom
claude/fix-ai-unit-engagement-lzsHo

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

…ttering

Root cause: physics push had no cumulative force cap. With 20 tightly-packed units, each unit received up to 3.0-4.5 force per neighbor × 8-12 neighbors = 15-36 total force, while separation capped at 2.0 and cohesion was 0.1. When units transitioned from attackmoving to attacking, they lost cohesion/ alignment forces, leaving uncapped physics push as the dominant force.

Three fixes:

  1. Cap cumulative physics push force (same 2.0 cap as separation)
  2. Reduce physics push 75% for combat units (SC2-style tight grouping)
  3. Extend cohesion/alignment to attacking units closing to range

https://claude.ai/code/session_012Sc49F3UHGXxttLJpBPggB

…ttering

Root cause: physics push had no cumulative force cap. With 20 tightly-packed
units, each unit received up to 3.0-4.5 force per neighbor × 8-12 neighbors
= 15-36 total force, while separation capped at 2.0 and cohesion was 0.1.
When units transitioned from attackmoving to attacking, they lost cohesion/
alignment forces, leaving uncapped physics push as the dominant force.

Three fixes:
1. Cap cumulative physics push force (same 2.0 cap as separation)
2. Reduce physics push 75% for combat units (SC2-style tight grouping)
3. Extend cohesion/alignment to attacking units closing to range

https://claude.ai/code/session_012Sc49F3UHGXxttLJpBPggB
@braedonsaunders braedonsaunders merged commit 844c8ae into main Feb 5, 2026
4 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.

2 participants