Skip to content

Open a stall after dark so the town still trades at night - #111

Merged
Julian-adv merged 1 commit into
Julian-adv:masterfrom
simulacre7:night-merchant
Aug 7, 2026
Merged

Julian-adv merged 1 commit into
Julian-adv:masterfrom
simulacre7:night-merchant

Conversation

@simulacre7

Copy link
Copy Markdown
Contributor

Follows your note on #103 — the night merchant that has to exist before blocking trade with a sleeping one.

Rica keeps the only shop in Aldermark and her schedule puts her in bed at night, so #103 on its own would leave the town with no counter open. Wick opens after dark instead.

What this is

He is a registry NPC like Rica and Karl, so there is no new art — NPCs go through the same character-creation path players use. The change is a row in each of the two CSVs, a persona, and a schedule that inverts Rica's. The schedule carries no action, so it drives him on its own and llm = "none" is enough to run him.

His catalog is narrow on purpose — torch, healing potion, campfire kit, bread, jerky, scroll of return — and he pays 30% where Rica pays 40%. Night trade should be a convenience, not a better deal than waiting for morning.

Test plan

  • every_merchant_has_an_npc_registry_entry — a merchant lives in merchants.csv and npcs.csv both, and adding only one leaves a shop no agent can run. I confirmed it fails with the npcs.csv row removed.
  • a_merchant_stocks_night_essentials — a night merchant with no torch or bandage would not answer the problem it exists for.

cargo test --workspace green (374 server tests), cargo fmt --check and cargo clippy --workspace --all-targets clean.

What I could not check

The stall coordinates are my best read of the map from map_labels.csv (Aldermark at -1475, 4742) and Karl's patrol waypoints. The agent snaps to terrain height when it walks, so the height should sort itself out, but whether the spot sits somewhere sensible on the road wants an in-game look. Easy to move — it is one line in schedule.json.

I also left him without a bed at day, since I had no way to confirm a free furniture placement id. He simply goes off duty at the edge of town, which means a player who seeks him out by day can still trade. If you would rather he were unavailable until dark, giving him a bed placement is a one-line change and #103 then blocks him for free.

Merging this before #103 leaves the game playable at every point.

🤖 Generated with Claude Code

@simulacre7

Copy link
Copy Markdown
Contributor Author

Followed up on the coordinates I flagged, by sampling the baked heightmap rather than guessing.

The stall spot (-1484, 4741) is flat land at 1.35 m, varying 0.2 m across a 6 m span, and the day spot (-1527, 4756) is 0.80 m. Both sit consistently with the town around them — Rica's house 1.30 m, Karl's post 1.30 m, the Aldermark label 1.40 m — so neither is in water or on a slope.

Worth noting the declared y values in existing schedules are already approximate: Karl's waypoints say 0.6 where the terrain is 0.77–0.95. Mine are within the same tolerance, and the agent snaps to ground when it walks anyway.

What I still cannot check from the repo is whether a building stands there, since houses are runtime data rather than baked files. If the spot is wrong it is one line in schedule.json, and you know the map far better than I can infer it.

Rica keeps the only shop in Aldermark and her schedule puts her in bed at
night, so blocking trade with a sleeping merchant (Julian-adv#103) would leave the town
with no counter open at all. This adds the merchant that has to exist first.

Wick is a registry NPC like Rica and Karl — a row in each of the two CSVs, a
persona, and a schedule — so he needs no new art: NPCs are created through the
same character path players use. His schedule is Rica's inverted, and since it
carries no `action`, the schedule alone drives him and no LLM backend is
required to run him.

His catalog is deliberately narrow, and he pays less for what players sell
(30% against Rica's 40%). Night trade is meant to be a convenience, not a
better deal than waiting for morning.

The two tests guard the mistakes this shape invites: a merchant added to one
CSV but not the other would define a shop no agent can run, and a night
merchant that stocks no torch or bandage would not answer the problem it
exists for.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Julian-adv
Julian-adv merged commit 8561125 into Julian-adv:master Aug 7, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 7, 2026
@simulacre7
simulacre7 deleted the night-merchant branch August 10, 2026 02:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants