Skip to content

Sample Scenes

Four scenes ship with Massive Swarm System. Each shows a different configuration of the same core components: no new gameplay modes, just progressively more complex setups to copy from.

Open any scene from Assets/CreativeSpore/MassiveSwarmSystem/Samples/FullDemo/Scenes/ and press Play.

MSS Agent Archetype Sandbox

A flat tuning lane for dialing in one archetype's feel. Agents spawn at one end, travel the length of the lane past a few obstacles, get recycled at the far end, and respawn back at the start, so the swarm keeps moving while you edit values.

What's in it: A SwarmRectSpawner at the start (point A) driven by a SwarmSpawnerDirector in Maintain Population mode; a Capsule target at the far end (point B); a SwarmArrivalZone at B that returns arriving agents to the pool; and a row of obstacle cubes mid-lane on the Obstacle layer. It runs on its own MSS Sandbox SwarmSettings and MSS Sandbox Archetype (both under Samples/FullDemo/Settings/), with the stats overlay on.

Use it when: You want to watch how one archetype moves, spaces out, and rounds obstacles while you tweak its Behavior and Movement profiles in the Inspector during Play. Because the lane keeps a steady stream of agents on screen, each change shows its effect on the next wave without restarting.

MSS Pyramid Level

A multi-level Egyptian environment where a player character (Egypt Player) is the swarm target. The SwarmSpawnerDirector maintains up to 1000 agents continuously. A baked Surface Flow Field lets agents navigate the stepped pyramid geometry and routing around obelisks and ruins.

What's in it: Pyramid steps, obelisks, fire pits, stairs, and a ruins floor — all baked to plain meshes (the source was authored in ProBuilder but the shipped scene has no ProBuilder dependency). The player is a SwarmTarget that moves freely. A Cinemachine camera follows the player.

Use it when: You want to see how the Surface Flow Field handles multi-level terrain, or you need a reference for a player-chasing horde scene with high agent counts.

MSS Tower Defense

A level where the swarm continuously attacks a set of static destructible targets — a hearth structure and multiple turrets — rather than a moving player. A SwarmSpawnerDirector drives a single SwarmRectSpawner from one end of the map.

What's in it:

  • MSS Base Hearth — the primary SwarmTarget, a destructible structure with a health pool. Agents make this their primary destination.
  • MSS Turrets — additional SwarmTarget objects arranged across the level. Each turret has its own health pool and a ProjectileWeapon component — a self-contained ranged weapon that finds the nearest targetable agent and fires pooled projectiles at it.
  • A baked Surface Flow Field covering the play area (46 × 69 cells, 1-unit cell size) guides agents around the level geometry.
  • Three Cinemachine cameras provide different view angles.

This scene has no player character. The swarm pursues static targets, and the turrets deal damage back via projectiles.

Use it when: You want a reference for a target-defense setup — multiple SwarmTarget objects on non-player entities, combined with the Surface Flow Field for structured environments.

Adapting Tower Defense for your project

The hearth and turrets are standard GameObjects with SwarmTarget and DestructibleCombatTarget (a sample-only helper script). Replace them with your own structures — anything with a SwarmTarget component becomes a valid swarm destination.

MSS Surface Flow Field

An interactive navigation showcase. Up to 400 Anubis guardians stream around a static S-shaped wall maze toward one target you drag with the mouse, re-routing live as it moves. This is the smallest scene that puts the Surface Flow Field on its own, with no combat or multi-level terrain in the way.

What's in it: A baked Surface Flow Field over the wall maze, a pooled swarm of guardian agents, and the target object carrying two removable sample scripts. PointerDragTarget drags the target across the ground plane under the cursor while the left mouse button is held — turn on its Clamp To Drag Area option to pen the target inside a rectangle. SurfaceFlowDemoOverlay draws a corner panel with the stats readout (active agent count, pooled visual count, and frame rate) plus two live controls: a Swarm size slider that drives SwarmSpawnerDirector.MaxAlive (raising the value lets the director refill over time; lowering it despawns the excess immediately), and a When the target is unreachable: popup that switches the Surface Flow fallback mode at runtime without modifying the settings asset — the three options match the fallback behavior table on the Navigation page. The fallback effect is subtle here: most agents in the open S-maze stay routable, so the difference shows most clearly when you drag the target fully outside the field bounds. PointerDragTarget uses the Input System package.

Use it when: You want to watch the Surface Flow Field reroute a crowd in real time, or you need a minimal reference for wiring a cursor-dragged target. Moving the target is all the field needs to recompute its route, so it doubles as the simplest example of dynamic re-pathing. Drag the target outside the walls and the crowd jams against them instead of leaking through — obstacle blocking keeps agents contained even where the flow field has no route.