Skip to content

Conversation

@tsdko
Copy link
Contributor

@tsdko tsdko commented Aug 5, 2025

This set of patches addresses inconsistencies in remote picture ID handling. Each commit addresses a separate issue, but they both depend on a helper method introduced in this PR.


Inconsistent player offsets in packet handlers

Current state: Game_Multiplayer packet handlers have a hardcoded offset of 50, but Game_Pictures::EraseAllMultiplayer uses the offset determined by the target RPG_RT version instead, which can be higher or lower than the assumed 50. All games assumed to use the official English RPG_RT have an offset of 1000.

The patch prevents other players' pictures from potentially not being cleaned up when they disconnect.

Sample reproduction steps for Muma|Rope 33.3, a game with the default upper limit of 1000 pictures according to the current version of ynoengine:

  1. connect with player A
  2. connect with player B (not a friend of player A)
  3. make both players go to the music room (MAP0220; save file)
  4. play music with player A
  5. start dancing (x + any arrow key) with player A
  6. go into private mode with player A
  7. reconnect with player B

Result: player B sees an extra sprite (dancing picture) even though they're the only person in the room.
This process can be easily repeated if player A gets assigned a different ID when they reconnect:
image


Relaxed save picture offset

This was introduced in 44af062, but the issue it was intended to fix (non-remote pictures not getting saved) seems to have been caused by something else, possibly the uninitialized idx variable from 595bbd2. On current master it is still possible to get remote pictures in if the player ID is sufficiently low; this 2kki save file has a sheep from player 0 at index 51 (it doesn't actually show on screen when loaded though).

I have tested this with all affected games mentioned in #38 except for CU; this change does not break the overlays mentioned there.

tsdko added 2 commits August 5, 2025 02:36
Game_Multiplayer packet handlers had a hardcoded offset of 50,
but Game_Pictures::EraseAllMultiplayer used the offset
determined by the target RPG_RT version instead, which could've
been higher or lower than the assumed 50.

Prevents other players' pictures from potentially not being
cleaned up when they disconnect.

For games with support for >50 pictures this also prevents remote
pictures from accidentally overwriting local pictures with IDs
over 50.
The relaxed offset was introduced in 44af062,
but the issue it was intended to fix (non-remote pictures not
getting saved) seems to have been caused by something else,
possibly the uninitialized idx variable.
@Desdaemon Desdaemon merged commit 01b323f into ynoproject:master Aug 5, 2025
2 of 8 checks passed
@tsdko tsdko deleted the consistent-playerother-picture-offset branch August 6, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants