RTS Framework Template – 2026
Documentation | Website
Build formation battles and castle sieges in Unity 6. You command companies of soldiers rather than single units. They march and turn in rank and file, lose heart under fire, break and flee, then rally. They can man walls, batter down gates and fight over key points.
It's a working foundation, not a black box. All the source is included as readable C#, set up from the Inspector, with Scene-view tools for the fiddly parts. Two playable demo scenes show every system working together.
Armies and formations
- Groups of any size, from a handful of men to over a hundred, move and fight as one company.
- Drag with the right mouse button to draw the front line. The drag's length sets the frontage and its direction sets the facing.
- Order several groups at once and they form up side by side without crossing each other.
- Soldiers are matched to their new positions, so an about-face doesn't send the ranks walking through each other.
- Groups re-form automatically as casualties mount.
Combat, stances and morale
- Melee and ranged units. Arrows lead moving targets, and walls and buildings block line of sight.
- Stances: Defensive (hold the line) and Aggressive (advance on threats), plus Auto-attack, Double time and an ordered Retreat.
- Morale drains while a group is under fire and depends on how badly it has been hurt.
- Broken groups rout, fleeing with a marker over their heads, then rally and re-form once they reach safety.
- Hit flashes, floating damage numbers, death animations and optional sound effects.
Walls, gates and sieges
- Procedural walls with towers, battlements, walkways and tower doors.
- Draw the outline and place gates directly in the Scene view with handles.
- Gates open only for the faction that owns them.
- Catapults breach wall sections and rams smash gates. The NavMesh updates live, so troops pour through the gap.
- Order infantry onto a wall to man the battlements.
- Buildings have intact, damaged and destroyed models, with optional rubble troops can walk through.
Battle flow
- A deployment phase with a zone for each side and a Start Battle button.
- Capture points: key points, gates handed to whoever takes the point, and a morale shock to the side that loses it.
- Victory by holding the keep or breaking the enemy army, and a defender's win when the timer runs out.
Controls and HUD
- Classic RTS controls:click, box and Shift selection
control groups 1–9 (tap twice to jump the camera there)
attack-move, stop, stance hotkeys
a camera with edge-panning, rotation and zoom
- A modern HUD: group hotbar with health and morale bars, command bar, battle timer, capture point badges, tooltips and a result screen.
- One UI Theme asset controls every colour, icon, font size and animation timing. Change it and rebuild the HUD from a menu item.
What's included
- Full C# source in its own assembly definition, plus editor tools.
- Two demo scenes: SiegeBattle and a sandbox scene.
- Unit prefabs:an animated humanoid soldier
an archer
a placeholder infantryman
a catapult and a ram
- Arrow and boulder projectiles, buildings, walls and example wall-part prefabs.
- Formation and Group Settings assets for quick army setup.
- A 35-page PDF manual with screenshots: installation, building a scene step by step, every Inspector field, troubleshooting.
Requirements
- Unity 6 (6000.0) with the Universal Render Pipeline.
- Packages: Input System, AI Navigation, uGUI / TextMeshPro.
- Three physics layers (Unit, Ground, Building). The manual shows how to set them up.
Please note
- There is no AI commander. Enemy groups defend, react and attack on their own, but nothing plans their strategy.
- Formations are rectangles only.
- There are no ladders or siege towers, and siege engines have no crews.
- The art is simple placeholder art, meant to be swapped for your own.