Skip to content

Collision and Extents

A unit has one description of its physical presence, Sein Extents: a set of shapes plus a handful of switches. Four systems read it and each decides separately whether to care.

System What it reads from Extents
Collision Shapes, Collision Enabled, Mobility, Mass, Object Type, Collision Responses
Navigation Blocks Nav, Blocked Nav Layer Mask, Bakes Into Nav. The shapes are the blocked footprint
Fog of war Blocks Fog Of War, Blocked Fog Of War Layer Mask, Bakes Into Fog Of War. The shapes and their Height are the occluder
Selection Selection Policy, Include in Drag Selection, Selection Group, Selection Priority. The shapes are what the cursor and marquee hit

Formations and pathfinding also use the shapes to size a unit: its footprint radius is the largest bounding radius of its shapes. The switches are independent. A wall can block paths without being a collider. A cloud of smoke can block sight and nothing else.

An Extents component holds one or more shapes. Each is one of:

  • Capsule. An upright capsule. Seen from above it is a disc of Radius. It suits infantry and props.
  • Box. An oriented box, turning with the unit’s yaw. Half Extent (Forward) and Half Extent (Right) are half the length and half the width, so a box of 540 by 230 has half extents 270 and 115. It suits vehicles and buildings.

Every shape also has a Local Offset, a Yaw Offset Degrees, and a Height. The offset moves the shape in the unit’s own space and rotates with it. Z is honored, so a turret can sit above a hull. Height is the shape’s vertical span above its offset. Two shapes at different heights do not collide.

Use several shapes for bodies that are not a single blob: an L-shaped building is two boxes, and a vehicle can be a hull plus a turret.

A shape’s footprint radius is its Radius for a capsule, and its half diagonal for a box (the square root of the two half extents squared and summed), so a rotating box never overlaps a neighbour. The length of a shape’s planar Local Offset adds to it. A Truck with half extents 270 and 115 has a footprint radius of about 293. A unit with no shapes falls back to Fallback Footprint Radius on Sein Navigation.

Height matters beyond collision. A shape with Height 0 never blocks fog of war, because a flat occluder cannot hide anything from above. Give a capsule you want to read as a sphere a Height near its Radius.

Collision is off until you turn on Collision Enabled. An entity without it is invisible to the collision system: nothing pushes it, and it generates no overlap events. When it is on, each tick the collision system finds pairs whose shapes overlap in both the ground plane and height, and resolves them.

Mobility Meaning
Static Never moves after spawning. Infinite mass, and cached so it costs nothing per tick. Two statics never collide. Use it for walls and buildings
Stationary Can move, but is never pushed. Infinite mass, rebuilt every tick. Use it for doors, drawbridges and platforms that a script moves
Movable Moves, has finite mass and takes part in pushing. Units and pushable props

Mobility is never guessed from a movement component. Author it. A Static entity that moves warns once.

When two Movable bodies overlap, they split the separation by mass. A body of mass M against a body of mass m moves m / (M + m) of the overlap. A Soldier (mass 100) against a Truck (mass 400): the Truck moves 20 percent of the overlap and the Soldier 80 percent.

Beyond the Mass Ratio Cutoff the heavier body does not yield at all. It is 8 by default, in Project Settings > Plugins > SeinARTS > Collision. A Truck of mass 1,000 against a Soldier of mass 100 is a ratio of 10. The Truck does not move, and the Soldier absorbs the whole overlap, so a crowd of infantry cannot shove a tank no matter how many pile on. Only ratios matter, and 100 is the default baseline. Mass has no effect on footprint, navigation or movement.

A channel is a name for a kind of body. Each collider has one Object Type (its channel) and a response to every channel: Ignore, Overlap or Block.

  • The project lists channels in Collision > Collision Channels. Default always exists and cannot be removed. Each channel has a Default Response, the response every collider gives it unless the collider overrides it.
  • A collider’s Collision Responses hold only the overrides. The details panel draws them as a matrix, like Unreal’s.
  • Object Type None makes a collider inert even with Collision Enabled.

A pair resolves to the weaker of the two responses. Block needs both sides to Block. If either side Ignores, the pair does not see each other.

A’s response to B B’s response to A Result
Block Block Pushed apart
Block Overlap Overlap event, no push
Overlap Overlap Overlap event, no push
Any Ignore Pass through

For example, add two channels, Infantry and Scout. Give Soldiers the Object Type Infantry and Scouts the Object Type Scout, and in the Scout’s Collision Responses set Infantry to Ignore. The Soldier’s response to Scout is still Block, but the weaker side wins, so the pair passes through. Scouts slip through a crowd of infantry and still collide with walls, whose Object Type is Default.

An Overlap pair fires Collision Overlap Begin when the bodies first overlap and Collision Overlap End when they separate or one is destroyed. They arrive as visual events with both entities. An actor receives them through the Entity Bridge’s On Visual Event.

Resolver Class picks the algorithm. The default pushes overlapping bodies apart along their shortest separation with mass weighting, repeats until settled, and holds a body at a wall or the edge of the grid rather than shoving it through. Sein Collision Resolver (Parallel) spreads the work across threads for large unit counts. None turns resolution off: solid bodies overlap freely and overlap events stop.

These are separate on purpose. Nav blocking changes the routes units plan. Collision changes where bodies end up after they move. Neither reads the other’s switches.

The one link: collision treats cells the navigation has blocked as immovable walls, so a unit cannot be pushed through a baked wall even if the wall has no collider.

Entity Nav Collision Fog Typical settings
Placed wall Baked in Static Baked in Bakes Into Nav, Bakes Into Fog Of War, Collision Enabled, Static
Building the player builds Runtime blocker Static Runtime occluder Blocks Nav, Blocks Fog Of War, Collision Enabled, Static
Soldier None Movable None Collision Enabled, Movable
Smoke cloud None None Runtime occluder Blocks Fog Of War only
Fence None Static Baked in Bakes Into Fog Of War, Collision Enabled, Static. Pathable by design, but solid and sight-blocking

Bake what was placed in the editor and never moves, and use the Blocks switches for what spawns and dies during a match. See Navigation and Level Data.

Selection uses the shapes to decide what the cursor and the marquee hit, and four settings to decide what may be selected together. A unit also needs shapes and to be selectable at run time, which an ability can change with Set Selectable.

Setting Meaning
Selection Policy Unrestricted, Like Units Only, Single Only or Disabled
Include in Drag Selection Whether a marquee picks the unit up. Clicks, select-by-type and control groups still can
Selection Group A tag that makes different classes count as like units. Empty means the exact actor class
Selection Priority Which unit wins when a replacement selection holds incompatible ones

The policies:

  • Unrestricted can share a selection with any unit whose own policy allows it.
  • Like Units Only shares only with units in the same Selection Group, or of the same class when the group is empty.
  • Single Only is selected alone, including in a control group of only that unit. A marquee that holds several picks only the highest-priority one.
  • Disabled never enters the selection. The unit can still be hovered and targeted by abilities.

A common setup: infantry Like Units Only, a hero Single Only, and buildings Single Only with Include in Drag Selection off, so a marquee through a base never grabs a Factory. To let different classes select together, such as two rifleman variants, give them the same Selection Group.

When a replacement selection mixes incompatible units, the higher Selection Priority stays, and equal priorities are decided by entity order. Adding to a selection always keeps the compatible units already selected.

Use Extents For Marquee (Project Settings > Plugins > SeinARTS > UI) makes the marquee test the units’ real shapes. Off, it approximates each unit by a cheaper hull that can over-select tall units under an angled camera.

The collision library answers “what is near here?” from any simulation graph:

Node Returns
Get Entities In Range Every entity within a radius of a point
Get Nearest Entity The closest one within a radius, or an invalid handle
Get Entities In Box Every entity inside an axis-aligned box
Get Distance Between Distance between two entities
Get Direction To Unit direction from one entity to another

The first three take an optional Filter Tags container and keep an entity if it holds any tag in it. An empty container keeps all.

Three things to know:

  • The queries measure from each entity’s origin, not its shape edge. A big building 10 units outside the radius is out, though its footprint overlaps the circle.
  • They find every live entity in the world, whether or not it has Extents or has collision enabled.
  • Results come back in a fixed entity order, so the same query gives the same list on every machine, and ties in Get Nearest Entity go to the earlier entity.

Use them in abilities and effects: count enemies near a beacon, find the nearest depot to a returning worker, apply an aura. For choosing the best target for an attack, use the targeting library instead (see Write a custom target scorer).

Run Sein.Show.Extents to draw every unit’s shapes as red wireframes. Sein.Show.Steering draws each unit’s footprint ring. Use them first when units collide oddly, block paths they should not, or cannot be selected.

Setting Soldier Truck Barracks
Shape Capsule, Radius 40, Height 180 Box, half extents 270 and 115, Height 220 Box, half extents 400 and 400, Height 300
Collision Enabled On On On
Mobility Movable Movable Static
Mass 100 400 not used
Blocks Nav Off Off On
Blocks Fog Of War Off Off On
Selection Policy Like Units Only Single Only Single Only
Include in Drag Selection On On Off

A Soldier walking into the Truck gives way for 80 percent of the overlap. Walking into the Barracks it gives way for all of it, and the Barracks’ footprint is already a blocked area on the nav grid, so paths avoid it before the Soldier ever touches it. A marquee dragged over all three leaves the Barracks. The Soldier and the Truck cannot share a selection, and their priorities are equal, so it keeps whichever has the earlier entity order.

  • Collision Enabled left off. The unit is not pushed, not avoided, and overlaps freely.
  • Static on a unit that moves. A static collider is cached. If it moves it logs a warning once. Use Movable, or Stationary for a scripted body.
  • Mass that never matters. Masses within the 8:1 cutoff of each other split the push. Beyond it, the heavy body ignores the light one entirely. Pick the ratio you mean.
  • Height 0 on a blocker. Nav blocking still works, fog blocking silently does not.
  • Object Type None. The collider is inert.
  • Assuming a nav blocker is solid. Blocks Nav alone does not stop a unit that is already inside it. It changes routes. Add collision for a solid body.
  • Mixing up the half extents. They are half the size. A box 540 long has Half Extent (Forward) 270.
  • Querying by edge. Range queries use origins. Add the target’s footprint radius to the range when you mean contact.