Skip to main content

Models and Animation

Everything in the world is drawn either from a model or, when a thing has no model, from simple procedural shapes. The models are built in Blender by a script and exported as .glb files that the client loads.

What a thing looks like​

The client picks a look for each entity in this order:

  1. The entity's own model. An NPC can carry model_path in its NPC data (NPCs and the Economy).
  2. The node type's ModelPath, a client resource such as res://models/placeholders/wolf_den.glb. Gathering nodes, stations, creatures, spawners and NPC presets all use it. The admin panel sets it on the node type and creature pages. A node type may list several models (the trees have five each); the server picks one per entity and sends only that, see Model variants.
  3. A built-in model for the appearance key. Stations load their model through StationModels.model_path(key).
  4. Procedural shapes for the appearance key:
keydrawn as
defaultone 0.6 × 1.2 × 0.6 box
treecylinder trunk + sphere canopy
rocksquashed sphere
claywide flat cylinder

A model path must point at a resource that is in the client build. An empty path keeps the procedural look.

Two details that are easy to get wrong and hard to see:

  • Every shape stands on its position, not around it. Meshes are centred on their own origin, so an unshifted shape hangs half its height in the air. Anchoring to the base is what makes GM placement work — a GM aiming at the ground puts a thing on that spot rather than half sunk into it.
  • An appearance change rebuilds existing entities. If it only applied on first creation, a tree built before a node type was edited would keep its old shape for the life of the process, and the admin panel would look like it had done nothing.

An unknown key draws the default box and warns, once per key. The admin panel lets a person type these by hand, so a typo has to be visible rather than quietly producing a grey box that reads as a deliberate choice.

Building the models​

The models are built with Blender 5.2 from tools/blender/: one file per model under models/<kind>/, shared parts and building code in kit/, and build_models.py, which builds them all. Run it from the repository root:

"W:/Blender Foundation/Blender 5.2/blender.exe" -b --factory-startup --python tools/blender/build_models.py
  • -- --only NAME ... rebuilds only the named models.
  • -- --render DIR also renders preview PNGs.
  • Running one model's file instead (--python tools/blender/models/creatures/wolf.py) builds just that model.

It writes two files per model:

filewhat it is
godot_client/models/blender/<name>.blendthe editable source; a .gdignore keeps Godot from importing it
godot_client/models/placeholders/<name>.glbwhat Godot imports and the game loads

Models listed in their file's ICONS also render an inventory icon to godot_client/assets/icons/<name>.png.

Rerunning overwrites the .blend files. To keep hand edits to one, move its file out of models/ first.

The model files build the stations, the cart, the held sword, bow and felling axe, the animals, the player body, Anyxa, the gathering nodes that had no model and the spawner models. godot_client/models/blender/README.md lists every model with its size, facing and bones.

Facing. Stations, the cart, Anyxa and the player face Godot's −Z. The animals face +Z, like the animal FBX files they replaced. Every model stands on its origin, with its lowest point at height 0.

Collision. Solid models (trees, rocks, the vardo, the bind stone) have a scenes/resource_nodes/<name>.tscn or scenes/scenery/<name>.tscn StaticBody3D for the client. The server builds its colliders from the node type's Collision column instead, read with the rest of the world, so a new solid model needs a migration but no server restart or rebuild. See Content and migrations.

Animation​

Each model's clips are stored as muted NLA tracks, one per clip. The client finds them by name, case-insensitively, with or without an Armature| prefix.

clipplayed
Idle, Walk, Runlooping, chosen by how fast the creature moves
Attack, Hit, Deathonce, when the server sends a creature action
Jumphorse only, while its rider is in the air
Fly, Glidebirds only, while airborne; Glide while sinking

WorldEntityManager._setup_creature_animation sets this up on every loaded model, so an NPC with a single Idle clip (Anyxa) loops it. Death ends with the animal lying on its side, centred over its spot.

The player body​

scripts/PlayerBody.gd draws a body from player.glb, about 1.77 m tall.

  • Your own body is built first-person, with the camera at the eyes (1.65 m). The head, hair and neck are a separate mesh, PlayerHead, which your client draws as a shadow only. The arms turn with your view pitch.
  • Other players get the full body, head included, with their name just above the hair. Their arms stay level, because look pitch is not sent. If the model is missing, the old capsule is drawn instead.

The body's clips are Idle, Walk, Run and Seated for the whole body, and SwordReady, BowReady, Chop, Swing and BowShot for the spine and arms only, played over the whole-body clip. TorchReady holds a lit torch up in the left hand and plays over the left arm alone, on top of everything else, so the right arm can still swing a sword.

In a boat the body sits on the boat's own seat instead of astride (BoatGear.SEATS, by the boat's model): the rowing boat's thwart, 0.17 m above the water, facing aft, and the dugout canoe's seat ridge at the waterline, facing forward. Four clips drop the hips 0.84 m onto the seat: Row and RowRest, Paddle and PaddleRest. The stroke plays while the boat is under way, at its pace, and the rest pose holds while it is still; the first-person camera goes down with the hips. The arms were solved by IK on player.blend so the hands meet the oar handles and the paddle shaft (tools/blender/models/characters/player.py). Then the gear follows the hands every frame (BoatGear.update, from WorldEntityManager):

  • Oars. The rowing boat's oars turn about their tholes so each grip comes to the hand on its side, sliding a little through the thole for a long or short reach. The blades are squared while rowing and flat at rest.
  • Paddle. In the canoe the paddle lying in the bottom is hidden, and a paddle (paddle.glb, tools/blender/models/items/paddle.py, sized to the paddler) is laid from the left hand on its grip down through the right. Its blade dips into the water on the stroke and swings out clear on the recovery.

tests/boat_poses_check.gd seats player.glb and the tallest and shortest race bodies in both boats and checks the hips on the seat, the hands on the oars, and the blade going in and out (-- --sheet PATH renders it).

Race bodies​

Every character has a race and sex (characters."Race", "Sex"), chosen in the client's character creator. The races are rows in the races table (Moondog.Core/Data/Entities/Race.cs): name, who can be one (draco are female only), a description and the six attributes a new character starts with, all edited on the admin's Races page. A race's key names its bodies, so races are added in code with their models, not in the admin.

raceheights (m / f)StrDexAgiIntStuWis
Huma1.77 / 1.60101010101010
Elva2.0 / 1.88111112810
Catfolk1.5 / 1.4481214989
Dogfolk1.9 / 1.85119109129
Ollo1.6 / 1.65910911912
Draco2.0 (female)139810128
Lizfolk2.6 / 2.512998139

The attributes are the seeded values; the admin may since have changed them.

Making a character. The login screen (scripts/Login.gd) signs in with POST /api/gameauth/characters, which answers with the account's characters and the races, and lists the characters to enter the world with (a double-click enters too). New character, or an account with none, opens the creator (scripts/CharacterCreator.gd): the chosen race and sex stand in a 3D preview playing their Idle (drag to turn them), framed the same for every race so they show their true sizes, beside the race's description and starting attributes. Create posts to /api/gameauth/characters/create (Races.CreateCharacterAsync: names are 2 to 24 letters and unique, the attributes come from the race, and the starter lore is granted). The portal no longer makes characters; it lists and deletes them.

In the world. The server sends your race and sex in AuthResult and everyone's in ReceivePlayerIdentities, and the client draws the matching body, body_<race>_<sex>.glb (PlayerBody.model_for), falling back to player.glb for a pair with no body yet. player.glb is huma m.

Boxy race bodies. For now the races are drawn in the player's boxy style (one script per body, tools/blender/models/characters/body_<race>_<sex>.py, on the shared tools/blender/kit/race_body.py): each takes the player's parts and outfit, swaps the head and skin for its race's, and scales to its race's height, on the player's own skeleton and clips, so PlayerBody drives them exactly like player.glb. Tailed races add Tail1–Tail4 off the hips, lifted and swaying in Idle, Walk, Run, Seated and the boat clips. The women's tunics carry a bust, so their silhouettes differ from the men's. A body is player.glb scaled by its Head bone's height over 1.52 m: the eyes, the grips of held things, the torch and the lantern hook scale with it (ears and horns stand above the head, so the height of the meshes is not used). tests/boxy_bodies_check.gd checks every one. All twelve are built; huma m is player.glb.

The Tripo bodies below (race_<race>_<sex>.glb) are not drawn at present. The bodies carry the player's clips retargeted onto their Mixamo skeleton, so PlayerBody drives them like player.glb: it reads the Mixamo bone names through MIXAMO_BONES and places held things against an arm swung down to hang like the player's (HANG), because the Mixamo rest pose holds the arms out level. Your camera sits at your body's eyes (PlayerBody.eye_height, from the head bones). The collision capsule is still 1.8 m for every race. tests/race_bodies_check.gd checks every body; scripts/check_race_bodies.py checks two races through the live server.

Worn armour​

Every boxy body (player.glb and body_*.glb) carries the armour it can wear as meshes of its own, Worn_<item in snake case> (Worn_leather_coif), skinned to its bones and hidden. tools/blender/kit/armour.py builds them over the parts they cover, fitted to the body: the coif round that race's head (ears, horns and crests stand through it), the gambeson shaped over a woman's bust, and the boots as open-toed wraps on clawed feet (ollo, lizfolk). PlayerBody.set_worn("Leather Coif,Leather Boots") shows them; the coif is drawn as a shadow only on your own body, like the head.

Your own body shows your equipped, unbroken items tagged armour (Player._refresh_worn). Everyone else's comes as the sixth field of their ReceivePlayerIdentities row, which the server re-sends when it changes.

Torches​

F takes a torch out in the left hand (scenes/world/Torch.tscn: the model from tools/blender/models/items/torch.py, with a flickering light and flame, spark and smoke particles built in Torch.gd). It is put away while the left hand is busy with the bow, the felling axe or the fishing rod, or while you swim, and comes back after. Only your own torch's light casts shadows.

NPCs whose model has a TorchReady clip and a left hand raise a torch when the sun goes down and lower it at sunrise (scripts/NpcTorch.gd). Bob and Barnaby use the player body; Anyxa's arms are the player's, hand bones and all, and she uses the player's pose.

The brass lantern on Anyxa's vardo is lit at night the same way (scenes/scenery/Lantern.gd): its glass glows and a candle light flickers, and by day the glass is dark and the light off. The model carries the glass twice, Lantern_Glass_Lit and Lantern_Glass_Unlit, and the script shows the one that fits the hour.

What other clients need to draw you comes from the server:

  • Walking, running and riding come from the velocity and mount fields already in your state row.
  • held in the state row says what your hands hold: 0 nothing, 1 bare hands, 2 a melee weapon, 3 a bow, 4 a felling axe while you gather from a tree in reach, 5 a fishing rod, plus 8 while a lit torch is out (and you are not swimming). The server works out the hands (HeldPose); the torch is the one part the client sends, with ClientSetTorch(lit).
  • Swings and shots go out as ReceivePlayerAction(character_id, "swing" | "bow_shot"), reliably, to the clients that have you in view. A swing at nothing is sent with target −1.

Checks​

  • godot_client/tests/placeholder_models_check.gd checks the exported models.
  • godot_client/tests/player_body_check.gd checks the player body.