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.67k stars 394 forks source link

Game Crash due to overlapping hulls and walls, likely caused by gap generation. SectionIsLeakingFromOutside #13983

Closed itchyOwl closed 1 month ago

itchyOwl commented 1 month ago

Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/13952

Originally posted by **FatherSarge** May 11, 2024 ### 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? The game will crash (crash report provided) when a certain area of the hull/wall is interacted with. As far as I can tell this only happens on this version of the sub (provided) from a campaign save file. I am currently unable to understand the production steps for this bug but I do not think you need them. Essentially it appears to be some kind of error in the way gap generation is handled when hulls and walls overlap and then are damaged. You can see this if you load the sub and try to weld or plasma cut the indicated area. If this overlap is removed (from this exact sub) the error will no longer occur. I believe, while rare, this is unintended behavior and a bug within the way gaps and sub flooding are handled. Please understand, while this happened on a sub that was a part of a modded playthrough, the issue persists when all mods are removed and is happening to the standard vanilla sub parts. I have provided the sub as is (with weld point indicated) for you to check. You do not need to be running any mods to load the sub and experience the bug. ### Reproduction steps 1. Load the provided sub into the sub editor (you may ignore the mods, the sub will be functionally broken but you will be able to see the bug) 2. Test the sub, attempt to weld or plasma cut the indicated area. Might take a second of raking the tool around the corner but you will see a wall piece with around half health, weld this long enough (half a second) and the game will crash. This is the overlapped piece that is causing the issue. The Sub [EBS Chimera BUGGED.zip](https://github.com/FakeFishGames/Barotrauma/files/15284020/EBS.Chimera.BUGGED.zip) SP Crash reported (with mods active, but not the cause) [crashreport (12).log](https://github.com/FakeFishGames/Barotrauma/files/15284022/crashreport.12.log) Server (client hosted) Crash Report, no mods (as proof) [servercrashreport (10).log](https://github.com/FakeFishGames/Barotrauma/files/15284027/servercrashreport.10.log) ### Bug prevalence Happens every time I play ### Single player or multiplayer? Happens in both single player and multiplayer ### - _No response_ ### Version v1.4.6.0 (Blood in the Water Update, hotfix 2) ### - _No response_ ### Which operating system did you encounter this bug on? Windows ### Relevant error messages and crash reports ```shell Please see attached reports for additional details, here is the server crash report: Barotrauma Dedicated Server crash report (generated on 05/11/2024 12:16:15) Barotrauma seems to have crashed. Sorry for the inconvenience! Game version 1.4.6.0 (ReleaseWindows, branch release/spring-update-hotfix-2, revision 3513066f44) Language: English Selected content packages: Vanilla (329B29B), EBS Chimera Final (7D46ACB), Lua For Barotrauma (BBB172E) Level seed: Paaru162Kermario Fossa175 Loaded submarine: EBS Chimera (016BA24989C6CC15DD6C2A36EEAA3DCA) Selected screen: Barotrauma.GameScreen Server (Round had started) System info: Operating system: Microsoft Windows NT 10.0.22631.0 64 bit Exception: Object reference not set to an instance of an object. (System.NullReferenceException) Target site: Boolean SectionIsLeakingFromOutside(Int32) Stack trace: at Barotrauma.Structure.SectionIsLeakingFromOutside(Int32 sectionIndex) in \Barotrauma\BarotraumaShared\SharedSource\Map\Structure.cs:line 930 at Barotrauma.Items.Components.RepairTool.FixBody(Character user, Vector2 hitPosition, Single deltaTime, Single degreeOfSuccess, Body targetBody) in \Barotrauma\BarotraumaShared\SharedSource\Items\Components\Holdable\RepairTool.cs:line 571 at Barotrauma.Items.Components.RepairTool.Repair(Vector2 rayStart, Vector2 rayEnd, Single deltaTime, Character user, Single degreeOfSuccess, List`1 ignoredBodies) in \Barotrauma\BarotraumaShared\SharedSource\Items\Components\Holdable\RepairTool.cs:line 416 at Barotrauma.Items.Components.RepairTool.Use(Single deltaTime, Character character) in \Barotrauma\BarotraumaShared\SharedSource\Items\Components\Holdable\RepairTool.cs:line 308 at Barotrauma.Item.Use(Single deltaTime, Character user, Limb targetLimb, Entity useTarget, Character userForOnUsedEvent) in \Barotrauma\BarotraumaShared\SharedSource\Items\Item.cs:line 3165 at Barotrauma.Character.g__tryUseItem|513_1(Item item, Single deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Characters\Character.cs:line 2334 at Barotrauma.Character.Control(Single deltaTime, Camera cam) in \Barotrauma\BarotraumaShared\SharedSource\Characters\Character.cs:line 2296 at Barotrauma.Character.Update(Single deltaTime, Camera cam) in \Barotrauma\BarotraumaShared\SharedSource\Characters\Character.cs:line 3454 at Barotrauma.Character.UpdateAll(Single deltaTime, Camera cam) in \Barotrauma\BarotraumaShared\SharedSource\Characters\Character.cs:line 3221 at Barotrauma.GameScreen.Update(Double deltaTime) in \Barotrauma\BarotraumaShared\SharedSource\Screens\GameScreen.cs:line 188 at Barotrauma.GameMain.Run() in \Barotrauma\BarotraumaServer\ServerSource\GameMain.cs:line 332 at Barotrauma.Program.Main(String[] args) in \Barotrauma\BarotraumaServer\ServerSource\Program.cs:line 85 Last debug messages: 05/11/2024 12:16:15 - [05/11/2024 12:16:15] Saving banlist 05/11/2024 12:16:15 - [05/11/2024 12:16:15] Jared Stalvey: Julius Fettuccini's injuries are so minor I don't think I should waste any meds on them. 05/11/2024 12:16:15 - [05/11/2024 12:16:15] Julius Fettuccini: Stop messing around! 05/11/2024 12:16:15 - [05/11/2024 12:16:15] Phoenix Cluck equipped Screwdriver 05/11/2024 12:16:14 - [05/11/2024 12:16:14] Omari Lowe equipped SMG 05/11/2024 12:16:14 - [05/11/2024 12:16:14] Jared Stalvey equipped Screwdriver 05/11/2024 12:16:12 - [05/11/2024 12:16:12] Omari Lowe equipped SMG 05/11/2024 12:16:12 - [05/11/2024 12:16:12] Jared Stalvey equipped Wrench 05/11/2024 12:16:10 - [05/11/2024 12:16:10] Jared Stalvey equipped Flashlight 05/11/2024 12:16:10 - [05/11/2024 12:16:10] Tory Donovan equipped Red Wire 05/11/2024 12:16:09 - [05/11/2024 12:16:09] Omari Lowe equipped SMG 05/11/2024 12:16:09 - [05/11/2024 12:16:09] Omari Lowe: Got to find an extinguisher! 05/11/2024 12:16:07 - [05/11/2024 12:16:07] Jared Stalvey equipped Chloral Hydrate 05/11/2024 12:16:05 - [05/11/2024 12:16:05] FatherSarge equipped Welding Tool ```
Rokvach commented 1 month ago

Tested, working correctly. Can be merged and closed.