Skip to content

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:

  1. PNG art — a file in frontend/src/lib/assets/art/ named after the slot (see Drop-in workflow). When a file exists, Sprite.svelte renders it as a <picture>.
  2. CSS/SVG placeholder — generated by placeholders.ts from 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.

  1. 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.

  2. 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.

    SlotFile
    building:Farmbuilding__Farm.png
    building:Lumber Millbuilding__Lumber Mill.png
    unit:swordsmanunit__swordsman.png
    tile:foresttile__forest.png
    avatar:lordavatar__lord.png
    avatar:hero:42avatar__hero__42.png
    icon:menu-allianceicon__menu-alliance.png
    town-markertown-marker.png

    A file still named with a colon (building:Farm.png) stops the build with an error that names the file it should be.

  3. Drop the file into frontend/src/lib/assets/art/.

  4. 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.

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:

SlotDescription
building:CottageHousing — raises population cap
building:FarmFood production
building:Lumber MillWood production
building:QuarryStone production
building:MineIron production
building:BarracksUnit training
building:WatchtowerWarns of incoming attacks
building:WallDefensive multiplier
building:AcademyEnables research
building:MarketEnables resource trading
building:InnEnables hero recruitment
building:HospitalHeals wounded units

Units

Slot: unit:<unit_type_id> — exact id: from realm YAML. The default roster ships Evony Age One’s twelve unit types:

SlotDescription
unit:workerNon-combatant labourer/hauler
unit:warriorBasic melee infantry
unit:scoutThe realm’s dedicated scout unit — see The Scout Unit
unit:pikemanAnti-cavalry infantry
unit:swordsmanBalanced melee infantry
unit:archerRanged infantry
unit:cavalryFast mounted melee
unit:transporterNon-combatant hauler (machine)
unit:cataphractHeavy mounted melee
unit:ballistaRanged siege machine
unit:ramShort-range wall-breaching siege machine
unit:catapultLongest-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

SlotDescription
tile:plainsGrass / open terrain
tile:forestForest clusters
tile:mountainMountain peaks
tile:waterLakes and sea
tile:riverRiver tiles
tile:roadDirt road tiles
tile:fertileHigh-yield farmland
tile:campNPC / barbarian camp marker
town-markerPlayer keep/castle on the world map (no tile: prefix)

Marches

SlotDescription
march:attackOutgoing attack army
march:scoutScout unit
march:supportSupport / defensive troops
march:tradeTrade caravan

Town stage chrome

These slots override the stone frame around the isometric town view.

SlotDescription
backdrop-townFull background behind the town
tile:wall-topCrenellated top wall strip
tile:wall-sideSide stone column texture
tile:wall-cornerCorner tower block
tile:wall-gatePortcullis gate arch
tile:wall-treeDecorative 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.

SlotTokenApplied to
texture:wood--tex-woodWood buttons, dialog backgrounds
texture:stone--tex-stoneAshlar frame borders
texture:parchment--tex-parchmentPanel and card fills
texture:gold--tex-goldGold accents, logo fill

Frame and banner chrome

SlotUsed byFormat
frame:goldOrnateFrame.svelte standard variant9-slice border-image
frame:gildedOrnateFrame.svelte gilded variant9-slice border-image
banner:titleTitleBanner.svelteFull-width background-image

Portraits (avatars and heroes)

SlotDescription
avatar:lordDefault 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

SlotDescription
star:filledFilled star glyph in hero star-rating rows
star:emptyEmpty star glyph in hero star-rating rows
SlotDescription
icon:view-townViewSwitcher TOWN tab
icon:view-cityViewSwitcher CITY tab
icon:view-mapViewSwitcher MAP tab
icon:compassWorld map compass ornament
icon:menu-allianceCommandMenu alliance button
icon:menu-marketCommandMenu market button
icon:menu-researchCommandMenu research button
icon:menu-questCommandMenu quests button
icon:menu-reportsCommandMenu reports button
icon:menu-messagesCommandMenu messages/mail button
icon:menu-rankingsCommandMenu rankings button
icon:menu-settingsCommandMenu settings button
icon:menu-heroesCommandMenu heroes button
icon:menu-diplomacyCommandMenu diplomacy button
icon:menu-hospitalCommandMenu hospital button

Content cards

Slot prefixDescription
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:

SlotTrigger
sfx:clickAny .btn-beige, .btn-gold, .btn-speedup, or .btn-add button click
sfx:build-completeA building or research job finishes (queue strip count decreases)
sfx:attackAn attack march is successfully dispatched via the map tile sheet

Drop-in workflow:

  1. Enable sound effects in the Settings screen (the toggle is off by default).
  2. Name your file after the slot, colon written as __, plus .mp3: slot sfx:click → sfx__click.mp3, sfx:build-complete → sfx__build-complete.mp3.
  3. Drop the file into frontend/src/lib/assets/sfx/.
  4. Rebuild or hot-reload (pnpm run dev detects 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.

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.