Enemy Crowd
The EnemyCrowd ScriptableObject is the core definition asset for any faction or unit type in Enemy Masses. It defines who the agents are, how they look, and how they behave in combat or civil scenarios.
Instead of configuring thousands of individual GameObjects, you configure one EnemyCrowd asset, and the system applies these settings to every agent of that type.

Creating a New Enemy Crowd
Right-click in your Project window.
Select Create > Enemy Masses > Enemy Crowd.
Name your asset (e.g.,
Orc_Grunt,Human_Archer).
1. Identity & Visuals
These settings define the basic appearance and classification of the unit.
Faction Name: The broad group this unit belongs to (e.g., "Orc Horde", "Kingdom Guard"). Used for IFF (Identification Friend or Foe) in Faction Battles.
Enemy Type Name: The specific role (e.g., "Grunt", "Archer").
Prefab: The character prefab to spawn. Must have a
GPUICrowdInstanceandNavMeshAgentcomponent (added automatically if missing).Faction Color: A tint color used for debug gizmos and minimap icons.
Faction Material: (Optional) Overrides the material on the spawned agents. Useful for creating color variations of the same mesh.
Death Effect Prefab: (Optional) A particle effect spawned when an agent dies (e.g., blood splash, explosion).
2. Stats & Multipliers
Global multipliers allow you to balance units quickly without editing the prefab or code.
Health Multiplier: Scales the base health.
2.0= Double Health.Damage Multiplier: Scales outgoing damage.
1.5= +50% Damage.Incoming Damage Multiplier: Scales damage taken.
0.5= Takes half damage (Armor).Speed Multiplier: Scales movement speed.
3. Combat Settings
This is the most extensive section, controlling how agents fight.
Combat Behavior Template
A quick-start dropdown that auto-configures complex AI settings for common archetypes:
MeleeSwarm: Aggressive rush (Vampire Survivors style).
MeleeQueued: Circle the target and attack one by one (Batman/Assassin's Creed style).
MeleeBattleLine: Form organized ranks and advance slowly (Total War style).
RangedStationary: Stand ground and fire.
HybridAdaptive: Switch between melee and ranged based on distance.
Custom: Full manual control.
Combat Range Type
Defines the fundamental fighting style:
Melee: Close-quarters only.
Ranged: Projectile or hitscan attacks from distance.
Hybrid: Uses Ranged when far, switches to Melee when close.
Positioning Mode
Determines how agents arrange themselves around a target:
Swarm: Chaotic pile-up.
QueuedCircle: Organized ring.
FormationSlots: Strict slot-based positioning.
Staggered: Randomized positioning (Diablo style).
Aggro & Defense
Aggro Range: Distance to spot enemies and start chasing.
Ally Defense: If enabled, agents will "call for help" when attacked. Nearby allies will rush to defend them, even if they didn't see the attacker themselves.
Battle Line Settings
Specific to the MeleeBattleLine template:
Spacing: Shoulder-to-shoulder distance.
Rank Depth: Distance between rows.
Flanking: Percentage of units that try to circle around the enemy line.
4. Animation Settings
Enemy Masses uses a highly optimized animation system. You can override global animations here.
Clips: Assign specific Idle, Walk, Run, Attack, Hit, and Death clips for this unit.
Directional Animations: Support for 4-way (Front/Back/Left/Right) Hit, Block, and Death animations for higher fidelity.
Root Motion: Force enable/disable root motion if your animations require it (Note: Root motion is expensive for massive crowds).
5. Audio Settings
Controls the soundscape of the crowd.
Voice: Attack grunts, death screams, and ambient chatter.
RTS Audio: Selection and Command responses (e.g., "Yes my lord!", "Charging!").
Dynamic Switching: Plays individual voices for small groups and "Army Shouts" for large groups.
Footsteps:
Group Audio: Instead of playing 1000 individual footstep sounds (which would crash audio drivers), the system plays a single "Marching Army" loop that scales in volume and pitch based on how many agents are moving.
Surface Detection: Different sounds for Grass, Stone, Water, etc.
6. Civil Settings
If this unit is a non-combatant (Civilian), these settings control their behavior.
Navigation Mode:
Follow Connections: Stick to defined paths (sidewalks).
Free Roam: Wander randomly on the NavMesh (parks).
Movement Style: Walk, Stroll, or Hurried.
Activities: (Coming Soon) Definitions for smart-object interactions.
7. Performance
While EnemyCrowd has some performance settings, most throttling logic (how many agents update per frame) is handled globally by the EnemyMassesCrowdController to ensure the game maintains a stable framerate regardless of how many different factions are on screen.
Last updated