Add to the yard: kinds, drawings, effects and scenery
Purpose
- Change or add what is in the yard without touching the code that runs it.
- Content and artwork files describe the yard. Most additions reuse the existing rendering rules:
| What | Where | Read by |
|---|---|---|
| The catalogue: fish, bugs, flowers, gifts, trees, keepsakes and the garden's stages | src/content/catalog.json | the page (src/yard/catalog.js) and the backend (src-tauri/src/pets/content.rs, built in) |
| The scenery's composition: curves, the lake, the field, the layers painted from back to front | src/content/yard.json | the page (src/yard/layout.js, src/yard/backdrop.js) |
| Seasonal events: when, what they add to the scenery and how they look | src/content/events.json | the page (src/yard/events.js, src/yard/festival.js) and the backend (its gifts' dates, content.rs) |
| Drawings: plant stages, flowers, gifts (and any fish or bug that has its own) | src/art/<folder>/<id>.svg | the page (src/yard/art.js), as symbols |
| Colours of the seasons, the light and the weather | src/styles/scenery.css | the stylesheet, the painter and every drawing |
| Names and lines | src/core/strings/<language>.js | the page |
- The code holds what things do:
- the painters (
backdrop.js,trees.js,lake.js) - the drawers for fish and bugs (
creatures.js) - the effects (
effects.jsand their rules ingarden.css) - the rules (when fish bite, when a gift comes)
- the painters (
- Changing one of those changes everything that uses it.
- A content addition within an existing schema usually reuses that code.
- New rendering or activity rules need their own implementation and tests.
Prerequisites
- You finished Set up a development environment and run the app.
pnpm testpasses.- To see the result without the app, use the isolated browser fixtures in
scripts/visual-audit.mjs. - Native E2E and the normal screenshot script launch the real app.
Steps
Add an album entry: the checklist
Every album book is a list in src/content/catalog.json; its kinds are named by the key in NAME_KEYS (src/yard/catalog.js):
| Book | List | Name key | Drawing comes from | Its own rules |
|---|---|---|---|---|
| Flowers | flowers | garden.kind_<id> | src/art/collection.json or a flower SVG | Each season grows as many flowers as the others; add one per season (Add a flower) |
| Aquatic life, Bugs | fish, bugs | catch.fish_<id>, catch.bug_<id> | src/art/collection.json | Add a fish or a bug |
| Gifts | gifts | decor.kind_<id>, decor.visit_<id> | a gift SVG or src/art/collection.json | At the end of the list, before the winter lights' gifts (Add a gift) |
| Trees | trees | tree.<id> | assets/discovery/ART-SOURCES.json | Three stages and seasonal art (Planted trees) |
| Keepsakes | treasures | treasure.<id> | src/art/collection.json | rarity, and length in cm, which sizes it out of the album; the drawing stands on the bottom of its box |
| Footprints, Spring shoots | tracks, shoots | track.<id>, shoot.<id> | their own SVGs | Footprints, Spring shoots |
- Add the entry to its list, and its name to all four string tables (ko, en, ja, zh-hans). Friends read the same names when they talk about the yard (
src-tauri/src/chat/today.rs); its test fails while one is missing. - Keep the painted sheet in
assets/art/with its prompt and provenance (assets/sources/<date>/accepted-art.json), record its crop, then runpnpm run art:pack. It makes the wrappers, trims the sheets, and makes the shipped WebP and the album card previews. Packing again with nothing new changes nothing. - Update the words that count the album.
tests/album-copy.test.mjslists each sentence that holds a number (the README, the guide in every language,src-tauri/src/chat/guide.rs), and fails until it matches the catalogue. Add the new kind's name to any list the guide gives, such as the flowers by season or the trees you can plant. - Add a line under
## [Unreleased]inCHANGELOG.md. - Run the checks in Verification.
- The landing and the site's album page count from the catalogue; they need no change.
- The backend keeps at most
KINDS_MAXkinds a book (pets/album.rs); a test keeps every book under half of it. - A new book is one more row in
NAME_KEYS, an entry in the album'sBOOKS(src/panel/album.js), a field inAlbum(pets/album.rs), and its line in the content test ofpets/content.rs.
Add a fish or a bug
Add an entry to
fishorbugsinsrc/content/catalog.json. Copy a close one and change:Field For Meaning idboth Lowercase and _seasons,periodsboth When it can bite or fly weightboth How often, among those that can bite or fly then; a bug's is a whole number (the backend reads it as one) sizefish [shortest, longest] in cm; the backend refuses a longer catch rainfish More likely in rain (a multiplier) rainbug truefor a ground kind (beetleorcricket) that also comes out in rain, mornings and middays outside winter; in rain only these come (wildlifeGroupincatalog.js)kindbug butterfly,dragonfly,firefly,beetleorcricketlengthbug Its length in cm as drawn (a butterfly's or a dragonfly's wingspan); it sizes the bug out of the album (finds out) lookboth The colours the drawer paints it with; each drawer's fields are in creatures.js.tests/look-alikes.test.mjsfails when two bugs of one kind and about one size share every colour and markinglook.sizebug Its size in the yard against others of its kind (1 when absent), in its art and in the plain drawing before the art loads; a small flier such as the damselfly is drawn smaller than the dragonfly beside it look.blinkfirefly Its flash in the yard: ms between flashes (2100 when absent, 0 for a steady light). tests/look-alikes.test.mjskeeps every two fireflies apart by rhythm or sizeTo draw it yourself instead, add
"art": "fish/<id>.svg"and put the drawing there (see "Drawings" below).Add its name to every string table:
catch.fish_<id>orcatch.bug_<id>.
- The new fish or bug then shows in the album and bites or flies in its seasons and hours.
- The backend counts it.
Add a flower
Add an entry to
flowerswith anidand:Field Meaning seasonThe season whose seeds grow into it artflowers/<id>.svgcolorspetal,petal-hi,petal-lo,heart. The drawing paints withvar(--petal)and so on, so the same drawing can come in other coloursweight(optional)How often seeds of its season grow it, among that season's flowers; a whole number, 1 if left out event(optional)An event's id: only seeds planted while the yard shows that event grow it ( seasonFlowersingrowth.js). It does not count towards its season's everyday flowers, and the album marks it Rarestature(optional)How much taller than others it stands once grown foot(optional)Where the stem ends, as a share of the drawing's height from its top, when that is above the drawing's edge; outdoors and on the desktop the flower in bloom stands there. 1 if left out patch(optional)A patch of the flower drawn as one picture: art(flowers/patch-<id>.svg),sizein catalogue units andfoot. Outdoors and on the desktop the flower blooms as this patch unless the person picks One bloom in its menu; in the workshop it stays one bloom in a potDraw it in
src/art/flowers/<id>.svg. The garden's stages before the bloom are shared (src/art/plants/).Add
garden.kind_<id>to every string table.
- Seeds planted in a season grow one of that season's flowers at random (
flowerForinsrc/yard/growth.js). weightmakes a flower more likely.- The backend accepts only flowers in the catalogue.
Add a gift
Add an entry to the end of
gifts, or, for an event's gift, just before the winter lights' block, which stays last (tests/content.test.mjs). The first gifts arrive in list order, and a friend's memento is picked from the first 16 everyday gifts (MEMENTO_KINDSinpets/garden.rs), so a gift added in between would change mementos already given.Field Meaning artdecor/<id>.svgflatTrue if it lies on the ground under plants and friends, like the pond stand"on"if friends stand on it, like the bench. Without it, friends stand beside iteffectsSee below size[width, height]in catalogue units, in the drawing's shape. Usually its SVG view box; furniture may need a different footprint. The desktop draws the gift at this size too (gift_sizeinpets/content.rs)eventAn event's id. The gift comes only during that event. Several gifts of one event come in catalogue order, one each time a gift is due shown"christmas": shows in the yard and on the desktop from November 15 to January 7, and is hidden with its state kept otherwise, unless itsseasonsshow it. Put away, it waits in the album (boxed), and its card sets it out again. The windows areSHOWNinsrc/yard/decor-shown.jsseasonsShows while the yard shows one of these seasons; never in a place without seasons ( seasonalEffects: false, the garden workshop). The season the yard shows isyardSeasoninsrc/yard/decor-shown.js. A kind with bothshownandseasonsshows when either says so: the Christmas gifts show from November 15 to January 7 and in any winter yard (why)builttrue: never brought by a friend; it comes from building it (the snowman)ballThe drawing a built kind is rolled from stack[base ball width ÷ box width, base ball bottom ÷ box height]dress[{id, art, at: [x, y, w]}], in drawing order;atis the centre and width as fractions of the box, and the backend reads only the idsfootWhere the drawing ends, as a share of its box's height from the top, when its lowest pixels are above the box's edge; the gift stands there, in the yard and on the desktop ( gift_footinpets/content.rs). 1 if left outshade[width, height, y, x?]of the contact shadow it stands on, as fractions of its box: centred where the drawing ends (foot), at least as wide as its base;xonly when the base is off the middle (src/yard/decor.js). Every gift has one but those drawn as ground (the pond, the stepping stones)feetFurniture on spread legs seen at an angle (the bench, the swing): [[x, y, width]]of each leg's tip and the leg's width, as fractions of its box. Each gets a small dark shadow, andshadebecomes the wide soft one under them all, so it holds every foot; the front foot is atfoothooksWhere ornaments hang on this drawing, as fractions of its box; only xmas_treehas them, andORNAMENT_HOOKSingarden.rsis their countbaublesWhere the drawing's painted baubles are, [x, y, width]like a hook; onlyxmas_treeand itsnighthave them.tests/content.test.mjskeeps each hook on a painted bauble or clear of them allnightThe gift's Christmas night look; only xmas_treehas one. Read bysrc/yard/christmas-night.js(see below); itshooksname the same places on the grand tree- At most four kinds use
shownorseasons. - A
builtkind is never set out from the album nor sent to the desktop, and putting it away removes it. - What can hang and where: flowers, trees, gifts and keepsakes found in the album. The rule is
hang_ornamentingarden.rsandsrc/yard/ornaments.js.
nightholds:Key Meaning artThe grand drawing, standing on the same foot point as the gift's own star,bulbsFractions of that drawing's box: where the star swells, and where single bulbs glint sleighA drawing shown as a mirrored silhouette over the moon guestsGift kinds that must also be out; they look up in this order - It plays in a winter yard, at evening or night, while it snows, on any date.
- It plays each time that night comes together while the yard is seen; a restart the same night shows it grand without the change. A night runs until 05:00.
- The desktop draws the same grand look (
src/yard/grand-tree.js,worn.css) while the yard says it stands grand (decorNight). - Hidden kinds still count toward
DECOR_MAX.
- At most four kinds use
Draw it in
src/art/decor/<id>.svg.- Preserve the drawing's aspect ratio.
- Furniture and friends share the same yard zoom, independent of display density. Do not multiply layout sizes by
devicePixelRatio.
Add
decor.kind_<id>(its name) anddecor.visit_<id>(a list of things friends say when they visit it) to every string table.
Let an album book's finds come out
A fish, a bug or a treasure comes out of its album card on its own: a kind with no drawing of its own that holds one find, set out as a gift is (design).
Add an entry to
findsOutinsrc/content/catalog.json, with a gift'ssizeandfootbut noartorshade, and:Key Meaning holdsThe album's book it holds from, as the album names it: fish,bug,treasureortrack. One kind per book (find_out_forinpets/content.rs)listThe catalogue list its finds are in ( fish,bugs,treasures); they are looked up and named from it (src/yard/find-out.js)poke(optional)How its finds answer a click on the desktop, when not by their own pokeor, for a bug, by itskind: a motionsrc/overlay/overlay.cssdraws, such asswimortwinkleslotsWhere the find is drawn, one [x, y, width, height]as shares of its boxgrowIts size by the find's length: [[cm, scale], [cm, scale]], the shortest and longest ends of a log scale over its box. A fish's length is its longestsize, anything else's itslength;tests/finds-come-alive.test.mjschecks every find has one. The page (findScale) and the desktop (find_scaleinpets/content.rs) read it alikePoint its album book's
actioninsrc/panel/album.jsatfindButtons(src/panel/album-actions.js), and add its book toholdsinpets/content.rsandtake_out_findinpets/garden.rs.Add
decor.visit_<id>to every string table: what friends say when they visit it. A find out is named for the find, so it needs nodecor.kind_<id>.
Drawings
Collection art:
- Current collection art uses generated transparent atlases and SVG crop wrappers.
src/art/collection.jsonrecords each specimen's atlas, reviewed crop and display size.- A firefly also has
yard: a crop of the bug alone inside its album crop. The yard draws it small under the firefly's light (ambient-art.js); the album keeps the full crop. scripts/pack-collection.mjsreproduces each wrapper. A keepsake's drawing sits on the bottom of its box, so it stands on the ground.- Both packers clear what no drawing cuts from a sheet a keepsake comes from (
scripts/sheet-trim-lib.mjs); runpnpm run assets:optimizeon it afterwards, and the next pack keeps it as long as its pixels are the same. - Keep the PNG atlas in
assets/art/with its prompts and provenance, then runpnpm run assets:webp; the wrapper's<image>names the.webpcopy insrc/art/(shipped WebP). - Measure each crop rather than assuming equally spaced generated cells.
- Review the whole body, the alpha, the isolation from neighbouring cells and the real album and yard size.
- See
assets/art/COLLECTION.mdand the related specimen and atlas tests. - The original vector and procedural drawings stay as fallback and reference material.
Vector drawings:
- One SVG per file, with a
viewBoxfrom0 0.- The view box is the drawing's size in the yard.
- A plant's 40 × 60 units stand 50 × 75 pixels in a full-size yard.
- A gift's unit is 1.05 pixels.
- Its foot is at the bottom centre.
- Paint with the yard's colours (
style="fill:var(--leaf)") so the season, the light and the weather tint the drawing. The names drawings use now:--leaf,--leaf-hi,--leaf-lo,--pine,--pine-lo,--trunk,--blade,--rock,--rock-hi,--soil,--soil-hi,--stem,--wood,--wood-hi,--wood-lo,--iron,--sky-a--sky-m: a water surface mirroring the sky--lamp: warm from evening on--bird: 1 by day, 0 at night and in rain or snow; use it as an opacity- a flower's
--petal,--petal-hi,--petal-lo,--heart
- A fixed colour (
fill:#c45c4a) stays the same in every light. - The shipped drawings now wrap painted atlases (an
<image>of a WebP cell) and use none of these names. - The names are still how a vector drawing takes on the yard's light.
- Move a drawing the content no longer names to
assets/sources/, out ofsrc/art/, which ships inside the app. - Nothing in a drawing runs. Scripts and
on…attributes are stripped when it loads, and a test refuses them.
Give a gift an effect
Name it in the gift's effects. The existing effects:
| Effect | What it does |
|---|---|
glow | Lit from evening on: a warm pool of light around it, and it is not dimmed at night |
chime | Rings when a friend visits it (the chime sound in soundmix.js) |
- A lit gift's halo is round the top of the middle of its drawing. Where its light is elsewhere (a lamp hung to one side, a cart's lantern), give
light: [x, y]as shares of the drawing's width and height.
To make a new effect:
- Add an entry to
EFFECTSinsrc/yard/effects.js, shaped{ name: { layer, visited } }.layer: a function of the gift'slight(or nothing) that returns markup drawn with the gift.visited: what happens when a friend visits it.- Both are optional; leave both out if the effect is only a rule.
- Put its rules under "Effects" in
src/styles/garden.css, selecting.decor[data-effects~="<name>"].
- Every gift that names the effect gets it.
Change the scenery
- The normal backdrop comes from
src/content/worlds.jsonand accepted raster environments. - For geometry, lighting and capabilities, follow Add a place.
src/content/yard.jsondescribes the procedural fallback for loading and errors, and the shared composition:
| Key | What it describes |
|---|---|
curves | The hills, as cubic curves in fractions of the yard (x across, y down): a start point, then two control points and an end point for each piece |
fieldTop | Where the field friends stand on starts while the painted land stands in for the picture (a fraction of the yard's height) |
lake | Where the lake starts and ends across (from, to), its far shore's height at the middle (top) and the curve that hides its near half (under) |
layers | What is painted, from back to front. Each names its painter (paint) and that painter's settings |
lake: the far shore is half an oval whose ends sink behind theundercurve, so the water shows between the two points where they cross.- The painter and fishing share this shape (
layout.jslakeShape). layers:seedmakes a layer come out the same each time. Change it to get another arrangement of the same parts.whenpaints it only in a weather, a season or a time of day ("snow","winter","night", or"bloomy"for when flowers are out).
- The painters and what each takes are in
src/yard/backdrop.js(PAINTERS). - Things that stand on the field (
standinglayer,things) aretree,maple,bush,rockandcedar(THINGS). - Colours in a layer are the palette's names (
"back-hi"), or{ "mix": [a, b, amount] },{ "shade": [a, amount] },{ "light": [a, amount] }. - To paint something new, add a painter to
PAINTERS(or a thing toTHINGS) and use it fromyard.json.
Add a seasonal event
Add an entry to
src/content/events.jsonwithid,fromandto, and what it brings.from,to: month-day ("04-01"), as seen north of the equator.- South of the equator, the event comes six months later unless
"fixed": true(as for the winter lights and the new year). fixedalso means the event's gift is asked for whatever season the yard shows, in every place."south": {"from": "MM-DD", "to": "MM-DD"}gives an event dates of its own south of the equator, for when six months on would fall under a fixed event (the rainy season: January 8 to 19). The page (events.js) and the backend (content.rs) both read it; add its boundaries totests/fixtures/event-dates.json.- An event's gifts are the catalogue kinds with its
event, in catalogue order. Add them tocatalog.jsonwith"event": "<id>"; they are not everyday gifts.
Field What it brings sceneThe scene that calls it up on any day when the season is picked by hand: seasons, andperiodsandweatherswhen it asks for them (values from the scene picker). Its look, boost, fish and bugs come then; its gifts keep tofrom–toboostMore small life while it is on: petals,butterflies,fireflies(each a multiplier; fireflies stay at 8 or fewer,fireflyCountinscene.js)looksNames of looks; each is a class on the yard ( look-<name>) whose rules go insrc/styles/scenery.css. The harvest moon'sfullmoonmakes the moon big and golden on the nights around the event's first real full moon, whensky.jsalso setsmoon-fullartA drawing for its card, if it has no gift (the new year's sunrise) rainThe share of Auto's weather blocks that rain while it is on (the rainy season's 0.55); the season's own share otherwise ( autoWeatherinscene.js)pilesLeaf piles on the grass while the yard shows it: art,sizein yard units andcount(leaf-piles.js). A friend jumps into one now and then, or when the person clicks itA fish, a bug or a flower that comes only then: add it to the catalogue with
"event": "<id>".Something painted only then: give a layer in
yard.json"when": "<id>"(the winter lights'fairyLights).Add
event.<id>.name,event.<id>.about(the card's words),event.<id>.gift(the card's line about its gifts, shown only on its dates) andevent.<id>.lines(what friends say) to every string table.
- While the event is on, the scene label shows it.
- The first time each year, a card says it has begun.
- Friends talk about it.
Add an animal's footprints
Add an entry to
tracksinsrc/content/catalog.json, copying a close one:Field Meaning idLowercase and _printprints/<id>.svg, the mark laid in the snow and shown in the albumtailtracks/tail_<id>.svg, the tail that peeks out at the bushbirdtruefor a bird: it flutters off instead of whisking awaygait.grouptruefor a bounder whose prints fall in one line;falsefor a walker whose prints alternate sidesgait.stepDistance between prints, before the yard's zoom gait.sideHow far a walker's prints sit off the line; ignored when groupistruegait.sizeSize of one print findsKeepsake ids the animal likes to leave in the dig lengthThe animal's length in cm; it sizes the animal out of the album Put the drawings in
src/art/prints/andsrc/art/tracks/.trailArtlists the sharedbush,twigsandpuffdrawings.Add the animal's name to every string table.
- A print is a 24-unit vector mark with
fill="currentColor", so the snow shade colours it. - A tail is a rear-only crop, so the animal is never whole.
findsweighTRAIL_LEAN(pets/content.rs) times more in a trail dig than in an ordinary one.- The album's Footprints book lists every track.
tests/print-art.test.mjsand the content tests check the references.
Change the colours of a season or a time of day
- Change the custom properties in
src/styles/scenery.css, per season, time of day and weather. - The painter and every drawing read them.
Verification
pnpm test
pnpm run lint
pnpm run test:e2etests/content.test.mjssays what is missing: a name or a line in a language, a drawing file, an effect, a painter, a curve, a colour, an event's words or gift, or a look's rules.tests/events.test.mjschecks when each event is on, north and south of the equator.- Its days are in
tests/fixtures/event-dates.json. - The backend's
content.rstest reads the same file, so the page and the backend agree on an event's dates. - When you add an event or change its dates, add cases there for the days around its first and last day, north and south.
- Its days are in
tests/lake.test.mjschecks that, when the composition's lake changes (lakeor the curve it names inunder), the water still shows between the far shore and the hill in front at several yard sizes.- The backend's
content::testschecks the catalogue it built in. - To see an event outside its dates, set the date in the screenshot harness or the e2e run.
- In the app, the system clock decides.
- Look at it: build and run the app as in getting started, then set the time of day and weather from the scene label to see the new thing in each light.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| A new gift never comes | No one did anything with a friend today, the everyday wait (every other day) is not over, or not every earlier gift has come yet. A full yard (DECOR_MAX in pets/garden.rs) does not stop gifts: they wait in the album (boxed), one of each kind | Play with a friend; gifts come in the catalogue's order, every other day (gifts from friends) |
A new fish is refused (error.bad_request) | The backend was built before the catalogue changed | Build the app again: the backend builds the catalogue in |
| A drawing does not show | The path in art does not match the file, or the file has no viewBox | tests/content.test.mjs names the file |
| A drawing is black or a single colour | It paints with a colour name the yard does not set | Use the names listed under "Drawings" |
Related
- Design: A yard that grows with you, A painted yard, Yard content as data
- Add a language, for the string tables
Keep discovery information accurate
Shared pools:
- The website's discovery guide reads the app's catalogue and locale strings.
eligibleKinds,fishWeight,relativeChancesandbugChancesinsrc/yard/catalog.jsdefine the shared pools.bugChances(season, period, weather, event, kinds)takes a catalogue from the guide.- At runtime it defaults to the loaded app catalogue.
Bug odds:
- Percentages describe one spawned individual.
- In daylight, the families mix as butterflies 55%, dragonflies 25%, beetles 10% and crickets 10%.
- The mix renormalizes when a family is unavailable.
- Species weights then apply within each family.
- Do not normalize both families to 100% independently.
- Clear autumn evenings and nights have only crickets: a couple at a time, from the bugs of kind
cricketwhoseperiodsinclude that hour. - Rain, snow and unavailable seasons return an empty bug pool.
- Each family holds a fixed share, so a family with many species in one season dilutes each of them; keep at most about two ordinary beetles or crickets in a season, or an ordinary one falls under 5% (
tests/collection-goal.test.mjs). - A fish's or a bug's explicit
rarity: "rare"gives it the album's rare badge. - Anything with an
event(fish, bug or gift) is rare in the album, and its hint gives the event's dates. - Over a year, a rare fish has to bite less often than every ordinary one (
tests/collection-goal.test.mjs); a fish that comes in few seasons or hours needs a higher weight.
Fish odds:
- Percentages are species odds for a fish that has landed, separate from the chance of landing one.
- Clicking water starts manual fishing.
- Play's Fish action uses a 75% automatic landing chance.
- An idle friend at bond level 3 may start fishing on its own every 12–25 minutes, while the visible yard has no competing activity.
- Species odds do not promise a waiting time.
Guide labels:
| Label | Chance |
|---|---|
| “often” | At least 20% |
| “sometimes” | 5% to below 20% |
| “rarely” | Below 5% |
- Probability labels in the guide describe only the selected context.
- Selecting an event assumes it is active and shows the species odds during it, not the chance that the festival happens.
- Event dates and hemisphere rules are in
events.json. - Event gifts stay tied to the calendar.
- Gifts follow a deterministic sequence, not a loot probability.
- The cap of 12 placed decorations pauses deliveries.
- Removing a decoration keeps its album entry, so every gift can be collected over time.
Reachability:
- Keep every album entry reachable across valid contexts.
tests/discovery-guide.test.mjsenumerates fish and bug pools across seasons, times and events.- It also checks that flower, tree and keepsake chances are positive, and that each event gift maps to its calendar dates.
- When you add an appearance rule, update the shared helper and tests before the guide.
- Do not retune gameplay so that every collection can be finished in one sitting.
Planted trees and discoveries
Trees:
- Trees in
catalog.jsonhave an ID, threestages(seedling, young, mature), an optionalseasonArtmap for mature art, and afootprintroot ellipse in authored pixels. - An optional
staturesets how tall a grown tree of the kind stands against the stage's size (treeSizes), 1 by default: about(height in metres / 10) ** 0.3, so a metasequoia is 1.45 and a lilac 0.75. A young tree takes half of it, and a seedling none. The yard (catalog.js treeSize) and the desktop (content.rs tree_size) read it. - New species need a
tree.<id>string in every language. - Drawings use a bottom-centre anchor and share the yard zoom.
- A tree's field coordinate stays fixed through growth and season changes.
planted-trees.jsowns these saved trees.trees.jsis still the procedural scenery painter.
Tree moments:
- A tree names its grown moments with an optional
momentslist, at most one per season and one of each kind; the fields table is in the tree moments design. - Every moment names its
seasonand may nameweather(["clear"]when absent). kindisvisit(a friend walks over to look up at the tree,src/yard/tree-moments.js) orharvest(fallen fruit,src/yard/fallen-fruit.js);MOMENT_KINDSintree-moment-rules.jslists them.- A harvest moment gives
artandsize(the fallen fruit, packed like other discovery art) andtitle, a string key for its button's title. linesnames string keys of friend lines in every language:sayfor a visit (three or four lines),pick(three or four) andfirst(two or three) for a harvest.tests/content.test.mjschecks the kinds, seasons and sizes, the drawing, the title and the lines; the backend ignores the field.
Keepsakes:
- Keepsakes use the
treasureslist, an art path andrarity(commonoruncommon), plustreasure.<id>in every language. - Each tier uses the item weights within that tier.
- Tier odds and timing limits are in
pets/discovery.rs, and the backend exposes them. - The page fallback and the website guide share
core/limits.js. - Its test compares those values with Rust.
Spring shoots:
- Spring shoots use the
shootslist:id,season,artandsize, plusshoot.<id>in every language. - The backend's
is_shootandalbum.shootsread the same list; no string may say how to pick or eat one (tests/i18n.test.mjs).
Affinity:
- Trees and keepsakes may include
affinity: { seasons: ["spring"], weather: ["rain"], places: ["woodland"] }. - Each matching axis doubles the base weight within its own reward category.
- Items that do not match stay available.
- Built-in place preferences use
woodland,courtyardorlakeside. - Imported outdoor scenes keep neutral place weights and still use season and weather preferences.
- Write readable habitat clues in the existing four-language strings instead of repeating prose for each species.
- The page and site share
src/yard/discovery-rewards.js. - The backend allows one uncommon reward per rolling 24 hours, across all friends and places, based on saved dig history.
- During that window, the 3% uncommon share becomes common keepsakes.
- See the environmental discovery contract.
Places and ground:
- A tree belongs to its
worldID. - Existing flowers and decorations stay shared across places.
- The ground profile is a local geometry snapshot of the current floor, the projected water and the placed roots and props. It is not inferred from the image.
- The optional
capabilities.soilof an imported background controls digging and tree planting, independently of sky transparency. - The creator skill and the import validator keep it.
Ground bugs:
- Beetles crawl and crickets hop near the floor.
- Keep their specimen heads pointing up in the atlas so heading rotation stays correct.
- They share the clear-daytime appearance rules but stay on the ground.
- Crickets also come out on clear autumn evenings and nights.
kindsets how a bug moves, not its family name: a mantis crawls as abeetle.- The native album shows ground habitat clues.
ambient-art.jsloads each referenced bug atlas once and invalidates its canvas when decoding finishes.- Exact probabilities stay internal.
- The album and the guide that players see show conditions, a rough frequency and waiting status.