Samples & Cleanup¶
Massive Swarm System ships with two optional sample tiers under Assets/CreativeSpore/MassiveSwarmSystem/Samples/. Both are installed by default. You can remove either tier at any time. The core plugin keeps compiling and running without them.
What ships in each tier¶
Starter Combat Kit¶
Located at Assets/CreativeSpore/MassiveSwarmSystem/Samples/StarterKit/.
Scripts plus a small set of combat assets, no scenes. This tier gives you a damage and weapon system to attach to your own GameObjects so combat works without writing it from scratch.
It includes:
- Damageable base classes:
DamageableBase,CombatTargetBase - Combat target types:
PlayerCombatTarget,SwarmAgentCombatTarget,DestructibleCombatTarget - Weapons:
RotatingWeapon(melee),ProjectileWeapon(ranged),SwarmProjectile,TouchDamageSource - Feedback helpers:
DamageFlashFeedback,InvulnerabilityBlinkFeedback,HealthBarDisplay,SpawnPrefabOnDeath,FloatingTextFeedback+FloatingTextManager(floating damage/heal numbers),PooledEffect,SwarmPoolManager - Prefabs and assets:
MSS Combat AgentandMSS HealthBarprefabs, theMSS Floating Text Labelprefab with itsMSS Floating Text Damage/MSS Floating Text Healstyles, plus anMSS Combat Agent Archetypesettings asset
Bringing your own damage system
The damage contract lives in the core plugin, not in this tier: IDamageable, SwarmDamageContext, ITargetable and SwarmAttackProfile. The Starter Kit is one implementation of it. If you already have a health and damage system, implement the contract on your damageable objects and skip this tier entirely.
Implement IDamageable. Swarm contact and melee damage always calls its hit-metadata overload, which is a required member, so there is no half-implemented state that compiles and then silently takes no damage. See Combat contracts.
Full Demo¶
Located at Assets/CreativeSpore/MassiveSwarmSystem/Samples/, split across three folders. Shared holds the gameplay layer every demo builds on, Egypt holds the demo scenes and the art set they run on, and Templates holds the small games you can fork. The three go together: removing the tier means removing all three.
The heavy showcase tier. It contains five playable demo scenes. MSS Pyramid Level, MSS Agent Archetype Sandbox, MSS Tower Defense and MSS Surface Flow Field share the Egypt art set, VAT bakes, the arena generator, level progression (XP), respawn, camera rig, collectibles, and the fully-built example prefabs (weapons, projectiles, player, HUD, and VFX). MSS Zombie City runs on its own house-and-street environment and materials, its own player rig and camera, and a perception-driven zombie archetype instead: see Sample Scenes for what it demonstrates. The tier also ships the demo audio (music, desert ambience, an SFX kit that includes the growl clips Zombie City uses, and its credits file) with the SwarmHordeAudio, SwarmAudioListenerRig and SwarmAlertCallAudio scripts that drive it, plus the in-game quality selector overlay. This is the largest part of the package.
The Full Demo depends on the Starter Combat Kit (for example, the respawn system uses DamageableBase). No Starter Kit script depends on the Full Demo, so the Starter Kit compiles and runs on its own.
One Starter Kit prefab points at Full Demo art
MSS Combat Agent uses the Full Demo's agent death effect, which is built from the demo's shared fire materials. Remove the Full Demo and the prefab keeps working, minus the puff on death. Assign your own effect in Death Effect Prefab, or leave it empty. Nothing else in the Starter Kit reaches across.
Five scripts in this tier are easy to miss because nothing else in this manual points at them.
SwarmQualitySelectorOverlay¶
The in-game performance panel named above. Two of its groups reach past the basic quality popup: Show Post Processing Toggle and Show Resolution Toggle add on/off and native/reduced buttons next to it, so a player can tell the swarm's own cost apart from camera effects and pixel count instead of guessing which one moved the frame rate. Reduce Resolution On Mobile At Start starts a phone or tablet build already rendering below native, Reduced Render Height sets the tallest buffer that reduced setting targets, and Min Render Scale floors how far a tall screen can be scaled down. Tune Camera Effects By Quality Level matches antialiasing and Bloom to the active quality tier, and on a URP project the Camera Effect Tiers array lets you author that policy per level yourself. Leave the array empty and a built-in policy applies instead.
Your own UI can drive the same switches: SetPostProcessing(bool), SetReducedResolution(bool) and ApplyCameraEffectTier(int) are public.
Camera effects need URP
Tune Camera Effects By Quality Level, the Camera Effect Tiers array, the post-processing toggle and the resolution switch only do anything in a URP project. The rest of the panel works on any render pipeline.
SwarmAlertCallAudio¶
Gives Alert Spread a voice: when an agent calls out to the ones around it, this groans from where that agent is standing. Max Hearing Distance caps how far a call carries to the listener, and Min Time Between Groans turns a wave of simultaneous calls into one groan instead of many.
It is also the shipped example of reading swarm events in batches instead of one at a time. It subscribes to AlertCallEvents.BatchReceived and picks the nearest call in the frame, a decision a per-event subscription cannot make because each call arrives without knowing whether a nearer one is still coming. See Simulation events for the pattern in full.
TopDownFollowCamera¶
A follow camera that holds a fixed offset above and behind its target, with damping, and needs no Cinemachine. No shipped scene uses it. It is there for a project that wants a moving follow camera without the Cinemachine dependency.
CinemachineZoomInput¶
Zooms a Cinemachine camera in and out by sliding it along its follow offset, so the angle stays the same and only the distance changes. MSS Zombie City uses it on its player camera. It reads two actions: Zoom Step Action takes one step per mouse wheel notch, and Zoom Hold Action zooms for as long as an input is held, which in Zombie City is Up and Down on the gamepad D-pad. Min Distance and Max Distance bound the range in units, Step Amount is the share of the current distance one notch moves, and Hold Speed sets how fast a held input zooms.
It works on a camera whose Position Control is Follow or Position Composer. It needs Cinemachine 3 and the Input System package.
SwarmDemoOverlayScale¶
A static helper, SwarmDemoOverlayScale.Resolve(), that returns one DPI-aware scale factor so an IMGUI overlay reads the same size on a phone as it does on a monitor. The quality selector overlay already calls it. Reuse it in your own OnGUI panel to match.
Configuring the project for the demo¶
The demo scenes run without any setup, but they run better with it. The Welcome window has a Configure Demo Project button under Demo Project Setup, which appears only while the Full Demo is installed. It does two things:
- Names layers 6, 7, 8 and 9 Player, Enemy, Obstacle and Low Obstacle. A layer already carrying a different name is left alone and reported, so it cannot quietly rename something of yours, and its collisions are left alone too.
- Sets the physics collision matrix among Default, Player, Enemy, Obstacle and Low Obstacle, so the horde stops firing trigger contacts at the player every fixed step and scenery on the Player layer stops blocking you.
It touches nothing else. Every other layer and every other collision pair in your project is left as it was. Run it from edit mode: in Play mode it refuses and tells you why, because layer and matrix changes made during play do not persist.
What each layer is for¶
The demos refer to these layers by number, so they work whether the layers are named or not. Naming them only makes the inspectors readable.
| Layer | What sits on it | What reads it, and why |
|---|---|---|
| 0 Default | Floors and ground, and Zombie City's pushable bins. | Every demo scene's Walkable Layer Mask and the Swarm Settings Ground Layer Mask, so the Surface Flow Field is baked over it and agents stand on it. Default collides with both obstacle layers, so a bin shoved across the street stops at a wall or a fence. A bin carries a Swarm Flow Modifier, which keeps it out of the bake. |
| 6 Player | The player characters, plus the Tower Defense hearth and turrets and the drag target in MSS Surface Flow Field. |
Physics only. The player collides with the horde, the floor and both obstacle layers, so it cannot walk through zombies or walls. Player against Player is off, so a hearth or turret never blocks the player. |
| 7 Enemy | The swarm agents: the Egypt guardians and the Zombie City zombie. | The weapons' Target Mask, which is what a shot may damage. It stays out of every Surface Flow mask, because an agent on a baked layer reads as a wall and carves holes in its own route. Enemy against Enemy is off, so agent colliders never pair with each other, even after you add a Rigidbody to an agent. |
| 8 Obstacle | Walls, buildings, cars, crates and other solid props, and Zombie City's door leaves. | Every demo scene's Unwalkable Layer Mask, so agents route around it. Zombie City's TwinStickWeapon has it in Projectile Collision Mask, so walls and closed doors stop shots. A door is left out of the bake by its Swarm Flow Modifier, which closes and opens the doorway at runtime instead. |
| 9 Low Obstacle | Zombie City's fences, and the Blocker collider of its barricade. | Zombie City's Unwalkable Layer Mask, so agents route around the fences, and the matrix, so the player collides with them. It is left out of Projectile Collision Mask, so shots pass through. Put a prop here to get the same behavior. |
Damage never depends on this matrix: it comes from the targets the swarm tracks. Navigation, blocking and shots don't either, because they test layer masks directly and the matrix does not apply to those queries. What the matrix decides is what the player bumps into and which triggers fire. Physics & Colliders shows what it decides for a Rigidbody prop.
Third-party licences¶
Two files ship inside the package rather than in this manual, because licences belong with the code that needs them:
Assets/CreativeSpore/MassiveSwarmSystem/Documentation/ThirdPartyNotices.txt: every third-party component in the package and its licence.Assets/CreativeSpore/MassiveSwarmSystem/Samples/Shared/Audio/MSS_Audio_Credits.txt: the demo audio, track by track.
Read them before shipping anything built on the demo assets. The audio credits file goes with the Full Demo, so deleting that tier removes it too.
Removal order matters¶
You can remove both tiers independently, but the dependency runs one way:
- You can remove the Full Demo while keeping the Starter Kit.
- To remove the Starter Kit, remove the Full Demo first.
How to remove samples¶
Route A: Welcome window (recommended)¶
Open Tools → Massive Swarm System → Welcome and scroll to the Samples & Project Cleanup card.
Each tier shows its current status (Installed or Removed). Three buttons are available:
- Remove Full Demo: enabled whenever the Full Demo is present.
- Remove Starter Kit: enabled only after the Full Demo is removed.
- Remove All Samples: removes both tiers in one step.
Each button asks for confirmation before deleting anything. Removed files are moved to your system trash via Unity's AssetDatabase.MoveAssetToTrash, so they are recoverable from the trash or re-downloadable from the Asset Store.
Route B: Delete in the Project window¶
Delete the folder directly in Unity's Project window:
Samples/Shared,Samples/EgyptandSamples/Templates: the three folders that make up the Full Demo. Delete all three, or the leftovers will point at missing assets.Samples/StarterKit: removes the Starter Kit. Delete the Full Demo first.Samples: removes everything.
Paths are relative to Assets/CreativeSpore/MassiveSwarmSystem/. The core plugin recompiles cleanly once they are gone.
Skip at import time¶
When importing the package from the Asset Store, you can untick the Samples folder in Unity's import dialog before clicking Import. Neither tier is installed, and the core plugin works immediately.
Remove Full Demo before Starter Kit
Deleting StarterKit while the Full Demo is still present causes compile errors because the Full Demo scripts reference Starter Kit types. Always remove the Full Demo first when deleting the Starter Kit manually.