Repository navigation
S5: The player gets hungry - #369
Merged
Merged
Conversation
Hunger rises while someone's playing. The player eats at home for nothing, at the café or the noodle bar at the economy's meal price while it would feed a resident, or from food they carry. At 1 they collapse, leave what they carried where they fell and wake at home, still hungry, and pick it up again with E. player_state goes out on connect and on change, a change to hunger or a lamp's charge alone once it's moved by 0.01. The client shows a hunger hint, eats on F and wakes at home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a reconnect A player_collapsed that arrives before the street is shown is kept until it is, and a snapshot makes the client report where the player is again, so a restarted server knows before they next move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Everything else they carried stays in the pile where they fell, as the lead decided on the contract's review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Changes requested: one small item. The behaviour, the contract and the scope are right. Only the comment rule is left. Changes:
Checked and fine:
Not blocking:
|
- Hunger rises only while a client that has sent a player position since connecting is still connected, so the menu and the creator don't count. - A tab whose side scene wasn't running when the player collapsed starts them at home. - Docstrings in hunger.py and sync.py are one line; the README has the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
Contributor
Author
|
Approved. I re-reviewed at
Nit, not blocking: the new sentence in |
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.
The player gets hungry, eats, and collapses when they starve, on the contract from #367.
Server:
simile.player(new; README)InGame). Nobody starves on the menu, in the character creator or with the game closed, andheadlessandsimulatenever touch the player. A test connects a menu-only client and an in-game one, and hunger rises only while the in-game one is there.eat:supplyhook would feed a resident there: the barista on shift, the keeper in and the batch not sold out. The keeper is paid through the ledger as fromOUTSIDE, since the ledger holds residents' money and the player isn't one, and pays the supplies as for any sale. A noodle-bar meal comes out of the batch. The ledger's gap stays 0.player_collapsed.pick_uptakes from the nearest pile within 1.5 tiles each item that still fits under the carry limit, in order. Any that don't fit stay in the pile.player_stategoes to each new client after the snapshot, clock and the other greetings, and on change (PlayerSync):Client
playerStateinnet/keeps the lastplayer_state.ui/hunger.ts):pilekind inworld/reach.ts, so a door beside it goes to ↑ as for any reachable.player_collapsed, as through a door. If the street isn't shown yet, or a door is under way, it waits until it's done. The collapse also becomes the side scene's start position (sideResidents.start), so a tab that wasn't in the game when it happened starts the player at home.Checked by hand
test_simulate's 24-hour day matches main move for move: 75,577EntityMoveds, identical with this module'srunninghook entered too, and 48 meals.simile.db, saved before the player existed, loads with the starting player. A player who collapsed there, leaving a pile, saves and loads back.?playagainst a hungry in-memory village:Please decide
content/street/, which S3 owns. Aris's workshop is where the story puts the player, so it stands in. It'sPlayerConfig.home, one line to change once there's a house.eat, priced and staffed through the economy, and the café's drink order is left alone.PlayerConfig.simile servethe clock runs at 1x, so otherwise closing the tab overnight, or leaving it on the menu, would collapse the player.InGametells clients apart by the task each one's messages arrive on, since the hub doesn't say which client sent a message. If the hub ever says which client sent a message, that's a small protocol change.Beyond Owns, for review:
client/src/world/reach.ts,ui/keys.ts,ui/dialogue-scene.ts,ui/help.tsandui/tuning.ts, for E and F.client/src/side/side-scene.ts, to wake the player at home. It also resends the player's position after each snapshot. Before, a page that outlived a server restart left the server not knowing where the player was until they moved, so it couldn't offer a meal or leave a pile where they fell.README.md's controls table.server/tests/protocol/test_lifespan.py: the full app now greets withplayer_stateaftermurals.simile.playergreets fromrunningso it comes after the other greetings, which leaves the gallery test's four greetings as they were.Closes #352
🤖 Generated with Claude Code