Kneeshaw Developments
Back

The Codex · in development

Four energies · fifteen patterns · one initiative roll

Roll initiative.Then pay for what you do.

Combat is turn-based at the system level and real-time at the presentation. Initiative orders the round. Every action pays an energy cost — Mana regenerates, Stamina regenerates, Rage builds from damage you take, Segment persists between rounds and rewards consistent hits. Fifteen attack patterns cover melee, ranged, and spell. The AI picks one per turn from what its budget allows.

4energy types15attack patterns8skill categoriesC++/Godotturn-based + real-time

BattleSkillSystem · C++ engine · Godot presentation

Turn order · current = Caster

Striker

Caster

Guardian

Healer

Assassin

Summoner

Mana

78%

Stamina

55%

Rage

40%

Segment

33%

Four energy economies · each paid per action

Fifteen attack patterns · melee · ranged · spell

15

Attack patterns

6–8

Active skills equipped

4

Energy types

5

Skill categories

Turn order — seven stages

Every combat round runs through the same seven stages, repeated until one side wins or flees. The engine processes the same flow whether the combatant is a player, a party NPC, or a monster.

  1. 1 · Initiative

    All combatants roll initiative based on Speed (100 + DEX × 2) plus a small random component. Highest acts first.

  2. 2 · Action declaration

    Each combatant — player or AI — selects an active skill (or basic attack) from their loadout. Bar limits 6–8 active skills.

  3. 3 · Resource check

    The skill's resource cost (Mana, Stamina, Rage, Segment) is verified. Insufficient = the action fails and the combatant defaults to a basic attack.

  4. 4 · Cast time

    If the skill has a cast time, the combatant is interruptible until it resolves. Other combatants with higher initiative may act before resolution.

  5. 5 · Hit resolution

    Hit-detection runs against the AttackPattern (locked / unlocked / cone / circle / etc.). Crit rolls compound. Damage is computed against target Defence.

  6. 6 · Status application

    Any status effects in the skill's applies_status_effects list are queued onto the target with the skill's duration.

  7. 7 · Cooldown

    Skill's cooldown starts ticking. The combatant proceeds to their next action when their initiative comes around again.

The dual-energy economy

Every combatant runs two energy pools in combat, dictated by the active essence. Most builds run a passive-regen primary (Mana or Stamina) and an event-driven secondary (Rage from damage taken, Segment from successful hits). Pure essences (Lightning, Light, Dark, Nature) run only the primary.

  • Mana

    Generation
    Regenerates passively in combat; faster between rounds.
    Governs
    Spell casting. Caster abilities. Magical damage scaling.
    Archetype
    Caster, Healer (Spirit variant)
  • Stamina

    Generation
    Regenerates passively in combat; faster while moving or repositioning.
    Governs
    Melee strikes, physical sustained abilities, defensive stances.
    Archetype
    Guardian, Shapeshifter, melee-leaning Strikers
  • Rage

    Generation
    Built by taking damage — 10% of damage taken becomes Rage. Decays out of combat.
    Governs
    Striker burst abilities, Fury stacks, execute-tier finishers.
    Archetype
    Striker (especially Fire-essence)
  • Segment

    Generation
    1 Segment per 3 successful weak/strong attacks. Persists between rounds.
    Governs
    Sword-essence specials, multi-hit chains, weapon-art unlocks.
    Archetype
    Sword-essence Strikers and Assassins

Essence-to-energy mapping

The active essence's aspect determines which two pools you run. From essence_energy_mapping.gd:

EssencePrimarySecondary
FireManaRage
SwordStaminaSegment
LightningManaNone
NatureStaminaNone
LightManaNone
DarkManaNone

Fifteen attack patterns

Each ability targets in a specific pattern. Some attack patterns are "easy" — they auto-track or auto-select. Others are "hard" — they require manual aim, but the payoff is much bigger. The pattern is set at the ability level, not the essence level; a Fire-essence Caster might run an auto-tracked Fireball alongside a skillshot Meteor.

Spell patterns

  • Single-Target LockedEasy · damage Medium · Medium

    Auto-tracking projectile. Lock target and fire; the projectile finds them. Low skill ceiling, reliable damage.

  • Single-Target UnlockedHard · damage High · Medium

    Manual-aim skillshot. Reward for landing it is real; cost of missing is real.

  • AoE ConeMedium · damage Medium · Medium

    Fan-shaped damage from the caster. Best for closing groups and crowd control.

  • AoE CircleMedium · damage Medium · Slow

    Ground-targeted or self-centred radius. Long telegraph, big impact.

  • Multi-Target EnemyEasy · damage Medium · Medium

    Auto-selects multiple hostiles. Chain Lightning, Mind Spike, multi-bolt missiles.

  • Multi-Target AllyEasy · damage Low · Medium

    Buffs or heals multiple friendlies. The Healer's bread-and-butter.

Melee patterns

  • SwordMedium · damage Medium · Medium

    Balanced combo attacks. Sword-essence builds Segment off every weak/strong hit.

  • PolearmMedium · damage Medium · Medium

    Long-reach sweeps. Crowd control at melee range.

  • Two-HandHard · damage Very High · Slow

    Heavy slow strikes. Connects with a target, the target is in trouble.

  • DaggerHard · damage Low · Very Fast

    Fast positioning attacks. Backstab bonus from behind. Assassin signature.

  • Blunt / AxeMedium · damage High · Medium

    Armor-piercing impacts. Stagger chance. Punishing for Guardians.

  • ShieldEasy · damage Low · Medium

    Defensive bash. Stun, counter mechanics, layered damage absorption.

Ranged patterns

  • ThrowingMedium · damage Medium · Fast

    Arc-trajectory consumables. Daggers, axes, stars. Limited ammunition.

  • ArrowMedium · damage High · Medium

    Bow attacks with charge mechanics. Hold to charge, release for higher damage.

  • CrossbowHard · damage Very High · Slow

    Massive single-shot damage; long reload. Armor piercing. Glass-cannon ranged.

Five skill categories

Every battle skill belongs to one of five categories defined in SkillCategory.h. The category drives AI selection, item synergies, and how the UI groups your loadout.

  • Offensive

    Direct damage and damage-over-time. The bulk of every Striker, Caster, and Assassin loadout.

  • Defensive

    Shields, blocks, armour buffs, mitigation. Guardian-core; most archetypes carry one or two.

  • Support

    Heals, buffs, resource restoration. Healer-core; Bards and Cooks bring partial versions.

  • Control

    Stuns, roots, slows, debuffs, fears. Controller-core. Stacked control wins fights without dealing damage.

  • Utility

    Movement, detection, gathering bonuses. Out-of-combat advantages that translate into combat positioning.

How damage actually scales

The damage of an active skill on a hit is computed roughly as:

final_damage  =
    base_damage              // from the ability definition
  × damage_multiplier        // per-ability (e.g. Power Blow = 1.5×)
  × aspect_modifier          // from the active essence aspect
  × stat_scaling             // STR×2 + DEX/2  (or INT×2 + WIS/2)
  × rank_multiplier          // EssenceRank multiplier (1× → 10,368×)
  × (1 + crit_damage_bonus)  // if the hit crit
  − target_defence           // post-multiplier subtraction

The rank multiplier dominates everything else once two combatants are more than one realm apart — Sage hits Mortal harder than any stat or aspect modifier could compensate for. That's why cross-realm PvP is effectively impossible.

Within the same realm, the aspect modifier and stat scaling are where build choices show up. A Striker with high STR and a Destructive Fire aspect lands ~1.5× the damage of a generic Striker on the same swing.

AI skill selection

NPCs and monsters use the same BattleSkillSystem as the player. Their selection algorithm scores candidate skills each turn based on:

  • Threat fit. If taking heavy damage, prioritise Defensive or Support. If the target is below 25% HP, prioritise Offensive execute-style skills.
  • Resource availability. Skills you can't afford this turn are scored to zero.
  • Cooldown state. Off-cooldown abilities are preferred; on-cooldown ones are excluded.
  • Stat fit. A STR-build NPC picks STR-scaling abilities; INT-build picks magical ones.
  • Profession. Guards favour Defensive/Control; Adventurers favour Offensive; Healers will always cast a Support if a party member drops below threshold.

The result is that monster behaviour visibly maps to archetype — a Striker monster opens aggressively, a Guardian monster anchors to a chokepoint, an Assassin monster opens from stealth and disengages.

What happens after the fight

The CombatSystem hands off to several other systems on resolution:

  • AdvancementSystem grants 50 + (difficulty × 10) essence XP to the primary active essence. See Essence XP.
  • Loot drops generated against the monster's tier and aspect (bestiary covers the tier-to-loot mapping).
  • Status effects applied during combat continue to tick down on each survivor; some persist past combat (poisons, curses). See Status effects.
  • StimulusSystem broadcasts the combat as a perceivable event — nearby NPCs may converge, flee, or remember.
  • QuestSystem checks whether the defeated target was a quest objective and advances state accordingly.

Where to read next

Source: World-Engine — BATTLE_SKILL_SYSTEM_IMPLEMENTATION, BATTLE_UI_ENERGY_IMPLEMENTATION, attack-types-summary, attack-types-planning, BATTLE_SYSTEM_PROGRESS.