Skip to content

Sample Scenes

Five scenes ship with Massive Swarm System. Each shows a different configuration of the same core components, from a flat tuning lane to a horde that has to notice you before it reacts, so there is always a working setup close to what you are building.

Four of them live under Assets/CreativeSpore/MassiveSwarmSystem/Samples/Egypt/Scenes/. MSS Zombie City lives under Assets/CreativeSpore/MassiveSwarmSystem/Samples/Templates/ZombieCity/Scenes/ instead. Open any of them 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-shaped Swarm 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/Egypt/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 built around a player character (Egypt Player), with static defences scattered through it. A SwarmSpawnerDirector in Continuous mode feeds three spawners and ramps the pressure up as the session runs. A baked Surface Flow Field lets agents navigate the stepped pyramid geometry, 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, and a Cinemachine camera follows it. Alongside the player sit 13 turrets and two hearth structures, each a SwarmTarget of its own with a health pool, and the turrets shoot back. The player's target Priority is higher than the turrets' and equal to the hearths', so the swarm prefers the player over a turret but will happily chew on whatever is closest.

Difficulty ramp: The director starts with 8 agents alive and raises that ceiling by 4 every second. The hard cap is 8000, which a normal play session never approaches, so what you actually see is a crowd that keeps thickening for as long as you leave it running. Lower Max Alive Increase Per Second on the director to slow it down, or turn Increase Difficulty Over Time off to hold a flat count.

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 that also has to deal with fixed structures.

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 at a 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. 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. That is where the scene opens, not the ceiling: the overlay slider takes it anywhere from 50 to 600. 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 two removable sample scripts. On the Swarm Target object, 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. On its own Demo Overlay object, 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, and 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, because obstacle blocking keeps agents contained even where the flow field has no route.

MSS Zombie City

A street of sleeping zombies that wake to what they see and hear. Every zombie carries a Perception Profile, so instead of always knowing where you are, it idles until it notices you by sight, by sound, or because a nearby zombie already spotted you and called it in. Open this scene when you want to watch Perception run rather than read about it.

What's in it:

  • Environment: one city block that joins a multi-room building (living room, kitchen, bedroom, bathroom, laundry, office, meeting room, server room and a lobby) to an outdoor street (a school bus, wrecked cars, a van, barriers, dumpsters), on its own set of materials. The scene stores no bake. Its Surface Flow Field is built when the scene starts, because the Swarm Manager's Auto Bake On Awake is on. It is cut into 0.5-unit cells and covers the full 94 × 94 unit block, so zombies route through doorways and around every car and crate.
  • Fences you can shoot through: the street fences stop zombies and the player, but not bullets. Their colliders sit on layer 9, which Configure Demo Project names Low Obstacle. The Swarm Manager's Unwalkable Layer Mask includes that layer, so the Surface Flow Field routes zombies around the fences, and the player's collider collides with it. The player's TwinStickWeapon leaves it out of Projectile Collision Mask, so shots fly through and still hit the zombies behind. To give another prop the same behavior, put its collider on layer 9.
  • Doors, barricades and bins: the house has 24 doors and every one starts shut. A door opens when you walk into it and closes behind you once the doorway is clear. Zombies cannot open one, so a crowd chasing someone on the other side batters it until it breaks, and a broken door stays open. Three barricades close alleys through the street facades and lose a plank at a time as they are hit. Like the fences, they stop you but not your shots. The eight trash bins work differently: the crowd shoves them out of its way, and so can you. All three are built from the components on Doors and Barricades.
  • Spawning: a SwarmSpawnerDirector in Maintain Population mode spawns an initial batch of 400 zombies, holds the population there, and replenishes at 3 per second as zombies die.
  • The zombie archetype: its own character, baked with VAT Animator from an idle, a shamble, a jog, a claw attack and a death, so a zombie falls and lies still before it fades and bleeds when it goes. Its Max Speed is a curve with a steep step in it rather than a random range, so the horde splits into two kinds instead of a spread: most shamble and the rest run. The attack is a Swing timed to the claw, so stepping back while it winds up makes it miss. Its Perception Profile, MSS Zombie Perception, narrows Sight's Range to 18 units and its Field Of View to 120 degrees, and sets Occlusion to Navigation Path, so a zombie behind solid geometry stays unnoticed until it has a walkable line to you. Awareness's Forget Time is stretched to 12 seconds, so a zombie that spotted you keeps coming for a while after you break contact. That is long enough for a runner with a clear way to reach the spot where it last saw you from anywhere it could see you. A shambler is slower and gives up on the way unless it was already close. Alert Spread is on, so a zombie that sees you calls the ones nearby. A zombie with nothing to chase shuffles for about 4 seconds, then stands for about 5 before it shuffles off somewhere else, which is Idle Motion's Rest Time at work. Following The Crowd is off, so a zombie that loses you falls back to Searching for your last known spot instead of copying a neighbour's heading.
  • The player: a CharacterController driven by a twin-stick control scheme, MSS Zombie City Controls, whose Gameplay map holds Move, Aim, AimPoint, Fire, Jump, Sprint, Reload, Zoom Step and Zoom Hold. It walks at 1.7 units a second, faster than a shambler and slower than a runner, and sprints at 5.5 while Left Shift or the left trigger is held and the fire button is not. Sprinting drains the green bar under the health bar in 4 seconds. Empty it and you walk until it has refilled to 35%, with a heartbeat that gets louder and faster as it runs down. The zombies have Predictive Catch-Up on with a 0.6 second lead, so the runners cut you off instead of trailing behind. The rifle holds 30 rounds and takes 1.5 seconds to reload. It reloads when the magazine runs empty, or earlier on R or the gamepad's west button (X on an Xbox pad), and the count at the bottom of the screen shows what is left. Ammo never runs out. A zombie has 60 health and a shot deals 20, so each one takes three hits, and shots scatter up to 2 degrees to either side of the aim. A small label in the bottom-right corner lists the controls. Its TwinStickWeapon triggers a separate Swarm Noise Emitter on every shot, so a zombie that never sees you fire can still hear it and come looking. A Cinemachine camera holds the view above and behind the player. Its CinemachineZoomInput zooms in and out with the mouse wheel or with Up and Down on a gamepad D-pad, and a SwarmAlertCallAudio component turns every Alert Spread call into an audible groan. Both scripts are covered in Samples & Cleanup.
  • HUD: the same MSS Demo HUD prefab the Pyramid Level uses, from Samples/Shared/Prefabs/UI/. It draws the performance panel in the top-right corner (agent count, frame rate, quality level, shadows and resolution) and a shortcut line along the bottom: Tab shows the stats overlay, B adds 100 zombies, 1 to 3 switch quality and Escape quits.

Use it when: You want a reference for a perception-gated horde, where agents have to notice you, remember you for a while, and call each other in, rather than a crowd that already knows where you are the moment it spawns. It also works as a self-contained twin-stick shooter template: player movement, aim, fire, and a Cinemachine follow camera with zoom. Its doors and barricades are the place to look for an obstacle a crowd breaks through.