What makes an RTS formation useful?
An RTS formation is a contract between a group and the positions its units are expected to occupy. The important part is not the visual pattern itself but the relationship between the group destination, formation slots and individual unit movement. A good system can change direction or destination without turning every unit into an independent pathfinding problem.
Start with formation slots
Represent a formation as a collection of local positions around a group anchor. A grid, line, wedge, column or ring can all be generated from the same idea. Keep the slot generator separate from the code that moves units so the same layout can be reused for different gameplay situations.
Assign units predictably
When a player selects a squad, each unit needs a slot. Stable assignment prevents units from constantly swapping places as the formation moves. Distance, current slot ownership and unit role can all be used to choose an assignment, but the result should remain stable until the formation changes significantly.
Move the group, not just the units
The formation anchor should represent where the squad is going. Each slot then becomes a local target. Individual units can steer toward their slots while still reacting to nearby units and obstacles. This separation makes it possible to change speed, spacing or orientation without rewriting the formation generator.
Changing formations at runtime
RTS gameplay often requires switching from a line to a wedge or from a column to a defensive ring. Instead of teleporting units between slots, interpolate from the old slot positions to the new ones. A short transition keeps the group readable and avoids sudden jumps.
Handling large squads
As the number of units grows, avoid doing expensive global work for every unit every frame. Cache formation positions, update expensive decisions less frequently, and let lightweight steering handle the final movement. The goal is to make the formation system predictable rather than to make every unit solve the entire problem independently.
Practical checklist
Start with stable slot generation, predictable assignment, a separate group anchor and a clear movement layer. Then add obstacle handling, regrouping and runtime morphing. This architecture works for RTS games, tactical games, tower defense and simulations.
Conclusion
The most reliable Unity workflows separate responsibilities, make expensive work predictable and turn repeated checks into repeatable systems. Start with a small implementation, measure the real bottleneck and expand only when the project needs it.