Repository navigation
Co-op: every player has the town's creatures as its own, and the story flags are the group's - #940
Merged
Merged
Conversation
Three more domains of the shared-state digest (logging only): the 20 story flag bits contents condition 0x32 reads, the home record of each character as this process reads it (the mirror on a member), and the use count of each move. A member whose values stay apart from the authority's is logged with the entries that differ, as for every other domain. A build without them ignores the new domain ids.
The game's own-creature test 0x284ef4 compares the parents of a creature's friend record with this process's user id. On a member that is false for every creature of the group's town, so a member had no talk option to move a creature into a house, none of the talk rows for one's own creatures, friendship values of 0 and no balloon over a creature that has something to say. It is a row of the party table now: a new row kind for a predicate function answered whole (PKP_PARTY_PRED, fact Owns in pkp_coop_party.cpp). On a member in a session, outside Cloud Island, a creature whose record has parents is the group's own. Members only: the authority's own answer already is the group's. Five callers keep the game's answer by their return address (the friendship stores, two talk-end steps the authority applies itself, the per-frame scan that queues events). The talk handler's own test (0x4c0574) uses the same fact. With the test answered, script callback 0x4ab268 goes past it on a member for the first time, and the friendship module's midhook 0x4ab358 behind it starts to run: a member's talk that marks a creature's 'has something to say' flag as seen sends that flag to the authority (FriendAsk kind 2), which sets it in the group's record and sends the record to every member. Until now only the host's talks cleared that balloon.
…very player The talk option to move a creature into a house (0x4db9f4) asks that the creature's leader is this process's own player (cmp at 0x4dbcbc). In a session a creature that follows any player of the session passes: a new row kind of the party table for a compare of a creature's leader with this player (PKP_PARTY_LEADER). The house is still the one the talking player stands in or next to, and the home is written as for that player.
The 20 story flags (contents condition 0x32) have one writer, contents action 0xbbd (0x12c46c), which runs on the process whose own content record runs. A flag set by a record that waits for one player's scene end or talk existed in that player's save alone, so the other players' records that test it went another way. New module pkp_coop_story_flags.cpp, one entry hook on the action: a member's set runs and is asked of the authority, which sets its own flag; a member's clear does not run (the clears are stage-entry and content-start records, and a member that joins late must not clear what the group has); the authority sends its four bytes when they change, when a member joins and every 30 s, and a member writes them into its save, keeping the sets it still waits for. A member that joins late reads its own save's flags until the authority's first message (the frames between its world load and the join's send); what its records write in that window is replaced on arrival and is not sent.
A build without the own-creature and leader rows and without the story flags module would play one session by other rules: it would offer other talks for the town's creatures, and neither send its flag sets nor take the group's flags.
Nothing shares those counts, so the domain differed for every player at every look and made each look a full exchange. The story flags and the homes stay.
3 tasks done
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.
What it changes
pkp_coop_story_flags.cpp.PROJECT.md 6.7: these are bends, not rebuilds. The game's own test and its one flag writer are answered at one place each; no game system is switched off.
This is slice 5 of the party checks (#933, #934, #935, #937, #939).
For players
CHANGELOG.md## Unreleasedhas an entryPros
Cons
pkp_coop.cppis at 787 lines and is due a split.