Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Respawn shuttle always spawns, even if players load in the main sub

Open Vykn opened this issue 1 year ago • 6 comments

What happened?

Players that connect mid-round that have previously joined a campaign will spawn inside the submarine once the respawn timer hits zero, but the respawn shuttle will spawn anyway, even if there are no players that will spawn inside. This can lead to some confusion as the captain may attempt to steer towards the shuttle, despite there being no crew to pick up.

The respawn shuttle should only spawn if there are players that are actually spawning on it.

Reproduction steps

  1. Host a multiplayer campaign
  2. Have a player connect and spawn, then disconnect
  3. Complete the level and go to a different level
  4. Have the player reconnect
  5. Observe that the player spawns on the submarine, but the respawn shuttle spawns anyway.

Version

v1.2.8.0 (Winter Update hotfix 2)

Vykn avatar Feb 18 '24 06:02 Vykn

Thank you for the report!

I think the bug here isn't that the respawn shuttle spawns, but that the player spawns in the main sub. A reconnecting player shouldn't spawn directly in the main sub unless their character's body is still in the sub. I gave this a quick test, and couldn't find a way to repro the issue: the respawning player seems to spawn inside the respawn shuttle.

Are you using some kind of non-default respawn settings by any chance?

Regalis11 avatar Feb 18 '24 10:02 Regalis11

I didn't consider the players spawning in the main sub to be a bug because they're on the main sub when they disconnect, so why would they suddenly be not on the submarine after they reconnect? It's not like they've died, or it's a different person. I think most people prefer it the way it is, even if only because they can get right back into the action without having to gamble with enemy spawns while they wait for the sub to pick them up.

Anyway, I was easily able to reproduce the issue. I had a player connect, spawn, then disconnect while at a station. Then went into a level. They reconnected on the ship and the respawn shuttle spawned in.

https://github.com/FakeFishGames/Barotrauma/assets/37850646/45e3e6ad-43eb-4c3f-b652-d67e9e6a74df

https://github.com/FakeFishGames/Barotrauma/assets/37850646/97a68c00-abff-4b42-8528-501307570ba1

The relevant server settings should be default; (I don't think changing the respawn timer would affect it?)

  UseRespawnShuttle="True"
  RespawnInterval="20"
  MaxTransportTime="180"
  AllowRespawn="True"

This happens every time an ongoing campaign is started back up and players join while a round is going, so players see it quite often. I didn't test disconnecting during a level (not a station), then reconnecting in another level, because I'm pretty sure the behaviour is the same.

Vykn avatar Feb 18 '24 12:02 Vykn

I didn't consider the players spawning in the main sub to be a bug because they're on the main sub when they disconnect, so why would they suddenly be not on the submarine after they reconnect

Do you mean a disconnection due to some kind of an error or networking problem specifically? I was thinking of a "normal" disconnection, the client just leaving the server. In that case I think it makes sense they don't spawn in the main sub: I see it as the character "leaving entirely", opting to not take part in the mission, and if they decide to join later, they shouldn't magically be able to appear directly in the sub mid-mission.

I think I'll need to give this another try by forcing an "abnormal" disconnect instead of just making the client quit to the main menu, could be that I couldn't repro the issue because I just tried the latter.

Regalis11 avatar Feb 18 '24 15:02 Regalis11

In terms of the game itself, it's just the player quitting to menu, then connecting again after the sub moved somewhere else. It also occurs if the server goes back to lobby, so I don't think the method of disconnection matters.

My comment about them still being "on the sub" was just my rationale as to why rejoining clients have a character that is on the sub - maybe they were just sleeping the whole time or something. If that's not intentional, then that should be fixed, I was just sharing how I saw it. Their body couldn't literally be on the sub since disconnected players disappear on level transition if the client isn't connected.

Vykn avatar Feb 18 '24 16:02 Vykn

Actually, on a closer look, it seems that a few years ago we intentionally made the characters spawn in the sub regardless of how/why they'd left the server previously (ticket in our private repo). So I guess we do need to fix the shuttle spawning after all, not the underlying respawn logic. :D

Regalis11 avatar Feb 18 '24 16:02 Regalis11

Fixed in https://github.com/FakeFishGames/Barotrauma-development/commit/58e60da5ee33dc15877af0b49186877e54088d01

Regalis11 avatar Feb 21 '24 20:02 Regalis11

Tested in: https://github.com/FakeFishGames/Barotrauma-development/pull/4986/commits/caee1be32ba3e769f803d7f316def469fd9ef529

Tested with step above Tried different combinations of respawn shuttle on and off Tested normal respawning in mission mode and campaign

No issues found Closing ticket as completed

Jasontti avatar May 27 '24 07:05 Jasontti