Repository navigation
S4: Darkness and the lamp - #379
Merged
Merged
Conversation
The metro's dark stretches are drawn dark, the lamp lights a circle around the player, and what it has lit stays dimmed. The battery drains while the lamp is on and charges on a plug: home, the Daily Grind, the noodle bar and the metro's maintenance alcove. L switches it, and a gauge shows the charge. Underground streets keep one light rather than the village's time of day. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # client/src/side/side-scene.ts # client/src/ui/dialogue-scene.ts # server/simile/player/lifespan.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
Contributor
Author
|
Changes requested. The darkness, the lamp and the plugs work, and the village is unchanged. There's one bug in what the gauge hears, and one docstring to trim. What I checked:
Changes
Nit: Notes for the user, not blockers
|
Merged
PlayerSync also sends a charge that reaches exactly 0 or 1, so the gauge doesn't stop at 99% after charging. Lamp's docstring is one line, and the socket test checks charging too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Approved. Both changes are in. A collapse now switching the lamp off is a sensible addition. What I checked since e0cd996:
My earlier notes for the user still stand. The lamp no longer stays on after a collapse, but it still drains in the village if you leave it on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Darkness in the metro's unlit stretches, a lamp that lights a circle around the player, a battery that runs down while it's on and charges at plugs, and a gauge. Built on the contract in #377.
Closes #351
What it does
TownMapreads each map'slightlayer (S3's):TownMap.light, andlit(x, y), dark where a dark stretch covers a cell and no lit one does. The client reads the same layer and draws darkness over the dark stretches (side/dark-view.ts), above everything in the world, on a canvas of four px a cell scaled up smoothly, so the edges are soft.server/simile/player/lamp.py): it drains while the lamp is on, and at a plug it charges, on or off, as S4a: Contract: the lamp switch #377 now says (test_it_charges_at_a_plug_on_or_off_up_to_full). Plugged in, it doesn't drain. When it runs flat the lamp goes off by itself, and switching on a flat one does nothing. Like hunger, it only changes while a client is in the game. A collapse switches it off, so it doesn't run down at home while the player recovers (test_a_collapse_switches_the_lamp_off).pluginteractables, from S4a: Contract: the lamp switch #377): the metro's maintenance plug, now aplugrather than amachine, and three in the village, on the ground floors of home (the maker space, at the entry where you wake after collapsing), the Daily Grind (by the stairs, at 16) and Golden Bowl Noodles (by the entry). The village's are drawn in code as a small charging point with a yellow bolt; the metro's is its breaker box.lampfrom S4a: Contract: the lamp switch #377). The help panel and the README's controls list it.PlayerSyncsends a charge alone once it has moved bystep(0.01), and now also when it reaches exactly 0 or 1, so the gauge never sticks at 99% after charging (test_a_charge_that_reaches_full_or_flat_is_sent_off_the_step, and over the socket intest_the_client_switches_the_lamp_and_hears_it_run_down_and_charge).undergroundmap property (the metro, fromUNDERGROUND) is always lit as early afternoon, with the glow maps at 55%, so the clinic's front glows; the village keeps its time of day.Rates
Both in
LampConfig. The metro's dark stretches take seconds to cross, so the battery only bites if it's left on, or in S9's sewers.Please look at
All from the real client in the
?harness=sideharness (which answerslampas the server would).Taste calls worth a look: the radius, how dark unseen (95%) and seen (65%) are, the glimmer, the charging point's look and size, and where the gauge sits.
Notes
test_simulate's 24-hour day (from 08:00, seed 0, talk 3) on main and on this branch: 75,577EntityMovedevents, identical, and the same summary. Residents never use plugs.simile.dbin a temp dir (fake LLM, no news): all 11 residents back, the player loaded with a full lamp; switched on in the west tunnel and drained, saved, reloaded with the same charge and switch, then charged to full at the maintenance plug.street/metro.py,street/village.py,tests/street/test_metro.pyandcontent/street/for the plugs, and toplayer/sync.pyfor the full and flat charge. Beyond that,client/src/ui/lamp-gauge.ts(new, with its CSS and tests) and four lines inui/dialogue-scene.tsto mount it, a section inui/README.md, and three tests that assumed the café's ground floor had one interactable:server/tests/world/test_movement.py,server/tests/persistence/test_state.pyandclient/src/world/interactables.test.tsnow pick the counter by id or list the plug.player/lifespan.pywires the lamp beside S6's pickups and trade,TownMaphas S6'spickupsbesidelight, and the side scene draws S6's glints and the darkness.Lightmoved fromsimile.street.plantosimile.world.map, besideTownMap, andplanimports it.Follow-ups
Playerfield, in a contract of its own.docs/protocol.md'splayer_collapsedcould say the player wakes with their lamp switched off.🤖 Generated with Claude Code