Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Steam P2P Disconnect on round ending

Open UnhappyWithMyUsername opened this issue 2 years ago • 10 comments

Disclaimers

  • [X] I have searched the issue tracker to check if the issue has already been reported.
  • [X] My issue happened while using mods.

What happened?

We're playing a heavily modded casual roleplay campaign with up to 6 people currently, 2 of which are youtubers and broadcast these sessions live on youtube almost every friday. (@ToucherOfGrass, @Noveva) They provide VOD so you can skim through the latest streams to see it happening over and over again.

We are almost always (Like 90% of the time) disconnected with a "Steam P2P Timeout" as soon as the next round gets initialised (docking button or start button on map pressed). You can't even see the submarine trying to actually dock to the station as you usually can. It just floats in the direction it was heading, making it clear the disconnect happens on button pressed. However in rare cases we're not disconnected and we have yet to figure out in which case this happens. So far it is seemingly random.

We are spread all around the world. One is from poland, one from singapore, one from turkey, one from canada, I'm from germany and the host is located in sweden, so getting the exact same testing environment might be tricky.

Here are our latest save file, character file and mod list to load in game contained in a .zip and a link to the mod collection for a more easy installation process for you, further below.

Please be aware that a few mods couldn't be added to the collection. I added the links to these mods in the collection description for you to quickly download them separately.

Save files and ingame mod list: SteamP2PIssue.zip Mod collection on Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=2991696986

Reproduction steps

  1. Install the mods
  2. Use the mod list hc5
  3. Play multiplayer on the HardcoreBaro save file with 5-6 people (Not sure if player count is actually relevant)
  4. Transition through multiple level doing various missions.

Bug prevalence

Happens every time I play

Version

v1.0.20.1

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

UnhappyWithMyUsername avatar Jun 19 '23 16:06 UnhappyWithMyUsername

Additional Info: We've now noticed that if you load into the level from the previous round (redocking to the same outpost you just left or undocking to travel to the outpost you previously wanted to travel to, with the same missions selected as before), the P2P disconnect doesn't happen. My guess to why this happens would be that the previous level you were in is perhaps still loaded in memory and thus can easily be transitioned to by the game and doesn't cause a disconnect. So the disconnect seems to be connected to level loading into memory I suppose?

UnhappyWithMyUsername avatar Jun 27 '23 18:06 UnhappyWithMyUsername

For some time I've looked into this on and off, and sad to say I just can't handle enough heavily modded clients to test this properly I think. I also couldn't test it under P2P conditions but dedicated conditions instead under the same machine.

I've got a suspicion on what is occuring, as I noticed with each extra client I had, a freeze on changing rounds would get noticably longer, it could be due to the LUA, or the sheer number of modded items and submarine size/inventory/save file or some other potential reasoning.

Perhaps this could be tested better with some kind of logging added between the ending of rounds and starting of new rounds server-side, the time taken and other such.

When a round ends if the submarine simply "Goes past the docking port", other characters disappear, but doors still open and you can move around. that is a sign the server has stopped communicating to the clients for awhile, and a long enough time will cause a disconnection. the host of a Peer 2 Peer server is not likely to disconnect this way to my knowledge but can't be fully sure. So it makes sense for the host (and only the host) to make it through if the server is taking too long.

Unless you have more information you could provide (Such as does it occur with dedicated servers or is it exclusively peer to peer ingame hosting?) not too sure how I could further go about this for now. May be able to look into this further at a later date.

NilanthAnimosus avatar Aug 02 '23 14:08 NilanthAnimosus

We've now made it to the hydrothermal wastes and there it only seems to happen when the next level loading in is an outpost level type. Now I'm not even sure if it was like that all the time or if it also disconnected on LocationConnection level types in the great sea. If it was, it might have to do with the larger level size due to DynamicEuropa. It also increases the amount of NPCs per station so that probably contributes to the problem, especially with a lot of mods that may add equipment with status effects I assume.

UnhappyWithMyUsername avatar Aug 08 '23 21:08 UnhappyWithMyUsername

I actually happen to use a similar modlist and this happens regularly, it didn't happen at the start of the campaign so might be the increasing ammount of items, but we are still fairly early in progress, tried disabling mods to no avail, using the vanilla server executable instead of lua, etc. I tried to trace a bit in what process does the server "freeze" or struggle to load for those few seconds that goes timeout (only goes timeout for other players if you are hosting) and the console doesn't show much, debugging with verbose log on I have these two frames, exactly before the freeze and right after the freeze. image image The exact thing that happens right after the freeze is the Campaign Update (Misc). It's hard to test but sometimes the freeze is bigger and others it doesn't even reach timeout. There was a time it took literally 12 seconds to end the freeze and start the loading screen.

This also pops in the server log :

[08/11/2023 17:32:20] BRSaura docked FDF-Vortex to Drizzlecomb Linea Habitation Outpost [08/11/2023 17:32:29] Ending the round... at System.Environment.get_StackTrace() at Barotrauma.Networking.GameServer.EndGame(TransitionType transitionType, Boolean wasSaved) in <DEV>/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs:line 2705 at Barotrauma.MultiPlayerCampaign.DoLevelTransition(TransitionType transitionType, LevelData newLevel, Submarine leavingSub, Boolean mirror, List`1 traitorResults)+MoveNext() in <DEV>/Barotrauma/BarotraumaServer/ServerSource/GameSession/GameModes/MultiPlayerCampaign.cs:line 390 at Barotrauma.CoroutineManager.PerformCoroutineStep(CoroutineHandle handle) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 198 at Barotrauma.CoroutineManager.IsDone(CoroutineHandle handle) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 229 at Barotrauma.CoroutineManager.Update(Boolean paused, Single deltaTime) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 272 at Barotrauma.GameMain.Run() in <DEV>/Barotrauma/BarotraumaServer/ServerSource/GameMain.cs:line 355 at Barotrauma.Program.Main(String[] args) in <DEV>/Barotrauma/BarotraumaServer/ServerSource/Program.cs:line 82 [08/11/2023 17:32:30] Round ended.

In the meanwhile, is there any way to increase the timeout of a client? maybe some config? the freeze doesn't annoy me, its the disconnect for my friend that goes after.

Edit: I've actually tried disabling 95% of mods, that freeze still happens but with a lot smaller margin, not enough to disconnect someone, don't know if its a mod conflict or items that got removed because the mod got removed so there's less load, but it still happens. If there was a more reliable way to see the load process and time cost for debugging....

BRSaura avatar Aug 11 '23 15:08 BRSaura

Same thing happens to me and friend, we played campaign for some time, and then it starts to happen. When we dock sub, I get disconnected and then we have to go back to lobby and load again.. It doesn't hepppend all the time but its annoying. We dont run any mods, I play on Win 11, and he is on Win 10. He is hosting it on fiber optics inet with mid range cpu/gpu, and im using DSL 25/2 Mb connection with better specs. As soon as i hit dock, it gets P2P Disconnect. I guess server needs to wait a bit longer for everyone is my guess. I always load faster than my host friend. (like 5-8 seconds faster), maybe that's is culprit of the problem.

quasarix avatar Feb 04 '24 13:02 quasarix

Same happens to my friends.

We have entered 3rd location when it has started to happen.

My save file has about 500kb and my friends have a pretty good PC and internet connection, so I don't think that it happens because of too much items on the ship.

I have also noticed that before I dock to something I have a delay for about 10 seconds. During that delay I can control sub movement, run in the ship without significant issues for FPS, but players of my server are not moving at all. When delay is finished I see that all my players have been disconnected from the server (for half second). After that I see a loading screen.

Also some of my friends are having a hard time to connect to my server due to "time out" error.

What I know for sure, that before this delay got much worser - I have installed a few mods: https://steamcommunity.com/sharedfiles/filedetails/?id=3153737715 https://steamcommunity.com/sharedfiles/filedetails/?id=3020618603 https://steamcommunity.com/workshop/filedetails/?id=2902324647

Here is a full list of enabled mods:

<?xml version="1.0" encoding="utf-8"?> <mods name="Хардкорний реалізм"> <Vanilla /> <Workshop name="NEEDS - NT Compatibility" id="2930788862" /> <Workshop name="Neurotrauma" id="2776270649" /> <Workshop name="BetterHealthUI" id="2807158602" /> <Workshop name="Neurotrauma in-game guide" id="2958760493" /> <Workshop name="NEEDS" id="2929084649" /> <Workshop name="Hungry Europans - Enforced Extras" id="3029684523" /> <Workshop name="Hungry Europans - Enforced" id="3018201543" /> <Workshop name="Hungry Europans" id="2954998725" /> <Workshop name="Material IO" id="2850153096" /> <Workshop name="Wifi Camera" id="3020618603" /> <Workshop name="Immersive Ammunition Boxes" id="3089776991" /> <Workshop name="Barotraumatic Headsets No Battery Required" id="2916667333" /> <Workshop name="BaroTraumatic" id="2518816103" /> <Workshop name="Barotraumatic Creature Pack" id="2831987252" /> <Workshop name="EuropaWar" id="2902324647" /> <Workshop name="Acolyte Improved Husks Patch" id="2902682308" /> <Workshop name="Improved Husks" id="2085783214" /> <Workshop name="Modular Backpack" id="2964144541" /> <Workshop name="Real Sonar" id="2936760984" /> <Workshop name="Beacons Extended" id="2389600483" /> <Workshop name="Shipwrecks Extended" id="2095211492" /> <Workshop name="New Wrecks For Barotrauma (With sellable wrecks)" id="2184257427" /> <Workshop name="DynamicEuropa - Default Level Size Patch" id="2927140188" /> <Workshop name="DynamicEuropa - Default Map Size Patch" id="3054939568" /> <Workshop name="DynamicEuropa" id="2532991202" /> <Workshop name="Vanilla Weapons Overhaul (Draconis)" id="2954637344" /> <Workshop name="Stronger NPC 装备更好更加强大的NPC" id="2662664721" /> <Workshop name="Renegade Job for Captain" id="3160881814" /> <Workshop name="Renegade Job" id="2951046791" /> <Workshop name="Scavenger Job" id="2921079225" /> <Workshop name="Technician Job" id="3005601677" /> <Workshop name="Acolyte Job" id="2870519815" /> <Workshop name="The Diver Job" id="2920304251" /> <Workshop name="Zenith's Sunken Tapes (No Afflictions)" id="2918966067" /> <Workshop name="Lua Linker" id="2852315967" /> <Workshop name="Dont Open Debug Console On Errors" id="2807566753" /> <Workshop name="Performance Fix" id="2701251094" /> <Workshop name="Soundproof Walls" id="3153737715" /> <Workshop name="Movable and Sellable Wrecks" id="2772926011" /> <Workshop name="Sellable Pirates" id="2810462005" /> <Workshop name="BetterFabricatorUI" id="2811300302" /> <Workshop name="Let Them All In" id="2805065898" /> <Workshop name="Complete Global Darkness" id="2874526487" /> <Workshop name="CsForBarotrauma" id="2795927223" /> <Workshop name="Lua For Barotrauma" id="2559634234" /> <Workshop name="Українська локалізація Ukrainian localization" id="2828450028" /> <Workshop name="[DS] Sea Thorn - NEEDS" id="3159485561" /> </mods>

I will try disabling part of them, If I will find something - I will let everyone know.

azuma-sv avatar Feb 19 '24 06:02 azuma-sv

Any plans to let host increase time out time? It's becoming an annoying problem and I may have patience for it, but my friends don't.

Ksarper avatar Mar 17 '24 07:03 Ksarper

Getting the same issue here with a heavily modded game. I am also curious if a longer steam peer to peer timeout would fix the issue. Also worth noting, our submarine has over 8k items onboard (and that number keeps going up) with a save file almost 1mb in size

Current Modlist

<Workshop name="Lua For Barotrauma" id="2559634234"/>
<Workshop name="ExtraXP" id="2962582697"/>
<Workshop name="Meaningful Upgrades" id="2183524355"/>
<Workshop name="BetterFabricatorUI" id="2811300302"/>
<Workshop name="BetterHealthUI (Updated)" id="3231293294"/>
<Workshop name="Neurotrauma" id="3190189044"/>
<Workshop name="NT Pharmacy" id="2804655816"/>
<Workshop name="New Wrecks For Barotrauma (With sellable wrecks)" id="2184257427"/>
<Workshop name="Movable and Sellable Wrecks" id="2772926011"/>
<Workshop name="Sellable Pirates" id="2810462005"/>
<Workshop name="Beacons Extended" id="2389600483"/>
<Workshop name="Shipwrecks Extended" id="2095211492"/>
<Workshop name="ADV Beacon Stations" id="2544952900"/>
<Workshop name="EK Utilities 重製版" id="3008781099"/>
<Workshop name="EK Dockyard 重製版" id="3012187347"/>
<Workshop name="EK Armory 重製版" id="2995424153"/>
<Workshop name="EK Gunnery 重製版" id="3000949045"/>
<Workshop name="Improved Husks" id="2085783214"/>
<Workshop name="OASIS Mod" id="2774758382"/>
<Workshop name="[LF] More Ammunition (Balance)" id="3014639348"/>
<Workshop name="Enhanced Armaments Neurotrauma Patch" id="2807556435"/>
<Workshop name="Enhanced Armaments" id="2764968387"/>
<Workshop name="BaroTraumatic" id="2518816103"/>
<Workshop name="Barotraumatic Creature Pack" id="2831987252"/>
<Workshop name="Duffle Bag 2.0, Backpack & WaistBelt" id="2251324465"/>
<Workshop name="All The Talent Trees + Unlock Parallel Talents" id="2913302583"/>
<Workshop name="oClockRadar_Alt" id="2651492771"/>
<Workshop name="EK_Berith_Mk-II" id="2636444311"/>
<Workshop name="[VH] The Iroh" id="2602920829"/>
<Workshop name="Beaumaris" id="2902314099"/>
<Workshop name="Vanguard" id="3001614597"/>
<Workshop name="EK_Kira_Mk-II" id="2519724605"/>
<Workshop name="The Stoick" id="2256692784"/>
<Workshop name="K-07 Kasatka Mk II" id="2892213958"/>
<Workshop name="Kasserine" id="2902312635"/>
<Workshop name="Citrinitas" id="2961017610"/>
<Workshop name="Privateer" id="2946159217"/>
<Workshop name="Dugong Ultimate" id="2970679991"/>
<Workshop name="The Pilgrim" id="2985812640"/>
<Workshop name="Malachite" id="2987005010"/>
<Workshop name="More Marks" id="2884015780"/>
<Workshop name="MoreMissionsMod" id="2797298457"/>
<Workshop name="Performance Fix" id="2701251094"/>
<Local name="Mina"/>
<Local name="Arianrhod"/>
<Workshop name="Tumbleing Down" id="3277260303"/>
<Workshop name="Blacksea Armory New Abyss" id="3264902533"/>

I've also got a large ammount of warnings being generated for a ENTITY_POSITION error. An example is chaingunboltshredder and scp_65projectile

AdozenBABYdogs avatar Jun 29 '24 11:06 AdozenBABYdogs

Keep getting this issue on our side as well. Would be great if this could be looked at.

Sozzky avatar Aug 05 '24 13:08 Sozzky