risk-of-thunder/R2API

R2API desynchronization

MeatMorning opened this issue · 9 comments

R2API causes desynchronization for some clients, causing disappearance of other players, entities, or even blackscreening whole game without ability to rejoin the game upon entering new stage. Tested on profile with only 3 mods enabled: R2API, BepInEx and HookGenPatcher. Look for:
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
RoR2.CharacterBody.UpdateAllTemporaryVisualEffects () (at <9cd64984fa244ad6be9ff1fde41ed978>:IL_0068)

LogOutput (3).log

There seems to be something wrong going on on the TemporaryVisualEffect stuff, iirc this API was written by @Vale-X, i'll notify them about it.

There seems to be something wrong going on on the TemporaryVisualEffect stuff, iirc this API was written by @Vale-X, i'll notify them about it.

The api is not used in this log, so thats false
We would need a log of all the people that tried to play together, the log here is not that useful without the others

We tried to reproduce it on "clean" mod profile, but couldn't for some reason, and started regular modded game. Things went south when we entered shipgraveyard. Look for "OnClientSceneChanged networkSceneName=shipgraveyard loadedScenes=shipgraveyard" in client log, and " OnClientSceneChanged networkSceneName=shipgraveyard loadedScenes=shipgraveyard" at the bottom in host log. Perhaps i should mentioned that the client is playing on low-end laptop, so it might be something with loading into new stage
LogOutput sync error client.log
LogOutput sync error HOST.log

Update: it seems this error happens much more often when leaving bazaar. This time 3 players game
LogOutput 3 players client 1.log
LogOutput 3 players Host.log
LogOutput 3 players client 2.log
.
Update: tried out new Host but the issue persisted
LogOutput Host'.log
LogOutput client 2'.log
LogOutput Client 1.log

From the looks of things, it's not caused by R2API itself, but rather one of the other mods you have. If you really want to find the cause, you can try disabling a few mods at a time until the issue dissapears to narrow it down. Outside of that though, I don't think this is specifically an R2API issue.

I told you we've tried to test only essential mods (Bepinex, hookgenpatcher and r2api) and the issue stll occured at the same rate at the same sircumstances, starting with the same nullreference line: [Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
RoR2.CharacterBody.UpdateAllTemporaryVisualEffects () (at <9cd64984fa244ad6be9ff1fde41ed978>:IL_0068)
WE never had such issue over 1 year of heavily moded profiles or vanilla, and only after SotV and r2api update it broke and became unplayable in long term because at any moment my friend gets blackscreened with inability to reconnect.
Presumably it bugs out the following way:
Entering new stage, host (me) successfully loads. Client (friend with issue) due to low performance loads a bit longer, but despite her machine haven't loaded all entities on a stage, some mod system tries to refer them. It already exists for host, but doesn't exist for client, causing nullreference exception and desyncing failed entities. If it's multishop, only one position will be seen, if it's a teleporter, it will be placed in wrong location, if it's another player, its model will stand still where it spawned, if it's her own character, she won't spawn at all causing blackscreen.

I told you we've tried to test only essential mods (Bepinex, hookgenpatcher and r2api)

R2API does not touch a single game system unless another mod asks it to. Are you sure this doesn't also happen without R2API? Have you made sure this isn't just a base game issue shipped with the DLC update?

played a lot of vanilla before r2api got update, never had such issue.

I gonna try today to use only bepinex to be sure if it's vanilla issue

Okey, i found similar issue from another player on steam forums, so it's definitely on vanilla side, excuse me for taking your time