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.73k stars 402 forks source link

Submarine editor - When deleting loose end cables in "wiring mode", game crashes #3979

Closed BurmistrovJ closed 3 years ago

BurmistrovJ commented 3 years ago

Description Submarine editor - When deleting loose end cables in "wiring mode", game crashes

Steps To Reproduce When i build submarine, i somehow have got a loose ends for some wires, it happened after you delete an item that had wired connection, its loose ends just out there and not attached to anything. When i try to delete one, the steps:

  1. I click on loose end wire 2.Double click on its last end that is not loose to extend it 3.I open any item that this wire can be attached 4.In opened item i just left-click mouse drag drop the wire out of window (by default it must delete the wire) 5.I got error and game crashes

Version Windows 10 Pro x64 - Baratrauma v 0.10.5.1

Additional information Barotrauma Client crash report (generated on 10/2/2020 2:07:20 AM)

Barotrauma seems to have crashed. Sorry for the inconvenience!

6F558E05A9FD96EA104348A23A5B582A

Game version 0.10.5.1 (ReleaseWindows, branch release, revision 9e259b2148) Graphics mode: 1920x1080 (BorderlessWindowed) VSync ON Language: English Selected content packages: Vanilla 0.9, Shipwrecks Extended, Colonial Marines, ALIEN - XENOMORPH Level seed: no level loaded Loaded submarine: Firefly_v2 (E6118B70339294BFC0EB55A3924CE3AC) Selected screen: Barotrauma.SubEditorScreen SteamManager initialized

System info: Operating system: Microsoft Windows NT 10.0.17763.0 64 bit GPU name: Intel(R) UHD Graphics 630 Display mode: {Width:1920 Height:1080 Format:Color AspectRatio:1.7777778} GPU status: Normal

Exception: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') (System.ArgumentOutOfRangeException) Target site: Void ThrowArgumentOutOfRange_IndexException() Stack trace: at Barotrauma.Items.Components.Wire.UpdateEditing(List`1 wires) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Items\Components\Signal\Wire.cs:line 288 at Barotrauma.SubEditorScreen.Update(Double deltaTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Screens\SubEditorScreen.cs:line 3900 at Barotrauma.GameMain.Update(GameTime gameTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 921 at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656 at Microsoft.Xna.Framework.Game.Tick() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 504 at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 94 at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 398 at Microsoft.Xna.Framework.Game.Run() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 368 at Barotrauma.Program.Main(String[] args) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 59

Last debug messages: [10/2/2020 1:18:44 AM] Saving the preview image of the submarine "Firefly_v2" failed. {Object reference not set to an instance of an object.} at Microsoft.Xna.Framework.Graphics.Texture2D.PlatformGetData[T](Int32 level, Int32 arraySlice, Rectangle rect, T[] data, Int32 startIndex, Int32 elementCount) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.DirectX.cs:line 145 at Microsoft.Xna.Framework.Graphics.Texture2D.GetData[T](Int32 level, Int32 arraySlice, Nullable1 rect, T[] data, Int32 startIndex, Int32 elementCount) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 223 at Microsoft.Xna.Framework.Graphics.Texture2D.GetData[T](Int32 level, Nullable1 rect, T[] data, Int32 startIndex, Int32 elementCount) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 239 at Microsoft.Xna.Framework.Graphics.Texture2D.GetData[T](T[] data) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 267 at MonoGame.Utilities.Png.PngWriter.GetColorData(Texture2D texture2D) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Utilities\Png\PngWriter.cs:line 230 at MonoGame.Utilities.Png.PngWriter.Write(Texture2D texture2D, Stream outputStream) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Utilities\Png\PngWriter.cs:line 36 at Barotrauma.SubEditorScreen.SaveSubToFile(String name, String specialSavePath) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Screens\SubEditorScreen.cs:line 1528 [10/2/2020 0:54:44 AM] Loading sprite "Content\Items\Shipwrecks/TurretsWrecked.png" failed, retrying in 250 ms... [10/1/2020 21:41:52 PM] Loading sprite "Mods\Colonial Marines\Items\Weapons/uscmweapons.png" failed, retrying in 250 ms... [10/1/2020 21:31:52 PM] (Msg) RelayNetWorkStatus: avail=OK config=OK anyrelay=OK (OK) [10/1/2020 21:31:52 PM] (Msg) Ping location: vie=25+2,sto2=30+3,sto=57+5/30+3,waw=51+5/36+2,fra=82+8/37+2,ams=38+3,lux=39+3,par=42+4,lhr=45+4/43+3,iad=143+14/118+4,sgp=217+21/204+15,gru=242+24/262+4 [10/1/2020 21:31:52 PM] (Msg) Ping measurement completed [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Vanguard_Wrecked.sub, size: 1x1) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/U-1_Wrecked.sub, size: 12x7) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Surveyor_Wrecked.sub, size: 12x7) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Nerka_Wrecked1.sub, size: 1x1) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Likho_Wrecked.sub, size: 1x1) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Egg_wrecked.sub, size: 12x7) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Drifter_Wrecked.sub, size: 1x1) [10/1/2020 21:31:51 PM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Mods/Shipwrecks Extended/Wrecks/Carina_Wrecked1.sub, size: 1x1) [10/1/2020 21:31:50 PM] (Verbose) Communications with routing cluster 'ord' established. [10/1/2020 21:31:50 PM] (Debug) Destroying relay 'ord#111 (162.254.193.73:27041)' because initial_ping_timeout [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'syd' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'tyo' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'tyo1' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'sgp' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'scl' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'sea' established. [10/1/2020 21:31:48 PM] (Verbose) Communications with routing cluster 'lim' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'maa' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'lax' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'sto' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'gru' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'waw' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'okc' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'sto2' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'vie' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'hkg' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'jnb' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'eat' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'mad' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'dxb' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'bom' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'iad' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'lhr' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'par' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'lux' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'atl' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'fra' established. [10/1/2020 21:31:47 PM] (Verbose) Communications with routing cluster 'ams' established. [10/1/2020 21:31:47 PM] (Msg) RelayNetWorkStatus: avail=Attempting config=OK anyrelay=Attempting (Performing ping measurement) [10/1/2020 21:31:47 PM] (Msg) Performing ping measurement [10/1/2020 21:31:47 PM] (Msg) Got SDR network config. Loaded revision 281 OK [10/1/2020 21:31:47 PM] (Warning) SDR network config fetch first attempt failed. HTTP 504. . Trying again. [10/1/2020 21:31:39 PM] Attempting to open ALC device "OpenAL Soft on Speakers (High Definition Audio Device)" [10/1/2020 21:31:38 PM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean [10/1/2020 21:31:37 PM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean [10/1/2020 21:31:36 PM] Logged in as vdvjekanavi39 (SteamID STEAM_1:1:484199588)

Regalis11 commented 3 years ago

I'm afraid I wasn't able to reproduce this, but I may have misunderstood the steps to reproduce this:

2.Double click on its last end that is not loose to extend it

Double-clicking on the end of the wire puts it in the character's inventory, is that what you mean by extending it?

4.In opened item i just left-click mouse drag drop the wire out of window (by default it must delete the wire)

By this you mean you dragged the wire out of the wiring interface and dropped it? This should not delete the wire, just drop it on the position of the cursor, is that not what happens at your end?

BurmistrovJ commented 3 years ago

In submarine editor. I reproduced the following steps. 1.Created a "Periscope(Legacy)" 2.Created a "Camera" 3.Connected one blue wire from camera to periscope "Control IN" 4.Connected one blue wire from camera to periscope "Trigger IN" 5.Deleted the camera 6.Created the camera(Legacy) 7.Double-click on first loose ended cable and connected the wire to new "camera(legacy)" 8.Double-click on second loose ended cable and connected the wire to new "camera(legacy)" 9.Game crashed.

Following debug code:

Barotrauma Client crash report (generated on 10/10/2020 8:50:33 AM)

Barotrauma seems to have crashed. Sorry for the inconvenience!

6F558E05A9FD96EA104348A23A5B582A

Game version 0.10.5.1 (ReleaseWindows, branch release, revision 9e259b2148) Graphics mode: 1920x1080 (BorderlessWindowed) VSync ON Language: English Selected content packages: Vanilla 0.9 Level seed: no level loaded Loaded submarine: Firefly_v3 (42E7B396AEA16267A8F431797EC23C56) Selected screen: Barotrauma.SubEditorScreen SteamManager initialized

System info: Operating system: Microsoft Windows NT 10.0.17763.0 64 bit GPU name: Intel(R) UHD Graphics 630 Display mode: {Width:1920 Height:1080 Format:Color AspectRatio:1.7777778} GPU status: Normal

Exception: Nullable object must have a value. (System.InvalidOperationException) Target site: Void ThrowInvalidOperationException_InvalidOperation_NoValue() Stack trace: at Barotrauma.Items.Components.Wire.UpdateEditing(List`1 wires) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Items\Components\Signal\Wire.cs:line 345 at Barotrauma.SubEditorScreen.Update(Double deltaTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Screens\SubEditorScreen.cs:line 3900 at Barotrauma.GameMain.Update(GameTime gameTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 921 at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656 at Microsoft.Xna.Framework.Game.Tick() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 504 at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 94 at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 398 at Microsoft.Xna.Framework.Game.Run() in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 368 at Barotrauma.Program.Main(String[] args) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 59

Last debug messages: [10/10/2020 8:29:19 AM] (Msg) RelayNetWorkStatus: avail=OK config=OK anyrelay=OK (OK) [10/10/2020 8:29:19 AM] (Msg) Ping location: vie=25+2,ams=32+3,waw=46+4/36+2,fra=79+7/36+2,lhr=44+4/37+3,lux=43+4/40+2,par=40+4,sto=49+4,sto2=49+4,iad=123+12/116+4,sgp=215+21/204+14,gru=260+26/260+4 [10/10/2020 8:29:19 AM] (Msg) Ping measurement completed [10/10/2020 8:29:17 AM] WARNING: Cannot compress a texture because the dimensions are not a multiple of 4 (path: Submarines/Downloaded/Indra.sub, size: 700x313) [10/10/2020 8:29:17 AM] (Verbose) Communications with routing cluster 'atl' established. [10/10/2020 8:29:17 AM] (Debug) Destroying relay 'atl#17 (162.254.199.170:27031)' because initial_ping_timeout [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'syd' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'tyo' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'tyo1' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'sgp' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'sea' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'scl' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'lim' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'maa' established. [10/10/2020 8:29:15 AM] (Verbose) Communications with routing cluster 'lax' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'gru' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'sto' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'sto2' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'okc' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'waw' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'ord' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'vie' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'hkg' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'jnb' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'eat' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'mad' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'dxb' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'bom' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'lhr' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'lux' established. [10/10/2020 8:29:14 AM] (Msg) Relay par#107 (185.25.182.67:27067) is going offline in 583 seconds [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'par' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'iad' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'fra' established. [10/10/2020 8:29:14 AM] (Verbose) Communications with routing cluster 'ams' established. [10/10/2020 8:29:14 AM] (Msg) RelayNetWorkStatus: avail=Attempting config=OK anyrelay=Attempting (Performing ping measurement) [10/10/2020 8:29:14 AM] (Msg) Performing ping measurement [10/10/2020 8:29:14 AM] (Msg) Got SDR network config. Loaded revision 282 OK [10/10/2020 8:29:14 AM] (Warning) SDR network config fetch first attempt failed. HTTP 504. . Trying again. [10/10/2020 8:29:06 AM] Attempting to open ALC device "OpenAL Soft on Speakers (High Definition Audio Device)" [10/10/2020 8:29:05 AM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean [10/10/2020 8:29:04 AM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean [10/10/2020 8:29:04 AM] Logged in as vdvjekanavi39 (SteamID STEAM_1:1:484199588)

BaratraumaCrash_RewiringExistingWires

Regalis11 commented 3 years ago

Thank you for the extra steps, but I'm afraid I still couldn't reproduce this.

These steps are a little unclear: the periscope has no "control_in" or "trigger_in" connections, I assume you mean "position_out" and "trigger_out"? I tried those, and doing the connection the other way around (from the periscope to the camera) but still couldn't get the game to crash. 3.Connected one blue wire from camera to periscope "Control IN" 4.Connected one blue wire from camera to periscope "Trigger IN"

But in any case, this new crash report gave some more info on where exactly the crash is happening, and I added an extra check there that should prevent this from crashing the game when it occurs. https://github.com/Regalis11/Barotrauma-development/commit/41a805b6ed4331f7e956585bb388196eb46652d5

Moving to testing

Rokvach commented 3 years ago

Working properly, closing