Custom artwork
Restfall’s browser client ships with CSS/SVG placeholder art for every game element — buildings, units, terrain, portraits, icons, and chrome. You can replace any placeholder with a real PNG by dropping a file in one directory. No code changes, no imports, no config flags.
How it works
Every game image is requested via a slot name: a short string like
building:Farm, unit:swordsman, or tile:forest. The slot system has two
layers, checked in order:
- PNG art — a file in
frontend/src/lib/assets/art/named after the slot (see Drop-in workflow). When a file exists,Sprite.svelterenders it as a<picture>. - CSS/SVG placeholder — generated by
placeholders.tsfrom the slot name. Shown when no PNG exists; fully functional and intentionally styled.
Drop-in workflow
Before you start: Git LFS. The art files are stored with Git LFS. Install
git-lfs before you clone the repository. In a clone you already have, run
git lfs install, then git lfs pull. Without it, each art file is a small
text placeholder, and the build stops on the first one with an error that
names the file. Once git-lfs is installed, a PNG you add goes into Git LFS on
its own when you commit it.
-
Identify the slot name for the element you want to replace. The complete slot registry is documented in the comment block at the top of
frontend/src/lib/assets/manifest.ts. -
Name your file after the slot, with every colon (
:) written as two underscores (__), plus.png. Windows cannot check out a filename that holds a colon, so the files never do; the slot name itself keeps its colons everywhere else. Spaces are kept as they are.Slot File building:Farmbuilding__Farm.pngbuilding:Lumber Millbuilding__Lumber Mill.pngunit:swordsmanunit__swordsman.pngtile:foresttile__forest.pngavatar:lordavatar__lord.pngavatar:hero:42avatar__hero__42.pngicon:menu-allianceicon__menu-alliance.pngtown-markertown-marker.pngA file still named with a colon (
building:Farm.png) stops the build with an error that names the file it should be. -
Drop the file into
frontend/src/lib/assets/art/. -
Rebuild or reload:
- Development (
pnpm run dev): the dev server sees the new file and reloads the page on its own. - Production: re-run
pnpm run build.
- Development (
That is the entire workflow. The PNG supersedes the placeholder with no other change.
Slot groups
Buildings
Slot: building:<yaml_id> where <yaml_id> is the exact id: value from
the realm YAML config.
Common built-in buildings:
| Slot | Description |
|---|---|
building:Cottage | Housing — raises population cap |
building:Farm | Food production |
building:Lumber Mill | Wood production |
building:Quarry | Stone production |
building:Mine | Iron production |
building:Barracks | Unit training |
building:Watchtower | Warns of incoming attacks |
building:Wall | Defensive multiplier |
building:Academy | Enables research |
building:Market | Enables resource trading |
building:Inn | Enables hero recruitment |
building:Hospital | Heals wounded units |
Units
Slot: unit:<unit_type_id> — exact id: from realm YAML. The default roster
ships Evony Age One’s twelve unit types:
| Slot | Description |
|---|---|
unit:worker | Non-combatant labourer/hauler |
unit:warrior | Basic melee infantry |
unit:scout | The realm’s dedicated scout unit — see The Scout Unit |
unit:pikeman | Anti-cavalry infantry |
unit:swordsman | Balanced melee infantry |
unit:archer | Ranged infantry |
unit:cavalry | Fast mounted melee |
unit:transporter | Non-combatant hauler (machine) |
unit:cataphract | Heavy mounted melee |
unit:ballista | Ranged siege machine |
unit:ram | Short-range wall-breaching siege machine |
unit:catapult | Longest-range siege machine |
A custom realm can define its own unit roster entirely — check
GET /api/v1/units/types for the actual ids.
Resources
Slot: resource:<resource_id> — exact id: from realm YAML.
Examples: resource:food, resource:wood, resource:stone, resource:iron, resource:gold.
Map terrain
| Slot | Description |
|---|---|
tile:plains | Grass / open terrain |
tile:forest | Forest clusters |
tile:mountain | Mountain peaks |
tile:water | Lakes and sea |
tile:river | River tiles |
tile:road | Dirt road tiles |
tile:fertile | High-yield farmland |
tile:camp | NPC / barbarian camp marker |
town-marker | Player keep/castle on the world map (no tile: prefix) |
Marches
| Slot | Description |
|---|---|
march:attack | Outgoing attack army |
march:scout | Scout unit |
march:support | Support / defensive troops |
march:trade | Trade caravan |
Town stage chrome
These slots override the stone frame around the isometric town view.
| Slot | Description |
|---|---|
backdrop-town | Full background behind the town |
tile:wall-top | Crenellated top wall strip |
tile:wall-side | Side stone column texture |
tile:wall-corner | Corner tower block |
tile:wall-gate | Portcullis gate arch |
tile:wall-tree | Decorative trees outside the walls |
Surface textures
Slot: texture:<name>. These replace the CSS background-image on the four
named surface tokens used throughout the UI.
| Slot | Token | Applied to |
|---|---|---|
texture:wood | --tex-wood | Wood buttons, dialog backgrounds |
texture:stone | --tex-stone | Ashlar frame borders |
texture:parchment | --tex-parchment | Panel and card fills |
texture:gold | --tex-gold | Gold accents, logo fill |
Frame and banner chrome
| Slot | Used by | Format |
|---|---|---|
frame:gold | OrnateFrame.svelte standard variant | 9-slice border-image |
frame:gilded | OrnateFrame.svelte gilded variant | 9-slice border-image |
banner:title | TitleBanner.svelte | Full-width background-image |
Portraits (avatars and heroes)
| Slot | Description |
|---|---|
avatar:lord | Default lord portrait (SideRail, no avatar selected) |
avatar:<avatar_id> | Selectable avatar — ids: lord, lady, warrior, archer, knight, mage, scout, noble |
avatar:hero:<hero_id> | Individual hero portrait — <hero_id> is the numeric DB id |
Hero star ratings
| Slot | Description |
|---|---|
star:filled | Filled star glyph in hero star-rating rows |
star:empty | Empty star glyph in hero star-rating rows |
Navigation icons
| Slot | Description |
|---|---|
icon:view-town | ViewSwitcher TOWN tab |
icon:view-city | ViewSwitcher CITY tab |
icon:view-map | ViewSwitcher MAP tab |
icon:compass | World map compass ornament |
icon:menu-alliance | CommandMenu alliance button |
icon:menu-market | CommandMenu market button |
icon:menu-research | CommandMenu research button |
icon:menu-quest | CommandMenu quests button |
icon:menu-reports | CommandMenu reports button |
icon:menu-messages | CommandMenu messages/mail button |
icon:menu-rankings | CommandMenu rankings button |
icon:menu-settings | CommandMenu settings button |
icon:menu-heroes | CommandMenu heroes button |
icon:menu-diplomacy | CommandMenu diplomacy button |
icon:menu-hospital | CommandMenu hospital button |
Content cards
| Slot prefix | Description |
|---|---|
research:<tech_id> | Academy research window tech card icons |
quest:<quest_id> | Quests window quest card icons |
achievement:<id> | Quests window achievement card icons |
Audio slots
The client ships an ambient SFX system that works identically to the art-slot system — no bundled audio files, just wiring. Drop MP3 files into frontend/src/lib/assets/sfx/, named after the slot with the colon written as two underscores like an art file, and they are picked up automatically.
Available audio slots:
| Slot | Trigger |
|---|---|
sfx:click | Any .btn-beige, .btn-gold, .btn-speedup, or .btn-add button click |
sfx:build-complete | A building or research job finishes (queue strip count decreases) |
sfx:attack | An attack march is successfully dispatched via the map tile sheet |
Drop-in workflow:
- Enable sound effects in the Settings screen (the toggle is off by default).
- Name your file after the slot, colon written as
__, plus.mp3: slotsfx:click→sfx__click.mp3,sfx:build-complete→sfx__build-complete.mp3. - Drop the file into
frontend/src/lib/assets/sfx/. - Rebuild or hot-reload (
pnpm run devdetects new files automatically).
No code changes are required. If a slot has no MP3 file, that trigger is silently skipped. The player’s setting is stored in localStorage under the key sfx-enabled.
Recommended image sizes
The client renders sprites at 48 × 48 px by default (the Sprite.svelte
size prop). Providing 64 × 64 px or 96 × 96 px PNG files and letting the
browser downscale gives the sharpest result. Texture slots tile as CSS
backgrounds so any seamlessly-tileable size works.
Verifying pickup
Open the browser DevTools Elements tab and inspect a <Sprite> for the
slot you replaced. When the PNG is active, Sprite.svelte renders a
<picture> holding <img src="…" alt="<slot>"> instead of an inline <svg>.
The build re-encodes your PNG into WebP, AVIF and smaller PNG copies, so the
src is a generated URL with a content hash in it (e.g.
/assets/art/building_Farm.3f9c1a2b4d/256.png), not your file’s own path.