RTS Framework Template – 2026


Developed and tested on macOS in the Editor, with mouse and keyboard ... Documentation | Website ... They march and turn in rank and file, lose heart under fire, break and flee, then rally.


by Leon Twemlow


Price History +

Command formation battles and sieges in Unity 6: morale and routing, breachable walls and gates, siege engines, capture points and a themed HUD.

Requirements

  • Unity 6 (6000.0.70f1 or later)
  • Universal Render Pipeline (URP 17)
  • Input System 1.19 (Active Input Handling set to Input System Package or Both)
  • AI Navigation 2.0
  • uGUI 2.0 with TextMeshPro (TMP Essential Resources must be imported)
  • Physics layers: Unit, Ground and Building

Code

  • 36 runtime scripts and 7 editor scripts, about 11,000 lines of commented C#
  • All code is in the RTSFramework namespace
  • Runtime and editor code are split into two assembly definitions: RTSFramework and RTSFramework.Editor
  • Built from MonoBehaviours and ScriptableObjects, and configured in the Inspector
  • No DOTS/ECS and no third-party code dependencies

Systems

  • Movement: NavMeshAgent pathfinding on a single NavMeshSurface. Formation slots are snapped onto the NavMesh.
  • Unit grid: a spatial grid handles target searches and capture-point counting, instead of physics queries.
  • Runtime NavMesh patching: breached walls and broken gates are rebaked in the background from a copy of the NavMesh data, so the baked asset is never modified.
  • Gate ownership: gates use NavMesh areas 29–31, so each faction can only path through its own gates.
  • Ranged combat: scripted projectiles, with line-of-sight checks against configurable layer masks.
  • Animation: Animator driven by parameters (Speed, Fighting, Attack, Hit, Dead). Root motion is off, and distant units update their animation less often.
  • Hit flashes: unit tinting uses MaterialPropertyBlocks, so no materials are duplicated.

Input

  • New Input System, with an RTS action map defined in InputSystem_Actions_RTS
  • All bindings can be changed in the action map
  • Mouse and keyboard only; no gamepad bindings for RTS controls

UI

  • uGUI HUD on a Screen Space – Overlay canvas, scaled from a 1920×1080 reference
  • All HUD styling comes from one UI Theme ScriptableObject
  • HUD sprites and icons are generated as SDF shapes by an editor tool
  • World-space canvases for health bars, rout icons and damage numbers

Editor tools

  • Custom Scene-view handles for walls (points and gates), deployment zones and capture points
  • Menu items to generate the theme sprites, rebuild the HUD prefabs and create example wall prefabs

Content

  • 28 prefabs: units, siege engines, projectiles, buildings, walls and wall parts, battle objects, HUD and UI widgets
  • 6 ScriptableObject presets: formations and group settings
  • 2 demo scenes with baked NavMeshes
  • 1 Animator Controller
  • Humanoid animation clips from Kevin Iglesias Human Animations
  • Models are low-poly placeholders made from primitives and generated meshes; there are no textures apart from UI sprites

Platforms

  • Developed and tested on macOS in the Editor, with mouse and keyboard
  • No platform-specific code; standalone desktop targets are expected to work

Documentation

  • A 35-page PDF manual in Assets/RTS Framework/Documentation
  • An in-editor welcome window with documentation and support links

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.