Einstein-Engines icon indicating copy to clipboard operation
Einstein-Engines copied to clipboard

If you mix water and potassium the server goes kaboom

Open AlgumCorrupto opened this issue 9 months ago • 5 comments

Description

Instead of only the reagent container exploding the entire matrix collapses when you mix water and potassium. Kinda ironic to be honest.

Reproduction

  1. Open game
  2. Mix about 30u of water and 30u of potassium in a chem dispenser
  3. Rip server

Expected behavior

  1. Open game
  2. Mix about 30u of water and 30u of potassium in a chem dispenser
  3. Server does not crash

Media

https://youtu.be/KYe9S0niKMA

Additional context

Traceback:

[DEBG] system.proximity_detection: DetectorComponent only supports requireAll = false for tags. All components are required for a match!
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key '1258' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Robust.Client.GameObjects.UserInterfaceSystem.SavePosition(BoundUserInterface bui) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameObjects/EntitySystems/UserInterfaceSystem.cs:line 50
   at Robust.Shared.GameObjects.SharedUserInterfaceSystem.Update(Single frameTime) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs:line 1099
   at Robust.Shared.GameObjects.EntitySystemManager.TickUpdate(Single frameTime, Boolean noPredictions) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Shared/GameObjects/EntitySystemManager.cs:line 306
   at Robust.Shared.GameObjects.EntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Shared/GameObjects/EntityManager.cs:line 273
   at Robust.Client.GameObjects.ClientEntityManager.TickUpdate(Single frameTime, Boolean noPredictions, Histogram histogram) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameObjects/ClientEntityManager.cs:line 216
   at Robust.Client.GameStates.ClientGameStateManager.ApplyGameState() in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameStates/ClientGameStateManager.cs:line 477
   at Robust.Client.GameController.Tick(FrameEventArgs frameEventArgs) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameController/GameController.cs:line 552
   at Robust.Client.GameController.<StartupContinue>b__63_0(Object sender, FrameEventArgs args) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameController/GameController.cs:line 243
   at Robust.Shared.Timing.GameLoop.Run() in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Shared/Timing/GameLoop.cs:line 240
   at Robust.Client.GameController.ContinueStartupAndLoop(DisplayMode mode) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 163
   at Robust.Client.GameController.GameThreadMain(DisplayMode mode) in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 148
   at Robust.Client.GameController.<>c__DisplayClass105_0.<Run>b__0() in /home/paulo/development/Einstein-Engines/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 107

AlgumCorrupto avatar Mar 21 '25 18:03 AlgumCorrupto

potassium bomb has ascended beyond the simulation, it explodes the server instead now

eris-webserv avatar Mar 21 '25 19:03 eris-webserv

I ran a test just now - I presume this issue arises because when you put a beaker into various machines (such as the chem dispenser, the chemmaster, or a reagent grinder), the beaker does not exist (you can test this by destroying the machine that it is contained in - it does not drop). When the explosion goes off, the game attempts to find the container the reaction was stored in, but it doesn't exist, according to the game.

Tirochora avatar Apr 11 '25 15:04 Tirochora

After further experimentation, the issue arises only when the container the beaker is stored in is destroyed. ~My standing theory is that because the beaker contained within is deleted upon the destruction of the reagent dispenser, the mixture of chemicals no longer has anything that it exists inside of, and the game thus throws an error.~ This was incorrect, as the beaker does in fact drop from a destroyed container (though, interestingly, not from the chemmaster.)

Tirochora avatar Apr 11 '25 16:04 Tirochora

If this does in anyway relate to the crash issue we had gibbed skeletons. It would be that some components and actions get automatically removed from Storage Containers Lists mid loop due to how events are handled. In the case of the skeleton gibbing, I hade to make sure that the items in a storage companent was turned into a separate list instance, then looping over them, as well as validating that the target is still valid.

Otherwise you might get mid loop container modification issues. The core issue here looks like it could also be solved with a TryGetValue on the dictionary instead of accessing it straight away with key, and expecting the item to be there. But I haven't confirmed any if this in code, just reminded me of the other issue.

ilmenwe avatar Apr 11 '25 17:04 ilmenwe

This only appears to happen on debug.

Tirochora avatar Apr 11 '25 19:04 Tirochora