๐Ÿ•ฐ๏ธ Historical snapshot

This page is preserved for project history and is not the current reference. Use Combat Core and Loop for current information.

Combat Core & Loop

Active, readable, positional combat โ€” no tab-target, no standing still. Movement is constant; dodge is a planned resource, not a panic button.

The loop

Move (WASD) โ†’ Read enemy โ†’ Position โ†’ Dodge โ†’ Cast ability โ†’ Hit + feedback โ†’ CD โ†’ Move

Nothing happens while standing still. Dodge roll is the primary defensive action โ€” 2 charges, ~5s each, 0.35s i-frames. Auto-attack is always available (no cooldown, ~8 dmg ร— Power) so no build ever feels dead. There is no global cooldown; each ability slot cools independently.

Server-authority rules

  • All damage is calculated on the server. The client sends "I used ability X toward Y"; the server validates and applies.
  • Loot rolls on the server โ€” clients never see loot tables.
  • No client trust for stats โ€” CharacterStats is loaded from the DB on login.
โš ๏ธ Reality check

Player HP is currently handled client-side by enemy AI โ€” a hacked client can no-damage. Server-side player HP is the biggest open cheat vector (see Known Issues & Tech Debt).

Damage immunity

Two independent flags block incoming damage in Health.TakeDamage:

  • isInvulnerable โ€” set by PlayerMovement during a dodge roll (0.35 s i-frames). Cleared automatically when the dodge animation ends.
  • zoneTransitionProtected โ€” set by PlayerIdentity.ServerBeginZoneVisualLoad() when zone travel begins on the server. Cleared by ServerCompleteZoneVisualLoad() once the client reports its zone visuals are ready (or after a 15-second safety timeout). Enemies also skip players whose PlayerIdentity.zoneVisualsReady SyncVar is false, so transitioning players cannot be targeted or damaged.

Cast flow

  1. Press 1/2/3/4 or left-click an action bar slot โ†’ ability enters aim mode (indicator at cursor).
  2. Left-click in the world (not on a UI element) โ†’ FinalizeCast โ†’ DispatchAbility โ†’ effect applied.
  3. Right-click / Escape โ†’ cancel with no cooldown.
  4. Instant self-casts (range 0, shield) fire immediately โ€” no aim phase.

AbilityCaster.TryActivateSlot(int slot) is the shared entry point for both keyboard and click activation. It blocks activation when: the spell loadout panel is open, the player is downed, a committed cast is already in progress, or the slot is on cooldown. Left-click to fire (Mouse.current.leftButton) checks EventSystem.current.IsPointerOverGameObject() and silently skips if the pointer is over any UI element.

Chargeable abilities (Void Bolt, Storm Lash, Ember Surge) hold up to maxChargeTime 1.5s, lerping damage toward maxChargeDamage with a tint shift. See Ability Atlas & Synergies.

Spell audio

AbilityCaster.PlaySpellSFX spawns a throwaway AudioSource GameObject at the spell's world position and auto-destroys it after playback โ€” the same pattern used by EnemySfxProfile. Audio is 3D positional: min distance 4 m, max distance 35 m, logarithmic rolloff. Pitch varies by ยฑFeelConfig.pitchVariance (default 0.07). The method compiles out of dedicated-server builds (#if UNITY_EDITOR || !UNITY_SERVER), so callers require no server-guard of their own.

Cast SFX plays at the caster's position (or the spell's destination if castVFXAtCaster is false). Hit SFX plays at the impact point. Both local and remote clients play SFX โ€” the networked cast path (RpcCastConfirmed) and the offline path each route through PlaySpellSFX exactly once per event.

See castSFX, hitSFX, and sfxVolume fields in Ability Atlas & Synergies.

Ability shapes & scaling

ConceptImplementation
CirclePhysics.OverlapSphere(center, size/2)
RectanglePhysics.OverlapBox(center, halfExtents, rot)
ConeOverlapSphere + Vector3.Angle < coneAngle/2
Damageability.damage ร— PhaseChargeMult ร— CharacterStats.DamageMultiplier
Cooldownability.cooldown ร— (1 โˆ’ CDR); Battle Hymn adds temp CDR, clamped 60%
Damage delayability.damageDelay > 0 โ†’ hit VFX spawns immediately; damage applied after the specified seconds

Spell Loadout Shrine

Players can only change their equipped spells while near a SpellLoadoutShrine world object. Both AbilityCaster.EquipSpell() (client) and CmdEquipSpell (server command) call SpellLoadoutShrine.ServerCanEditLoadout(netIdentity), which returns false when the player is not within interactionRadius + 1.5f of any shrine in the scene.

To open the loadout panel: approach a shrine and press E (prompt: "Press E to attune spells at [shrineName]"). Walking out of the shrine's trigger radius auto-closes the panel. While the panel is open (PlayerHUD.IsSpellLoadoutOpen), both movement input and ability input are suppressed. The shrine's default interaction radius is 3f; this is configurable per-instance.

Shrines are placed in scenes with the BCE โ–ถ Build โ–ถ Spell Loadout Shrine editor menu (SpellLoadoutShrineBuilder). See Editor Tooling.

โ„น๏ธ Design vs. implementation

The Combat Design Bible describes a broader "nine cores + MoP talent" system as the design target. What's actually in the C# today is the five-hero spellbook documented in the Combat Atlas โ€” the code-derived source of truth.


Related: Heroes & Classes ยท Ability Atlas & Synergies ยท Enemies, Waves & Bosses ยท Combat Design Bible