Namespace SurvivorsMaker.Simulation

Classes

AllocatingPools

No reuse: every Rent allocates. The reference behaviour and the fallback before pools are set.

ArenaDef
BehaviourRegistry<T>

Behaviours by id. Ids are case-sensitive. Registering an id that exists replaces it, so a game can override a built-in. Ids keeps first-registration order for tools.

BossPhaseDef

A boss phase starts when health falls to HealthBelow × max health or less.

BuiltInBehaviours

Ids of the built-in behaviours. A definition whose Behaviour id is empty maps its enum kind to one of these.

ChargeEnemyAttack

Built-in windup/charge behaviour that can override ordinary enemy movement.

ChaseMovement

Built-in movement that approaches the current player position.

ChaseWithOffsetMovement

Built-in chase movement with a per-enemy seeded target offset.

CombatRules

Shared hit rules. Death collection belongs to the end of the tick.

DeathSpawnDef
EaseOut

Easing for melee phases: 1 − (1 − t)^Exponent. Exponent 1 = linear.

EffectHandlerPersistence

Captures and restores custom effect payloads through the optional persistence codec.

EliteDef

How an elite differs from the enemy it is based on.

Enemy
EnemyDef

An enemy or neutral object (e.g. a destructible crate).

EnemyMovement

Base movement extension returning a candidate position; the enemy system clamps the result.

EnemySettings
EnemySystem

Initializes and ticks enemy movement, attacks, support, phases and death-spawn requests.

HitEffectDef
HordeEventDef

A burst of enemies at one moment of a wave.

HyperbolicDefense

Armor reduces damage by armor / (armor + Softness); negative armor increases it by the same ratio. Result is rounded and at least MinimumDamage.

KeepDistanceMovement

Built-in movement that approaches or retreats to a seeded preferred distance.

KnockbackSettings
LinearSpatialIndex

A full scan; the reference behaviour and the fallback before a grid is set.

MovementDef
Pickup
PickupRules

Reusable pickup storage plus death rewards, progression and collection.

PickupSettings
PlayerSettings
PlayerState
PolynomialLevelCurve

Base + Linear × level + Quadratic × level², at least Minimum.

ProgressionSettings
Projectile
ScheduledGroup

A spawn group that passed its wave-start roll, with the ticks it occurs on.

ShootEnemyAttack

Built-in enemy shooting behaviour that emits pooled enemy projectiles.

SimBehaviours

The behaviour registries of a simulation (Behaviours). Each built-in system folder fills its registry through a partial method, so CreateDefault() has every built-in behaviour.

SimMath

Shared rounding and time conversion. Every system uses these so results agree.

SimPools

World-owned reuse. Return only after removing the object from all active lists.

SimRandom

Seeded random numbers that give the same sequence on every platform (xoshiro128**, seeded with splitmix32). The simulation uses only this, never System.Random or UnityEngine.Random.

SimSettings

All simulation settings. One instance can be shared by many runs; do not change it mid-run.

SimStatKeys

Stable external source keys consumed by simulation-side stat evaluation.

SimStatSource

External stat inputs are read-only; missing health declares its maximum-health dependency.

SimSystems

The pluggable systems of a simulation. Concrete classes: Spawning/SpawnSystem, Enemies/EnemySystem, Weapons/WeaponSystem, World/CombatRules. Replace any of them to change behaviour.

SimWorld

All state of one running wave. Systems read and write it; presentation only reads it. Lists keep a stable order: new items are appended, removal keeps the order of the rest.

SimulationInfo

Fixed simulation rate (ticks per second).

SpawnEntryDef
SpawnGroupDef

A timed group of spawns within a wave.

SpawnSettings
SpawnSystem

Schedules groups and hordes, advances telegraphs and materializes admitted enemies.

SpecialAttackDef
StatBindings

Which stat ids the simulation reads. Change these to use your own catalog.

StatusEffectDef
StatusInstance
StatusSystem

One instance per behaviour id; stable lifecycle and elite modifier order.

SummonEnemyAttack

Built-in special attack that queues child enemies through the spawn system.

SupportDef
Telegraph
TempBuff

A temporary stat change from a trigger; undone when TicksLeft reaches 0.

TimedEnemyAttack

Base for deterministic cooldown and windup attacks; override firing and eligibility hooks.

TriggerCondition

One predicate over a stat, event fact or gameplay state; condition lists are conjunctive.

TriggerDef

"When X happens, with chance C, do Y." Comes from items, upgrades and characters.

TriggerState

A trigger from WaveRequest.Triggers with its timers.

TriggerSystem

Ordered trigger instances; events created by actions are not recursively dispatched.

UniformGridSpatialIndex

Reusable uniform grid. Candidates retain rebuild-time world order and identity.

WanderArenaMovement

Built-in movement between seeded arena-wide destinations.

WanderNearPlayerMovement

Built-in movement between seeded destinations near the player.

WaveDef
WaveEffectLease

Effect definition and application state transferred across a combat boundary.

WaveEffectLoadout

Run effects, wallet and lifetime context supplied when a wave starts.

WaveProgress

Per-wave results that carry over to the run loop.

WaveRequest

Everything needed to start one wave. Effects are applied in order to build the player's stats.

WaveSimulation

Runs one wave with a fixed, deterministic system order.

WeaponDef
WeaponSettings
WeaponState
WeaponSystem

Slot registration/dispatch and discrete friendly projectile collisions.

Structs

ArenaRect

Axis-aligned arena rectangle, centered on the origin unless built otherwise.

BehaviourParameter

A named number or text a custom behaviour reads from its definition.

EliteModifier
Scaled

A value that grows with the wave: Base + PerWave × wavesSinceFirst, rounded, at least Min.

SimEvent

Something that happened during one tick, for presentation and replays. Plain values only, so events can be kept after the entities they mention are gone.

SpawnRequest

A spawn asked for during the tick, admitted later at a fixed step.

TriggerBinding

A trigger definition bound to its source owner and persistent state.

TriggerCarryState

Legacy trigger cooldown and count state carried across a wave boundary.

TriggerFact

One tick-local event fact evaluated by extended trigger conditions.

Vec2

2D vector for the simulation, with engine-independent arithmetic. Presentation converts to Vector2.

Interfaces

ICombat

Damage and healing rules that several systems call. Implemented in World/.

IDefenseFormula

Damage after armor. Replace to change the formula.

IEffectStatePersistence

Optional per-application save codec. Payloads are immutable values, never object references. Restore applies the saved contribution to the supplied store and returns its undo record. Both hooks must be deterministic and must not mutate shared definitions or handler-global state.

IEnemyAttack

An enemy special attack (step 5): cooldown, wind-up and effect.

IEnemyMovement

How an enemy moves (step 5). The enemy system applies speed multipliers, knockback and arena clamping around it.

IEnemySystem

Enemies: per-enemy behaviour.

ILevelCurve

Experience needed to go from level to level + 1.

IPickupBehaviour

What happens when a player collects a pickup.

IPickupSettlementBehaviour

Optional end-of-wave collection. Custom pickups otherwise disappear at settlement.

ISimModule

An optional system that plugs into the tick loop without changing it. Keep state in the world (or in the module keyed by world) so runs stay deterministic; use world.Random only.

ISimPools

Reuses projectile, enemy and status objects. Rent returns an object with every field at its default; Return is called by whoever removes the object from its world list. Presentation must not keep references to simulation objects across ticks (use ids).

ISpatialIndex

Finds enemies near a point. Results include candidates outside the radius; apply exact distance and shape tests. Candidates appear in Enemies order, so systems give the same results as a full scan. Rebuilt by the tick loop after enemies move and spawns are admitted.

ISpawnSystem

Spawning: schedules, telegraphs, admission.

IStatusBehaviour

What a status does while it is on an enemy (step 5a).

IStatusSystem

Status: burn, slow, stun and elite modifiers that act over time.

ITriggerHandler

Custom trigger actions (TriggerAction.Custom), registered by id like effect handlers.

ITriggerSystem

World: item and character triggers.

IWeaponBehaviour

A player weapon's attack logic (step 7). Friendly projectiles it creates are moved by the weapon system.

IWeaponLoadoutUpdater

Optional incremental loadout update; retained slot/definition pairs must not Begin again.

IWeaponSystem

Weapons: player weapons and friendly projectiles.

Enums

ChargeTarget
EliteModifierKind
HitEffectKind
HordePattern
MeleePhase
MeleeStyle
MovementKind
PickupKind
ShotOrigin
SimEventKind
SimModulePhase

Where in the tick an ISimModule runs.

SpecialAttackKind
SpecialPhase
StackRule
StatusKind
TriggerAction
TriggerComparison

Comparison operator used by a trigger condition.

TriggerConditionKind

Value source tested by an extended trigger condition.

TriggerConditionRead

Which state snapshot supplies a trigger condition value.

TriggerCounterReset

Boundary that clears an extended trigger counter.

TriggerEvent

Simulation or run event that can drive extended trigger conditions.

TriggerWhen
WaveEffectOwner

Ownership category used to reconnect a combat effect lease to its run source.

WavePhase
WeaponKind