Repository navigation
Conversation
platform.h gets display_work_area, place_window, window_rect and set_window_focusable, in their own file (platform_place.cpp), plus WindowDesc::focusable and InitOptions::place_windows. Split screen (Dittobyte#684) needs them: each of its two windows sits without a frame in its half of the work area, and the second must not take the keyboard focus when it appears. place_window asks first whether the window system lets a window choose its position (Wayland does not), and sets position and size in two passes: KWin fits each request to the window as it is at that moment, so one pass left the window on the wrong display's width or pushed out of the lower half. With place_windows set, X11 is asked for before Wayland on Linux. Co-Authored-By: Claude <noreply@anthropic.com>
Split screen (Dittobyte#684) runs the game twice on one PC, the two processes meeting through Link Play on 127.0.0.1, after pokopia-native's design. Whoever starts the pair says which window a process is with the new [split] keys (window, layout, pad, mute, first_account; nxrt/split.h and CONFIG.md); nothing is a player setting, so no file is written. play_split.cpp keeps the window in its half of the work area and puts it back when anything moves it; the settings' window mode, monitor move, window size and Alt+Enter do nothing there. A window plays one controller, by its place in connection order, or none: poll_pads, the prompts and the status read the pads through own_pads. One of the two windows never has the focus, so [audio] mute_unfocused does not apply and a window is silent only when [split] mute says so. play::display() tells the game's start-up that the window is placed by play mode and whether it may take the focus, so pkp_main.cpp needs no knowledge of split screen. Co-Authored-By: Claude <noreply@anthropic.com>
The second player's save can be a copy of the first player's, and the host refuses a visitor with its own player UUID (error 9005), as it did with the UUID older builds shared. In split screen's second window a save whose UUID equals the one of the first player's save ([split] first_account) gets a new one in the same places, before the game reads it. The UUID is read from its plain copy in SYDAT and only taken when the bytes there are a version 4 UUID. The rewrite the repair already did is now swap_uuid, with the UUID to replace as a parameter; the repair of the shared UUID uses it unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
Link Play gets a Split screen section (Dittobyte#684): top and bottom or side by side, what player 1 plays with, who player 2 is, the second window's sound, and Start split screen. play_split starts the game twice: the active profile hosts in the first window, a second profile visits it on 127.0.0.1 on a port of the pair's own. Each window gets its role in its environment (the runtime's [split] keys and the second player's account), so pkp.ini is not touched. The second window ends with the first. split.rs prepares the pair. The second player is a profile other than the active and the first one; without one, "Player 2" is made. A second player without a save starts from a copy of the first player's (saveimport::copy_account), since a new game cannot visit before its story opens Link Play. The second window writes its own log and a fresh copy of controls.ini under split/, and only reads the pipeline cache. The first player's account folder comes from the profile's uid. saveimport::locate is not used for it alone: for the first profile it takes the newest .meta in the save folder, which can be another profile's once there are several. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
A Link Play session holds four players, so split screen (Dittobyte#684) takes up to four windows. [split] window is 1 to 4 and the new [split] count says how many share the screen: with three the first window keeps a half and the other two share the rest, with four each has a quarter. split_part replaces split_half. Every window but the first appears without taking the keyboard focus. Every visiting window may hold a copy of the first player's save, so the check for a player UUID of its own runs in windows 2 to 4. The new UUID is random, so two copies differ from each other too. Co-Authored-By: Claude <noreply@anthropic.com>
The Split screen section asks how many play. Every player after the
first is a profile of their own, picked on the page or made at the start
("Player 2", "Player 3", ...), and nobody plays twice. A player without
a save starts from a copy of the first player's. Each visiting window
has its own folder (split/<window>/) for its log and its copy of
controls.ini, and all of them end with the first window.
With the first player on the keyboard and mouse, the controllers start
at the second player.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
[pad] controller picks the one controller that plays on a PC with other people's pads connected. A split screen window already plays one pad only, the one [split] pad names, and every window reads the same number from controls.ini: with a controller chosen there, each window whose pad is another one got no input at all. Co-Authored-By: Claude <noreply@anthropic.com>
A layer over the whole picture with two lines of text and a row of squares that light up in turn, for the moments a feature holds the player until something outside their own game is ready. Any feature shows and hides it; it ends on its own after the time the caller gives, so a caller that never comes back does not leave a covered game. Co-Authored-By: Claude <noreply@anthropic.com>
[split] meet: the first window opens a local Link Play session once its player is in the world, and the other windows look for it and join. The game layer makes the three requests the game's multiplayer menu makes of the session manager (open, search, join), on the game thread, so no menu is opened and nothing is pressed for the player. A window that joins shows the waiting screen until it is there. [split] together: a player who joined is taken to where the first player stands, by the game's own warp of a player, once the game reads their input again. The game lets a visitor arrive at the PC, which the first cave of a new game cannot be reached from. Both keys are off unless the starter sets them. Co-Authored-By: Claude <noreply@anthropic.com>
Two switches on the split screen page, both on by default: Join player 1 automatically (the runtime's [split] meet) and, with it, Start next to player 1 ([split] together). With the first one off the page names the Link Play menu entries as before. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
3 of 11 tasks
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
Build step 2 of the design in #701. It builds on #692 (split screen): the last four commits are this change, the ones before them are #692's.
Split screen started the game once per player, and the players then met by hand: each one walked to the PC and went through the Link Play menu, host first. In a new game that is not possible at all, because the game unlocks that menu later and the first cave has no PC. Now the players come together on their own once each has loaded their save.
[split]keys,meetandtogether(runtime/include/nxrt/split.h,play_split.cpp, CONFIG.md). Both are off unless whoever starts the group sets them; shared code only carries them.core/pkp_split_session.cpp: the game has one Link Play session manager, and its multiplayer menu only makes requests of it. Withmeetthe module makes the same three requests the menu makes for "Local connection" without a password, on the game thread: window 1 opens a session once its player is in the world, the other windows search and join, and search again while window 1 is not there yet. No menu is opened and nothing is pressed for the player. The requests do not ask for the menu's unlock, so a group can meet in the first minutes of a new game. A player who leaves the session is not brought back.together: the game lets a visitor arrive at the PC, wherever the host is. With this key a visitor is taken to where the first player stands, by the game's own warp of a player (the one its script command for moving a player calls), once the game reads the visitor's input again; both games then show the two side by side. If the visitor is found far from the first player a moment later, it is warped again, three times at most.ui/pkp_wait_screen.{h,cpp}: a waiting screen over the whole picture (two lines of text, a row of squares that light up in turn) that any feature can show and hide. A joining window shows it from its first search until its player is there, so nobody plays on in a world they are about to leave or sees the stop at the PC. It ends on its own after the time the caller gives.[pad] controller(the one controller that plays) is not applied in a split screen window, which already plays the one pad[split] padnames. With a controller chosen there, every window whose pad is another one got no input.Part of #684.
For players
CHANGELOG.md## Unreleasedhas an entry (Before / Now / Still not), or this change is not player-facingPros
[split] meetthe module does nothing, and the launcher's first switch gives the manual way back.Cons
For the repo owner
split/SPLIT-SESSION-RE.md, sections 2, 5 and 8.[split] meetandtogetherhave no row in the game's Settings screen, like the other[split]keys: they are a start's role, set by the launcher.pkp_split_session.cppholds the session requests and the visitor's placing. If the placing grows (choosing where a visitor arrives would remove the stop at the PC), it is a file of its own.runtime/src/gfx/platform.cppon main has a literal NUL byte inside a char literal (line 599,out[0] = '<NUL>'), which clang warns about;'\0'was probably meant.