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 409 forks source link

Fabricator crash - Function does not accept floating point Not-a-Number values #11817

Closed AdCognitionem closed 1 year ago

AdCognitionem commented 1 year ago

Disclaimers

What happened? Using Fabricator randomly crashes when you use it, if it doesn't crash , then you can play the game normally, and sometimes it depends on the Sub that you're going to use, but eventually when using the same Sub that the Fabricator works on, after a few Stations and missions, it will crash and will keep on crashing, even if you're using the Stations Fabricator.

Reproduction steps

  1. Do some stuff ( prepping before undocking, buy. sell, deconstruct).
  2. Use the fabricator

Bug prevalence Happens for the most part, sometimes it works initially but eventually it will do the same error.

Version v1.0.9.0

Which operating system did you encounter this bug on? Windows

Relevant error messages and crash reports

Barotrauma Client crash report (generated on 04/14/2023 14:35:45)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

BD9A52E22A984D5C04FD9165F629CD07

Game version 1.0.9.0 (ReleaseWindows, branch master, revision 1186719e62)
Graphics mode: 1280x1024 (BorderlessWindowed)
VSync ON
Language: English
Selected content packages: Vanilla, Lua For Barotrauma, Performance Fix, Dont Open Debug Console On Errors, Genes+ Revived and Expanded, BaroTraumatic, Barotraumatic Creature Pack, DynamicEuropa, Improved Husks, EK Mods for 1.x.x.x, Shipwrecks Extended, New Wrecks For Barotrauma (With sellable wrecks), Movable and Sellable Wrecks, Sellable Pirates, Beacons Extended, Meaningful Upgrades, Meaningful CPR, Neurotrauma + Abyss Waifu++, Neurotrauma, Abyss waifu++, Neurotrauma Cybernetics, All The Talent Trees, 32x Stack, First aid kit, Combinable Ammo Revived (NOW WORKS WITH ALL AMMO), Nuclear ammo box, Unlimited Coilgun Ammo Box, Unlimited Chaingun Ammo Box, Unlimited Railgun, Unlimited Fuel Rod, Unlimited Pulse Laser Ammo Box, [Paused] Unlimited Tool, [Paused] Unlimited Gun Ammunition, Unlimited Welding Fuel Tank, Better Exosuit with Platform 外骨骼优化和置物架, Black Sea's Armory(BWeapons), Better Dive Suits, Portable Torpedoes, T.I.T.A.N. Warsuit 3.0: Abyss Watcher, More Unique Weapons (v1.1) [EN/RU], Gatling Laser, Minigun, Backpacks, Super Hmg + Exosuit, Sweet Pea, Dugong Mk2(Extended Hull), Golden mice, Kasserine, RS-1050 'The Charlatan', Enhanced Characters for Neurotrauma, Northumberland, [ACE] Gadus, Explorer, Ulysses 2.37, Riftpiercer X91-B, EK Matriarch Mk-VII, Týr-提尔号[cn][en], Converted Armed Heavy Freighter “Casablanca”, Vengeance Mk. III, [VH] The Stoick, R-29 Hammerhead [1.0 Update], Apo-3A "Dagger", V-1999 Remastered MK.II [BENZIN Corp.], Privateer, Wyvern, [EA-HI]RedComet-血色彗星, [EA-HI]FrozenTilapia-冰冻罗非鱼级[SC][En], Bronze Age, Cast Iron, Shiftless, The Peregrine, Apo-4A "Saber", Wellerman, Super Plague Rat, Zidrom MKVI, EK Kira Mk-V, [VH] The Iroh, DA-漩流级 战列巡洋舰 DA-Maelstrom Class Battlecruiser, “罗盘”级快速反应舰艇 "Compass" class fast picket submarine, Iron Cavalry Prototype Gunship, Amethyst Geode Exotic Warship 紫晶洞级异界战舰, “兰屿”级武装侦查舰 - 第一届蓝海重工造船大赛, Navalon Class Prototype Combat Cruiser 纳瓦隆级试做型战斗巡洋舰, Colonial Fleet SMX-25, Apo-5 "Chainsaw", "Sleipnir" Class Science Submarine, Zyleand Shipyard Flagship “Koka”, Medusa, K-03 Reaper, K-02 Cataphract, K-07 Kasatka Mk II, R-278 «Dugong», K-24 Crocodile Mk II, K-09 Prometheus, "Blue Shift" Class Fast Cruiser, "Cold Star" Class Advanced Scout Ship, Alicorn2 Stealth Light Cruiser, ATK-89 "Sardine"
Level seed: Kury26
Loaded submarine: DA-Maelstrom-EN (A4B9F83EB7263CF310EAB28AAF683B43)
Selected screen: Barotrauma.GameScreen
SteamManager initialized

System info:
    Operating system: Microsoft Windows NT 10.0.19044.0 64 bit
    GPU name: NVIDIA GeForce GTX 1060 3GB
    Display mode: {Width:1280 Height:1024 Format:Color AspectRatio:1.25}
    GPU status: Normal

Exception: Function does not accept floating point Not-a-Number values. (System.ArithmeticException)
Target site: Int32 Sign(Single)
Stack trace: 
   at System.Math.Sign(Single value)
   at Barotrauma.Items.Components.Fabricator.<RefreshAvailableIngredients>g__compare|113_0(Item item1, Item item2, Inventory inputInventory) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Items\Components\Machines\Fabricator.cs:line 788
   at Barotrauma.Items.Components.Fabricator.RefreshAvailableIngredients() in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Items\Components\Machines\Fabricator.cs:line 719
   at Barotrauma.Items.Components.Fabricator.UpdateHUD(Character character, Single deltaTime, Camera cam) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Items\Components\Machines\Fabricator.cs:line 845
   at Barotrauma.Item.UpdateHUD(Camera cam, Character character, Single deltaTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\Items\Item.cs:line 1193
   at Barotrauma.GameScreen.Update(Double deltaTime) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Screens\GameScreen.cs:line 130
   at Barotrauma.GameMain.Update(GameTime gameTime) in <DEV>\Barotrauma\BarotraumaClient\ClientSource\GameMain.cs:line 891
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656
   at Microsoft.Xna.Framework.Game.Tick() in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 93
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397
   at Microsoft.Xna.Framework.Game.Run() in C:\Users\joona\Documents\Barotrauma-development\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:
[04/14/2023 14:35:28] WARNING: Character "Human" has a negative crush depth. Previously the crush depths were defined as display units (e.g. -30000 would correspond to 300 meters below the level), but now they're in meters (e.g. 3000 would correspond to a depth of 3000 meters displayed on the nav terminal). Changing the crush depth from -30000 to 1300.
[04/14/2023 14:35:28] WARNING: Character "Human" has a negative crush depth. Previously the crush depths were defined as display units (e.g. -30000 would correspond to 300 meters below the level), but now they're in meters (e.g. 3000 would correspond to a depth of 3000 meters displayed on the nav terminal). Changing the crush depth from -30000 to 1300.
[04/14/2023 14:35:28] WARNING: Character "Human" has a negative crush depth. Previously the crush depths were defined as display units (e.g. -30000 would correspond to 300 meters below the level), but now they're in meters (e.g. 3000 would correspond to a depth of 3000 meters displayed on the nav terminal). Changing the crush depth from -30000 to 1300.
[04/14/2023 14:35:25] 
/// Running Neurotrauma V A1.8.4h2 ///
--------------------------------------------
+ Cybernetics V A1.2.3h3
Regalis11 commented 1 year ago

Thank you for the report!

The error message seems to suggest there were items with their condition set to NaN in the input slots. I'm not sure how an item's condition can be NaN - looking through the code, there should be checks in place that prevent the condition from being set to NaN in every possible place that could happen. But seeing that this is from a heavily modded game (including code modifications), maybe it could be some mod's causing this?

Do you have any recollection what kind of items might've been in the input slots of the fabricator when this occurred?

Regalis11 commented 1 year ago

Added a check that should prevent crashing if there's items with NaN condition in the input slots: https://github.com/Regalis11/Barotrauma-development/commit/bac25a1e4dfcce18c533a2ecd3655898f321ae60 (commit in our private repo). Doesn't fix the underlying issue of the condition being set to NaN.

AdCognitionem commented 1 year ago

Thank you so much! for the quick response, and also for the confirmation.

I had a sneaking suspicion that it's one of the item mods I have added, it's probably gonna be just a process of elimination for me to figure this out, as for the recollection, that's the thing, there is nothing on the fabricator, or maybe at the least nothing directly in the fabricator, its probably on what's in the storage connected to the fab, but I'm also not sure, because whenever I start a new game just to test things out, I immediately go for the fabricator to see if it'll crash the game immediately, because if doesn't, it will eventually , Then I'll have to start a new game to test things again. I don't mind doing this because I love the game.

Again thank you so much, and sorry for the inconvenience.

Jasontti commented 1 year ago

Tested with Unlimited Fuel Rod mod and found no more issues. Closing ticket.

pavel4win commented 1 year ago

I have got same Exception

crashreport (23).log