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.77k stars 408 forks source link

Level editor crashes when generating any outpost #12777

Closed Jasontti closed 1 year ago

Jasontti commented 1 year ago

Disclaimers

What happened?

Game crashes when trying to generate any outpost level in unstable 1.1.15.0 on steam or latest dev build https://github.com/Regalis11/Barotrauma-development/commit/f9a2b1b73b67aad27524bbd15e2ba63879e29574, same version at this point.

This must have been something really recent as when i first heard of this 2 days ago and tested it quickly in traitor-update that was slightly out of date it didn't happen, after updating crash is certain.

Reproduction steps

  1. Open leveleditor
  2. Generate any outpost level, i used coldcavernsoutpost

Bug prevalence

Happens regularly

Single player or multiplayer?

Other, level editor

Version

Unstable 1.1.15.0

Which operating system did you encounter this bug on?

Windows/Linux

Relevant error messages and crash reports

Barotrauma Client crash report (generated on 10/07/2023 23:44:46)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

5D7C412BD9EA949A3922D249EDBA18B2

Game version 1.1.15.0 (ReleaseLinux, branch release/traitor-update, revision f9a2b1b73b)
Graphics mode: 1680x1050 (BorderlessWindowed)
VSync OFF
Language: English
Selected content packages: Vanilla (56DF2A0), Flare Gun (033535F), Saber Armaments (E618472), mg_ray (74E1596)
Level seed: E2LAFXKB
Loaded submarine: None
Selected screen: Barotrauma.LevelEditorScreen
SteamManager initialized

System info:
    Operating system: Unix 5.10.0.25 64 bit
    GPU name: 
    Display mode: {Width:1680 Height:1050 Format:Color AspectRatio:1.6}
    GPU status: Normal

Exception: Object reference not set to an instance of an object. (System.NullReferenceException)
Target site: Void Generate(Boolean, Barotrauma.Location, Barotrauma.Location)
Stack trace: 
   at Barotrauma.Level.Generate(Boolean mirror, Location startLocation, Location endLocation) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Map\Levels\Level.cs:line 1375
   at Barotrauma.Level.Generate(LevelData levelData, Boolean mirror, Location startLocation, Location endLocation, SubmarineInfo startOutpost, SubmarineInfo endOutpost) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Map\Levels\Level.cs:line 485
   at Barotrauma.LevelEditorScreen.<.ctor>b__26_12(GUIButton btn, Object obj) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Screens\LevelEditorScreen.cs:line 211
   at Barotrauma.GUIButton.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUIButton.cs:line 263
   at Barotrauma.GUI.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GUI\GUI.cs:line 1193
   at Barotrauma.GameMain.Update(GameTime gameTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 876
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656
   at Microsoft.Xna.Framework.Game.Tick() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397
   at Microsoft.Xna.Framework.Game.Run() in <DEV>\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367
   at Barotrauma.Program.Main(String[] args) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Program.cs:line 58

Last debug messages:
[10/07/2023 23:44:41] Generating an outpost for the start of the level... (Location: Kury City, level type: Outpost)
[10/07/2023 23:44:41] Level identifier: coldcavernsoutpost
[10/07/2023 23:44:35] leveleditor

Stack trace from dev build:
Level identifier: coldcavernsoutpost
Generating an outpost for the start of the level... (Location: Sontu Mine, level type: Outpost)
Level resources spawned: 0
   Spawn points containing resources: 0 (0.00 %)
   Total value: 0 mk
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Barotrauma.Level.Generate(Boolean mirror, Location startLocation, Location endLocation) in /dev/Barotrauma-development/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs:line 1382
   at Barotrauma.Level.Generate(LevelData levelData, Boolean mirror, Location startLocation, Location endLocation, SubmarineInfo startOutpost, SubmarineInfo endOutpost) in /dev/Barotrauma-development/Barotrauma/BarotraumaShared/SharedSource/Map/Levels/Level.cs:line 490
   at Barotrauma.LevelEditorScreen.<.ctor>b__26_12(GUIButton btn, Object obj) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/Screens/LevelEditorScreen.cs:line 223
   at Barotrauma.GUIButton.Update(Single deltaTime) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/GUI/GUIButton.cs:line 263
   at Barotrauma.GUIComponent.UpdateAuto(Single deltaTime) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/GUI/GUIComponent.cs:line 455
   at Barotrauma.GUI.Update(Single deltaTime) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/GUI/GUI.cs:line 1244
   at Barotrauma.GameMain.Update(GameTime gameTime) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs:line 876
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in /dev/Barotrauma-development/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 651
   at Microsoft.Xna.Framework.Game.Tick() in /dev/Barotrauma-development/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 500
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in /dev/Barotrauma-development/Libraries/MonoGame.Framework/Src/MonoGame.Framework/SDL/SDLGamePlatform.cs:line 94
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in /dev/Barotrauma-development/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 397
   at Microsoft.Xna.Framework.Game.Run() in /dev/Barotrauma-development/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 367
   at Barotrauma.Program.Main(String[] args) in /dev/Barotrauma-development/Barotrauma/BarotraumaClient/ClientSource/Program.cs:line 58
Jasontti commented 1 year ago

Narrowed it down to this: https://github.com/Regalis11/Barotrauma-development/commit/927b0d57b4ced7007ce2c8bb2111ada81ecb33b9

Regalis11 commented 1 year ago

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/1bdad5950bda108b51afb178289e6f2d566b1544

Jasontti commented 1 year ago

Tested.

Generated different levels in editor. Tested basic and roles tutorial. Loaded a save game.

No issues found. Closing ticket.