News

No two goblins alike

Four goblins in the Blender viewport on a grid floor: an Archer, a Cutter, a Shaman and a Mage

Goblins are the first enemies we built to find out how a fight in World of Accords should feel. We wanted a band that fights like one, and we wanted it cheap enough to run hundreds at once on one server. Here's how they think.

One body, four kinds

Cutters rush in with daggers. Archers draw real bows and keep their distance. Shamans hang back and heal whichever goblin is hurt. Mages fight from range with spells.

All four outfits share one body and one skeleton, laid out like Unreal's Manny skeleton, so a single motion library retargets onto every one. The joints are measured from slices of the mesh, and skin weights are solved on a watertight copy, then transferred back. The motion starts from capture and is retimed and reshaped for a goblin's hunch.

Archers aim where you're going, not where you are. Their bow is rigged like ours: the draw hand pulls the string, and the arrow nocked on it is the one that flies.

Decide, then act

Every creature's brain runs on the server, in two halves. A StateTree decides what to do. It's an ordered ladder where the first state that applies wins: flee when badly hurt, break when the band breaks, run for help, heal a packmate, step back, wait for an opening, fight, regroup, wander.

A native C++ brain then carries it out: pathing, reach, threat and strikes, the tested verbs every creature shares. The tree reads a small set of facts the brain prepares, so its conditions stay plain comparisons that a designer can reorder by dragging states.

A test feeds the tree and the brain's built-in logic 2,000 random situations, and fails if they ever disagree.

A temper of their own

Every goblin carries four traits: courage, aggression, patience and loyalty to its band. Courage sets when it runs, and whether it breaks when the band does. Aggression sets how far it chases and how hard it presses. Patience makes it wait for you to swing first. Loyalty makes it fetch help and stay near the leader.

Each kind leans its own way: Cutters run hot, archers are wary, and shamans are timid but loyal. When a goblin spawns it rolls its own version around its kind, seeded from where it was placed, so the same goblin always has the same temper and a bug can be reproduced.

The band

Every band has a leader, and goblins near it are braver. Goblins placed one by one rather than in a pack still find each other: nearby goblins of the same faction form a group, and a small world subsystem elects one leader for each area. Cut the leader down, or half the band, and the timid break and run while the brave fight on.

In our review run, with the leader cut down mid-fight, every timid goblin broke and every brave one held.

Fair fights

A creature that truly can't reach you, say because you're standing on a roof, gives up, goes home and resets, rather than standing still to be farmed. "Can't reach" means the navmesh has no path to anywhere it could strike from; it isn't a timer. A player who simply keeps their distance gets chased.

Tuning by feel

A creature's values live in data assets layered by species and kind: a goblin layer, then a Cutter or Archer layer on top. Every value has a tick box, the same override pattern as Unreal's post-process settings, so a kind stores only what it changes. Our monster tuner, an editor tab, shows where each value comes from and updates live creatures mid-fight while you play.

Built for a crowd

  • With 300 goblins all fighting, decisions cost about half a millisecond of a 30 Hz server frame. The tree decides a few times a second, while the brain acts at its own rate.
  • Layered values are resolved once when they change, never per creature or per tick.
  • A creature's group is cached and refreshed every few seconds, and it looks for players through its pack's area rather than scanning the world.
  • Navigation is built only around players and creatures, using Unreal's navigation invokers, so a large world never builds navmesh where nobody is.
  • A streamed world keeps terrain only near players. A creature whose ground streams out is held in place with its brain asleep until the ground returns, instead of falling through the world.
  • Creatures replicate their ability system in Minimal mode, the least GAS can send.

What we learned

Our creatures used to stutter. A walk or run clip restarted whenever the movement direction crossed a bucket edge, and the brain re-planned its path on every tick. Smoothing didn't help; hysteresis did. A clip now restarts only when the clip itself changes, a direction must win clearly before it switches, and a path toward nearly the same goal is left alone.

Tell us

Two behaviours, waiting for an opening and running for help, are built and tested but rarely show in goblins. A later creature, a patient brute that never runs, is designed to bring them out. If you've built group AI for an MMO, we'd love to hear what made bands feel alive: hello@worldofaccords.com.

‹ All news