Stratkit Army Collision Offset System¶
Resolves visual overlap between armies (and between armies and province icons) using iterative AABB separation.
How it works¶
- Each visible army is treated as a square collider sized from its
ColliderFixedBounds(scaled by the closest zoom level scale), falling back toFallbackRadiuswhen the component is absent. - Province centers within the army bounding box act as immovable circular obstacles.
- Each update schedules a chain of
SeparationIterationJobs that push overlapping pairs apart along the minimum separating axis. The chain short-circuits as soon as an iteration reports no overlap. - Finalized offsets are written back to
ArmyVisualPosition.Offset.
Updates are throttled by a zoom-adjusted frequency (UpdateFrequency … MaxUpdateFrequency). A new separation pass is only scheduled once the previous job chain has completed.
Setup¶
- Add an
ArmyCollisionOffsetModuleandArmyCollisionOffsetConfigasset to your bootstrap. - Tune the config fields:
IterationCount— max separation passes per update (default 10)Padding— extra gap between army colliders (world units)ColliderMultiplier/MinColliderSize/FallbackRadius— collider sizingProvinceObstacleRadius— radius of the circular province repulsion obstacleMaxDisplacement— max world-unit displacement from an army's base position (0 = unlimited)UpdateFrequency/MaxUpdateFrequency— throttle interval at closest / farthest zoomShowDebugColliders— draws AABB and obstacle circles in the editor