Overview
Overlays are sprite images that are composited on top of the base character sprite at runtime. There are two types:
| Type | Folder | Used for |
|---|---|---|
| Hat | overlays/hats/ | Headwear worn in any animation |
| Weapon / Tool | overlays/swords/, overlays/axes/, overlays/tools/ | Hand-held items shown during idle, walk, and action animations |
All overlay files live under:
Hat Overlays
A hat overlay is a small sprite sheet containing the hat drawn from eight different angles — one for each head pose the character uses across all animations. The engine selects the correct cell per animation frame automatically.
Sheet format
| Property | Value |
|---|---|
| Total size | 128 × 64 px |
| Cell size | 32 × 32 px each |
| Layout | 4 columns × 2 rows |
| Poses | 8 (numbered 0 – 7, left-to-right, top-to-bottom) |
overlays/hats/farmers_hat.png in your image editor. It shows the exact layout and pixel alignment. Draw your hat in each cell using that file as a reference layer.
File location & naming
The filename becomes part of the overlay key. Use lowercase with hyphens; no spaces.
Steps
Create a 128 × 64 px PNG. Fill each of the 8 cells with the hat drawn from the appropriate angle, pixel-perfect at 32 × 32 px.
Save it to
client/public/assets/characters/humans/overlays/hats/your-hat-name.png.In the admin item editor, create or edit an item and set:
Field Value Equip slot head Overlay key hats/your-hat-name Hides hair Yes if the hat fully covers the hair; No if hair should still show through
Weapon & Tool Overlays
Weapon and tool overlays are single-row animation strips. The strip contains frames that align exactly with the character's attack, axe-swing, or mining animation, plus one dedicated frame used during idle and walk.
All three categories share the same strip format. The category subfolder determines which hand-alignment offsets the engine applies:
| Subfolder | Animation | Examples |
|---|---|---|
| overlays/swords/ | Attack (ATTACK) | swords, daggers, staves |
| overlays/axes/ | Axe-swing (AXE) | axes, hatchets, cleavers |
| overlays/tools/ | Mining (MINING) | pickaxes, hammers, shovels |
Strip format
| Property | Value |
|---|---|
| Total size | 1056 × 64 px |
| Frame size | 96 × 64 px each |
| Frame count | 11 (frames 0 – 10) |
| Frames 0 – 9 | Action animation frames (must align with the character's ATTACK / AXE / MINING strip) |
| Frame 10 | Idle / walk pose — the frame shown when the character is standing or walking |
overlays/swords/basic.png, overlays/axes/axe.png, and overlays/tools/basic-pickaxe.png show the expected alignment. The weapon sprite must be positioned so that the grip pixel sits at the character's hand position for each frame. Open the corresponding character animation strip (ATTACK/base_attack_strip10.png etc.) as a reference layer to check alignment.
Idle / walk frame (frame 10)
Frame 10 is used whenever the character is idle or walking. It is a static single frame — no per-frame variation is applied. A good starting point is to copy frame 6 of the action animation (the peak of the swing), which shows the weapon in a natural held position. Adjust from there to match your specific weapon's resting pose.
File location & naming
Steps
Create a 1056 × 64 px PNG. Draw 10 action frames (0 – 9) aligned to the correct character animation strip, then draw the idle/walk pose as frame 10.
Save it to the correct subfolder, e.g.
overlays/swords/long-sword.png.In the admin item editor, create or edit an item and set:
Field Value Equip slot right_hand Overlay key swords/long-sword (matches the path without .png)
Registering the Item
Once the PNG is in place, open the admin console and go to the Item Editor. Create a new item (or edit an existing one) and fill in:
| Field | Hat | Sword / Axe / Tool |
|---|---|---|
| Name | Display name shown in the inventory | |
| Tile | Index of the icon in the items tileset | |
| Stackable | Usually No for equipment | |
| Equip slot | head | right_hand |
| Overlay key | hats/your-hat-name | swords/name axes/name tools/name |
| Hides hair | Yes or No depending on the hat design | n/a |
The overlay key is the path to the PNG file relative to the overlays/ folder, without the .png extension. Save the item and it will be available to equip immediately — no server restart or code change needed.
Checklist
- PNG is 128 × 64 px
- 8 cells of 32 × 32 px, 4 columns × 2 rows
- Saved to
overlays/hats/name.png - Item created in admin editor with equip slot
headand overlay keyhats/name - Hides hair flag set correctly
- PNG is 1056 × 64 px
- 11 frames of 96 × 64 px
- Frames 0 – 9 aligned to the matching character animation strip
- Frame 10 is the idle / walk pose
- Saved to the correct category subfolder (
swords/,axes/, ortools/) - Item created in admin editor with equip slot
right_handand overlay key matching the file path