Ostranauts

Ostranauts

 This topic has been pinned, so it's probably important
Blue Bottle Games, LLC  [developer] Jul 27, 2023 @ 10:26pm
3
Debug Tools for Pruning NPCs and Respawning Stations
Hey Folks!

Since a number of players had their saves affected by excess NPCs and other bugs, we created a few debug tools that could hopefully help in restoring playability to those saves.

Note that, as these are debug tools, they are experimental. So there's a chance they might not work, or that they'll introduce bugs of their own. Some of which you might not notice until much later.

However, if your save game is already in a place that isn't great, some of these tools probably can't hurt. And might actually help!

To use the new debug tools:

  1. Load the affected save in-game.
  2. Make sure no UIs are open (and cursor is not in an input/text field)
  3. Type "unlockdebug" (without quotes).
  4. This should unlock debug mode with a log message indication, and top right version now has a DB prefix.
  5. It'll also probably open the zones UI (hit "N" to close) and PowerViz ("L" to close) because of those hotkeys getting pressed in step 3.
  6. Now you should be able to hit ` (back quote, a.k.a. ~ tilde key) to open the debug UI.
  7. There will be a few white buttons and dropdowns on the right.
  8. Clicking "Prune NPCs" will attempt to delete all flying AI ships, and reduce any station populations to 8 or less NPCs
  9. Clicking a ship ID in the Respawn Ship dropdown and then Respawn Ship will respawn that ship layout fresh, but keep all existing NPCs
  10. Clicking a ship ID in the Respawn Ship dropdown and then Respawn Ship+NPCs will respawn that ship layout fresh, removing all old NPCs
  11. WARNING: Respawning ships will delete any ships docked to it, and will not work on ships you are currently visiting.
  12. Hitting ` (or ~) again will close the debug UI
  13. For best results, you should save the game after using the debug UI, and quit the game, as it has many shortcuts and other behaviors that could easily break your save.
  14. After saving and quitting, you can launch Ostranauts and load your save normally, and the changes you made should persist

The UI also has a few other tools, such as a button to teleport your character anywhere. And while that UI is up, you can click any NPC to select them, and closing the UI lets you control them.

Apart from that, we also have a debug console for typing certain cheat commands. This console can be summoned anytime by hitting F3 (even if "unlockdebug" isn't true).

Once up, you can type "clr" in the console to clear it, and "help" to see some useful commands. F3 will toggle it closed again.

Hopefully, these tools will be useful to players who may need to doctor their current game/save to get back to enjoying it!
Last edited by Blue Bottle Games, LLC; Jul 27, 2023 @ 10:39pm
< >
Showing 1-15 of 17 comments
Tumskunde Jul 27, 2023 @ 10:40pm 
I want to say thank you for this.
Last edited by Tumskunde; Jul 27, 2023 @ 10:48pm
Brandemihl Jul 28, 2023 @ 3:30pm 
Thanks Dan!!! I ran it and then checked the directory structure as well as radar and ALL CLEAR!
Last edited by Brandemihl; Jul 28, 2023 @ 3:42pm
Trafulgoth Jul 29, 2023 @ 11:02pm 
Following these steps seems to create broken saves. I'm guessing it's because it creates files that are too large to open easily; for example, notepad++ can't open my character_name.json file because it is 554MB. Before following these steps, that same file is 35MB, so something funky is going on.
Specifically, when trying to load the 'fixed' save, the debug console pops up with an OutOfMemory exception (although my computer is definitely not out of memory, might be something about how Unity allocates memory, not sure).

<color=red><b>[Error]</b></color>:
Out of memory
at (wrapper managed-to-native) string:InternalAllocateStr (int)
at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0
at System.Text.StringBuilder.Append (System.Char[] value, Int32 startIndex, Int32 charCount) [0x00000] in <filename unknown>:0
at System.IO.StreamReader.ReadToEnd () [0x00000] in <filename unknown>:0
at System.IO.File.ReadAllText (System.String path, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
at DataHandler.JsonToData[JsonGameSave] (System.String strFile, System.Collections.Generic.Dictionary`2 dict) [0x00000] in <filename unknown>:0


My exact repro steps:
1. Start Ostranauts
2. Load the pre-fix save
3. Type 'unlockdebug'
4. ` to open debug menu
5. Prune NPCs
6. Respawn 0KLG, 0KLG_BIZ, and 0KLG_MES using Respawn Ships+NPCs
7. Save and exit
8. Close Ostranauts
9. Start Ostranauts
10. Try to load new save, observe load failure

Here's an archive of both the before and after saves:
https://filebin.net/w0x37c0vk79zq27h
Last edited by Trafulgoth; Jul 29, 2023 @ 11:26pm
Tumskunde Jul 29, 2023 @ 11:44pm 
Were you docked at OKLG the time?
And If you were docked with OKLG when you respawned it, then it'll wreck your ship and probably the save.

The Prune command doesn't affect the loaded ship/station, So it'd best used while undocked, I've just used this command alone and it's worked wonders for clearing out my save.
You can use transit to take you to Commercial or Mescaform to hit OKLG if you don't want to undock right that second, running it multiple times has not hurt my save as it trims out excess npcs to a certain limit for the zone (OKLG has one of 8).
Last edited by Tumskunde; Jul 29, 2023 @ 11:47pm
Tumskunde Jul 29, 2023 @ 11:49pm 
You could also try the 0.12.1.8 experimental build, get it through the betas available under Steam's game properties. It's currently labelled: public_test
It has some stuff added to help debloat saves.

Details Here:
https://steamcommunity.com/app/1022980/discussions/2/3803904095531056726/
Last edited by Tumskunde; Jul 29, 2023 @ 11:50pm
Trafulgoth Jul 30, 2023 @ 3:38am 
Originally posted by Tumskunde:
Were you docked at OKLG the time?
And If you were docked with OKLG when you respawned it, then it'll wreck your ship and probably the save.

The Prune command doesn't affect the loaded ship/station, So it'd best used while undocked, I've just used this command alone and it's worked wonders for clearing out my save.
You can use transit to take you to Commercial or Mescaform to hit OKLG if you don't want to undock right that second, running it multiple times has not hurt my save as it trims out excess npcs to a certain limit for the zone (OKLG has one of 8).
I wasn't docked to anything, made sure to undock before making the first save. If you have had success with it, maybe my issue has some other requirement to trigger it, although I've had it happen with two different characters. :shrug:
Blue Bottle Games, LLC  [developer] Jul 30, 2023 @ 9:08am 
Originally posted by Trafulgoth:
Originally posted by Tumskunde:
Were you docked at OKLG the time?
And If you were docked with OKLG when you respawned it, then it'll wreck your ship and probably the save.

The Prune command doesn't affect the loaded ship/station, So it'd best used while undocked, I've just used this command alone and it's worked wonders for clearing out my save.
You can use transit to take you to Commercial or Mescaform to hit OKLG if you don't want to undock right that second, running it multiple times has not hurt my save as it trims out excess npcs to a certain limit for the zone (OKLG has one of 8).
I wasn't docked to anything, made sure to undock before making the first save. If you have had success with it, maybe my issue has some other requirement to trigger it, although I've had it happen with two different characters. :shrug:

Can you try the 0.12.1.8 build at the link above?

The 0.12.1.7 build does bloat the save more like you said,and the 0.12.1.8 one should work.

For best results, load your pre-debug-prune save in 0.12.1.8. And let us know if that helps!
Myst Leissa Jul 31, 2023 @ 8:12am 
Thank you so much, you truly prove that you are developers of a higher standard by giving us access to the tools to fix our own data, and you even listened to my suggestion to make it easily accessible :D
Trafulgoth Jul 31, 2023 @ 3:54pm 
Can confirm that the 0.12.1.8 build fixes the issue. Following the above procedure results in a save file that is smaller than before the fix and loads as expected!
Awnage Mar 19, 2024 @ 9:52am 
Hmm, tried this and now I am getting errors. I only wanted to prune the NPCs. Restarted the game and console is showing this whenever I hit the escape key:

[Exception]: ArgumentNullException: Argument cannot be null. Parameter name: key System.Collections.Generic.Dictionary`2[System.String,CondOwner].ContainsKey (System.String key) Ostranauts.Objectives.ObjectiveTracker.CheckObjective (System.String strCOID) Interaction.ApplyEffects (System.Collections.Generic.List`1 aLog) CondOwner.Interact () CondOwner.EndTurn () CondOwner.UpdateManual () CrewSim.UpdateICOs () CrewSim.AdvanceSim (Single fDelta) CrewSim.Update ()

Mouse scroll doesn't work, clicking Funds does nothing, time is stuck, can't escape to the menu system, have to use Alt-F4 to kill the game.
Last edited by Awnage; Mar 19, 2024 @ 9:52am
DragonZephyr Sep 13, 2024 @ 6:40am 
The instructions mention the tilde and backtick key to open a second console, does this just check for the button below escape or does the engine go for specific ID of button? Something like this is an issue due to keyboard layouts: both these buttons can only be accessed by hitting modifier keys which the engine might reject as not being a Raw button press of just that button (since you had to press something else at the same time!).
Old and New French Azerty places both the backtick and tilde behind ALTGR and raw input backtick is also behind ALT GR the same on a german QWERTZ except backtick there is a shift modifier to reach.
I did not wanna try it yet because i dont want my game marked as debug yet but reading this i am worried i will have to change my layout to be able to debug my game, which isnt the biggest deal but still.
Alientoad Sep 19, 2024 @ 4:48pm 
Debug helps w NPCs but adds critical bug w oxygen pressure. So its unplayable either of npcs lag spam or because of oxygen pressure cut approx 100 times. :angry_seagull:
Alientoad Oct 8, 2024 @ 8:16am 
Can confirm oxygen megabug. its a rawmeat still. :angry_seagull:
SickaSalmon Oct 24, 2024 @ 5:58pm 
How do you disable it? I only needed to unstuck from something and now I feel cursed.
Eyeless Deceiver Nov 11, 2024 @ 9:53am 
Originally posted by DragonZephyr:
The instructions mention the tilde and backtick key to open a second console, does this just check for the button below escape or does the engine go for specific ID of button? Something like this is an issue due to keyboard layouts: both these buttons can only be accessed by hitting modifier keys which the engine might reject as not being a Raw button press of just that button (since you had to press something else at the same time!).
Old and New French Azerty places both the backtick and tilde behind ALTGR and raw input backtick is also behind ALT GR the same on a german QWERTZ except backtick there is a shift modifier to reach.
I did not wanna try it yet because i dont want my game marked as debug yet but reading this i am worried i will have to change my layout to be able to debug my game, which isnt the biggest deal but still.

A very late response but useful for those of us in France or Belgium with an Azerty keyboard: the easiest for this is to have a second keyboard setup in windows settings (in input in languages), so you can easily switch with a click or a button. I have been doing this for a long time to get around exactly this type of issue in games.
Last edited by Eyeless Deceiver; Nov 11, 2024 @ 9:55am
< >
Showing 1-15 of 17 comments
Per page: 1530 50