Pets, and a house you can walk into

Thirty-four collectible pets that follow you and fetch gold at near-zero server cost, and a buildable walk-in cottage with trophies, derived rooms and visitors.

A timber-framed cottage with a red pitched roof glows at night on a dark lawn, with lanterns by the door and a blue waypoint ring nearby
Contents
  1. Pets
  2. Getting one
  3. Following you around
  4. Housing
  5. Build mode
  6. Trophies without dupes
  7. Walk-in rooms
  8. Visiting
  9. Friends as an account-level system
  10. Related posts

The two non-combat systems: a reason to log in when you don't want to fight, and a place for visitors to see. Both ride the same sim, sync and persistence as everything else, and both cost the server almost nothing.

Pets

34 pets from Kenney's Cube Pets kit: sixteen that drop anywhere, eighteen signature pets, one per boss (the Bone King's Marrowlight, the Leviathan's Moonswallow, the Unmaker's Nothing). Each has a rarity, name, species, flavour line and one small bonus:

  • Gold or magic find, up to 8%
  • Life regen, up to 2/s
  • Run speed, up to 3%
  • Auto-loot gold within 4, 6 or 8 tiles
  • Fetch (legendary only): potions as well as gold

Small on purpose: pick a pet because you like it.

Getting one

A starter (chick, bunny or piglet) on first play; after that, eggs drop in the normal per-player pile (loot):

shared/pets/roll.tsTypeScript
/** Chance that a kill drops a (non-signature) egg for one eligible player. */
export const EGG_CHANCE: Record<EggMonsterRarity, number> = { normal: 0.0008, champion: 0.006, unique: 0.02, boss: 0.05 }
/** Chance a boss drops its signature pet (per eligible player). */
export const SIGNATURE_CHANCE = 0.12
 
/** Pet rarity weights by the killed monster's rarity. */
const RARITY_WEIGHTS: Record<EggMonsterRarity, Record<PetRarity, number>> = {
  normal: { common: 70, uncommon: 25, rare: 5, epic: 0, legendary: 0 },
  champion: { common: 45, uncommon: 35, rare: 15, epic: 5, legendary: 0 },
  unique: { common: 25, uncommon: 35, rare: 25, epic: 12, legendary: 3 },
  boss: { common: 0, uncommon: 20, rare: 40, epic: 30, legendary: 10 },
}
  • ~1 egg per 1,250 normal kills, almost always common; rare pets come from unique elites and bosses
  • 12% per boss kill for its signature pet: boss farming gets a second target
  • Eggs are 1×1 items; right-click to adopt. Act 2 eggs sometimes hatch "ember", Act 3 "spectral" (render-time tints)
  • Posy Brambleby, the Pet Tamer, sells four eggs
  • The collection is per account in a PetCollection table, so alts start with every pet
The Pets panel: a legendary lion named Aurelion on a turntable, its bonuses (collects gold within 8 tiles, fetches potions, +8% extra gold), a Send Home button and a grid of collected pets
The Pets panel (P) on a dev hero with every pet. The preview is a live 3D render of the model on a turntable. Rename it with the pencil next to the name.

Following you around

A pet is not a sim entity. The client moves it: spring-damped trailing at a side offset, its own A* so it never clips walls, a teleport past 12 tiles behind, idle wandering, dances on level-up and boss kills, hearts on click. The only synced data is one string per player: PlayerState.pet = "petId|nickname|variant". Forty pets cost the server nothing.

A lion trotting after a Stalker in the Scorched Dunes. The follow logic is entirely client-side. Captured in-engine for the trailer.

Auto-loot changes the save, so it's server-side, but the server only simulates when the pet arrives (9 tiles/s):

server/game/pets/autoloot.tsTypeScript
if (!best) return
const ms = Math.round((Math.sqrt(bestD) / PET_FETCH_SPEED) * 1000 + GRAB_MS)
rt.fetching = { uid: best.uid, at: w.now + ms }
w.emitNear(best.x, best.y, 'fx', { kind: 'pet_fetch', src: p.id, dst: best.uid, x: best.x, y: best.y, t: w.now, ms })
  • pet_fetch animates the dash on every client
  • Only the owner's instanced drops, so no stealing
  • Full bag: the drop goes on a 5 s skip list
  • The starter picker's "Later" is saved per character (petDeferStarter)

Housing

Every character gets a walled ~40 × 40 garden plot above a lake: cottage, lanterns, dock. H from any town goes home; a list shows party, friends and public homes of anyone online.

  • Its own Colyseus room type, house, keyed by owner character id, up to 40 visitors
  • Reuses zone player state and sync, so pets, nameplates and chat just work
  • Combat refused ("Your weapons rest at home"); a house is never saved as your location

Build mode

B opens tabs for furniture, lighting, garden, decor, trophies, floors and walls: 65 objects, 5 floors, 6 walls, 2 roofs. Half-tile ghost, R rotates 45°, drag to paint floors and walls, walls auto-connect.

Build mode in a home: the build panel on the left with a grid of furniture thumbnails, and the cottage from above with its roof lifted, showing rugs, a table, a bed and a hearth inside
Build mode. Every roof lifts so you can see inside, and the thumbnails in the panel are the real 3D models, rendered offscreen once and cached as data URLs.

Pickup refunds 100%, so layouts are free to try. Placement rules: inside the plot, no overlap, max 300 pieces, affordable, and the gate-to-door path stays open:

shared/housing/layout.tsTypeScript
const tiles = blockedTilesOf(e, x, y, rot)
if (tiles.length === 0) return null
const walk = c.nav.walk.slice()
for (const [tx, ty] of tiles) {
  if (!inPlot(tx, ty)) return 'Keep it inside your garden'
  const i = tileIndex(tx, ty)
  if (walk[i] !== 1) return 'Something is already there'
  walk[i] = 0
}
if (!doorPathOpen(walk)) return 'That would block the path to your door'

The door-path rule is a BFS on a nav copy with the piece stamped in. It lives in shared/, so the client's red tint and the server's refusal can't disagree.

Placing furniture in build mode. The ghost snaps to the grid and the camera looks straight into the cottage with its roof lifted. Captured in-engine for the trailer.

Trophies without dupes

Weapon racks and stands take real items; visitors see the 3D weapon (or a rarity gem) and the real tooltip. An item moving between two separately saved rows could dupe or vanish, so mount and unmount write both in one Prisma $transaction (saveHouseAndCharacter), ordered on both owners' save queues.

Walk-in rooms

The starter cottage is built from player pieces (timber walls with windows, oak floor, doorway, pitched roof) and furnished free with a bed, hearth, table, chairs, rugs, bookshelf, candles and chest. All movable.

Rooms are derived, never stored: floor that can't reach the map edge without crossing a room wall (timber, stone, window, doorway; hedges and fences don't count). findRooms floods from the edge:

shared/housing/rooms.tsTypeScript
for (let x = 0; x < W; x++) {
  push(tileIndex(x, 0))
  push(tileIndex(x, H - 1))
}
for (let y = 0; y < H; y++) {
  push(tileIndex(0, y))
  push(tileIndex(W - 1, y))
}
  • Server: the roof tool applies to a whole room
  • Client: gable roof for rectangles, flat otherwise; step inside and the roof fades and camera-side walls drop to knee-high stubs
A timber cottage with a red pitched roof at night, a hero at the lit doorway, lanterns on either side and a waypoint glow nearby
The walk-in cottage from outside. Everything here, including the walls and roof, is made of the same pieces a player can place, move or remove.

Layouts are versioned in the floors column: a bare array is v1 (the old solid-prop cottage), { v: 2, tiles } is walk-in. migrateLegacyHome runs once on load and saves:

  • Removes untouched old porch pieces (matched by id, kind, position, rotation and price 0)
  • Stamps in walls, floor and roof
  • Moves owner pieces caught inside a wall to just outside
  • Adds new furniture where it fits the budget and the door path

Nothing an owner placed is lost, and no schema migration was needed. Timber top plates sit 2 cm above the plaster and door jambs are inset, so nothing z-fights.

Visiting

Private (owner's characters), Friends (party and friend list) or Public. Travel goes through tRPC: mayVisit, then a one-time transfer token, so guessing a room id gets you nothing ("X's home is private"). Arrivals appear at the gate, the owner sees "X has come to visit", and a lectern guestbook takes 100 entries of 120 characters, one per visitor per minute.

Friends as an account-level system

The house friend list is per house and one-way (House.friends). The natural next shape is one account-level friends table that party, visits, whispers and house visibility all read.