Veridia Icon
Back to News
Update

Devlog: A New Way to Build Bosses

October 11, 2026iceomen

We’ve rebuilt how bosses are made on Veridia. Every boss now runs on one shared scripting system, which means fights closer to OSRS, fewer bugs and new bosses sooner. The first boss on it is the Leviathan, rebuilt from scratch to match the real fight.

We've rebuilt how bosses are made on Veridia. Until now, each boss was its own block of custom code. Bosses are now written as scripts for a shared boss system, and each script describes the fight: its phases, its attacks, its timings and what happens when it dies.

This post is more technical than usual. It covers why we made the change, sketches the script for the first boss on the new system (the Leviathan from Desert Treasure II), and explains what it means for you: fights closer to OSRS, fewer bugs, and new bosses that take less time to build.

Why we rebuilt it

Every boss so far has been built by hand. Over the last few months, at least six boss fights were written that way, each with its own timers, its own kill tracking and its own cleanup for when you leave.

That caused four problems:

  • The same bug was written more than once. A mistake in how one boss handled a timer often turned up in others too, and fixing one boss left the rest broken.

  • Attacks could outlive the fight. When a fight's timers aren't tied to the fight, an attack can still land after you leave, die or teleport out.

  • Kill tracking was added one boss at a time. Mastery tracking alone was recently wired into about ten bosses separately, on top of kill count, boss timers, combat achievements and contracts. Missing one was easy.

How the new system works

A boss script describes the fight, and the server runs every script the same way. Because that runtime is shared, every boss on the system gets three things:

  • Each fight owns what it starts. Timers, attacks in flight, helper NPCs and spawned objects belong to the fight. When the fight ends or you leave, they are all removed together.

  • Hits are resolved when they land. Damage and prayer are checked when the projectile reaches you, as in OSRS, not when the attack is thrown.

  • One kill event for every boss. When a boss dies, the server sends a single "kill completed" event. Kill count, boss timers, combat achievements, contracts and mastery all listen for it, and it records whether the kill was perfect.

What a boss script looks like

Scripts are written in Kotlin, the language the server is written in. Here is a trimmed-down version of the Leviathan's script in the real syntax. It shows the phases, what moves the fight between them, the attacks in each phase, and its damage rules.

boss("leviathan") {
    body(NpcId.THE_LEVIATHAN)
    val pathfinder by helper(NpcId.ABYSSAL_PATHFINDER, PathfinderPatrol)

    host {
        privateInstance(LeviathanArena.template) {
            ownerOnly()
            destroyWhenEmpty()
        }
    }

    val rally by initialPhase()
    val roar by phase()
    val stunned by phase()
    val enraged by phase()
    val dead by terminalPhase()

    transitions {
        anyPhase to dead on death()
        anyOf(rally, roar, stunned) to enraged on HealthAtOrBelow(20)
        rally to stunned on ShadowSpellHit
        rally to roar on RallyOver(orbRally)
        roar to rally on afterRoutine(roarRoutine)
    }

    attacks {
        during(rally) {
            speed(RallyInterval(orbRally))
            firstAvailable {
                use(bite).onlyWhen(TargetOnPoolRim)
                use(rallyOrb)
            }
        }
        during(enraged) {
            speed(2)
            every(8, rockfall)
        }
    }

    damageRules {
        during(stunned) {
            hits(MagicHitOnWound(wound)) { multiply(2.0) }
            hits(HitOffWound(wound)) { cap(10) }
        }
    }

    restrictions {
        reject(CombatStyle.Melee, "Your melee attacks can't reach the lure!")
    }
}

Each name in the script, such as ShadowSpellHit, TargetOnPoolRim or Bite, is a small class of its own rather than a text label, so a typo is caught before the server starts, not in the middle of your kill. An attack keeps its own numbers next to it:

class Bite : BossAttack {
    override val recoveryTicks = 4

    override fun perform(context: EncounterContext) = with(context) {
        boss.setAnimation(Animation(10284))
        meleeHit(requireTarget(), maxHit = 50)
    }
}

Bugs fixed along the way

Building the shared pieces turned up bugs in bosses you can already fight:

  • Phantom Muspah: its soul split effect was applied twice per hit. It is now applied once per hit.

  • Verzik Vitur: its blood heal was applied twice per hit. It is now applied once per hit.

  • Nex: its Ice phase drain was applied twice per hit. It is now applied once per hit.

  • Araxxor: attacks already in flight could still hit you after you left the instance. They are now cancelled when you leave.

Because those three effects were applied twice, they were about twice as strong as intended. They now work at their intended strength.

The Leviathan

The Leviathan is the first boss written entirely as a script, starting with the normal (post-quest) fight. Our rule was that it has to match OSRS. We built it from research into the real fight, using the OSRS Wiki, statements from Jagex and player reports, rather than from our older versions.

The script covers:

  • Orb rallies across all seven stages. Later stages attack faster and add melee orbs, and the last two give you less time before an orb lands. Prayer is checked when the orb lands.

  • The bite, falling rocks, the roar, the lightning barrage and the smoke blast, each with its OSRS max hit. The smoke blast now hits up to 60, as listed on the wiki.

  • The stun. Shadow spells stun the Leviathan, and a damaging hit on its wound during the stun starts its next special attack. The two specials take turns.

  • The enrage at 20% health. The abyssal pathfinder appears and lights up the area around it, and your attacks from inside that area are stronger.

  • The cave, which now has the five Leviathan tails standing around the island as scenery, as in OSRS.

We also removed both older versions of the Leviathan, so only this one remains.

Why this is good for you

  • Accuracy that lasts. Each boss keeps its timings and max hits in one place, so they are easy to check and hard to break by accident.

  • Fewer bugs. Cleanup, hit timing and kill tracking are written once and shared, so one fix covers every boss on the system.

  • Reliable rewards. Kill count, boss timers, combat achievements, contracts and mastery all come from the same kill event, so a new boss can't miss one.

  • New bosses sooner. The shared parts are done. A new boss is mostly its script, so more of the work goes into getting the fight right.