FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.75k stars 406 forks source link

Disconnect (index out of range when reading "ENTITY_POSITION") #3927

Closed Kaillera closed 3 years ago

Kaillera commented 4 years ago

Description When you're playing multiplayer with more than just the host. Shooting Piercing Ammo on crawler/mudraptor swarms that are next to the sub (probably latched) using a drone have a chance to error all the players except the host out to Entity_Position.

Version 0.10.5.1

Additional Informations Not sure if other ammo will cause the same issue. This has happened multiple times.

crashreport_object.log event_error_log_client_Kaillera_629 PM.log event_error_log_client_Kaillera_628 PM.log event_error_log_server_Kaillera_1829.log event_error_log_server_Kaillera_1828.log event_error_log_server_D.B. Cooper_1829.log event_error_log_server_DarkRider_1829.log event_error_log_server_Ghostface_1828.log event_error_log_server_D.B. Cooper_1828.log

Regalis11 commented 4 years ago

What's an "Entity_Position" error? Do you mean something like the errors reported in https://github.com/Regalis11/Barotrauma/issues/3019 ("index out of range", with the previous header being ENTITY_POSITION)?

Kaillera commented 4 years ago

Forgot to put caused by drone in title and added the error to additional informations.

https://www.twitch.tv/videos/753843519?t=00h29m48s

Happens at 31:06.

Regalis11 commented 3 years ago

Discovered a potential cause for this: I noticed that based on the error reports it seems to happen when reading data for coilgun/railgun ammo and characters (usually monsters that appear in large numbers) in succession. My theory is that when the projectiles and enemies are being rapidly created and removed, the clients may not have received all the EntitySpawner events when reading the position data (i.e. they may not be up-to-date on which items/characters currently exist), and can get the entities mixed up. If they don't know that e.g. a hammerhead spawn's ID has been taken up by a newly spawned coilgun bolt, they'll try to read the bolt's data with Character.ClientRead, which will end up going out of bounds since.

Pushed a fix in https://github.com/Regalis11/Barotrauma-development/commit/930baada8780da20be6212a80dd6be3183ecdbf3, let's see if it takes care of this.

Rokvach commented 3 years ago

There hasn't been any encounters to this issue nor has it brought up any additional issues, but I will still keep this ticket open until the whole testing period of this update ends.

Rokvach commented 3 years ago

I am confident that this issue has now been fixed, if it does come up again we can just re-open this ticket. Closing.