1. Stationeers
  2. News

Stationeers News

Atmospherics System Refactor

Cross learning and tech sharing between our projects brings you this update




Contrary to what has been incorrectly suggested in some reviews, the multi-team nature of our studio works towards better products, and this update is an excellent example of that. After technical review of our unreleased train tycoon game (Art of the Rail) by ICARUS technical team members, we embarked on a new approach to multi-threading for some core systems that took better advantage of multiple cores, and reduced thread concurrency dependency. What this means is we were able to squeeze better performance and reduce technical complexity (think: opportunity for really hard to fix bugs) at the same time.

We are really proud of how we have built a studio that has different teams, but are still able to share the lessons and grow better overall - and we hope you see the results of that too. Our lessons, both good and bad, from ICARUS and Stationeers are flowing between our teams and projects as well as the unreleased games we are working on. Even if these unreleased games never came out, they prove valuable in us being able to test our systems and approaches that we can port to games like Stationeers.

It's a shame that the top review for Stationeers, draws the conclusion that multiple projects and teams in a studio is bad for any of the games when, as this update demonstrates, the reality is quite the opposite.

Highlights
  • Localization is fixed
  • Some versions of Linux could not run the dedicated server due to missing DLLs, this should now be fixed
  • The atmospheric tick has been highly optimized and experiences much less slow down. On many saves the atmos tick was running only about once per second or worse. Now it will be running every 500ms. On top of this the room generation and atmos tick are now in a fixed sequential order.
  • Fixed large IC scripts not being synced in multiplayer
[h3]Want to run a dedicated server? Much has changed! Checkout this guide on my github for more information[/h3]
Background on Threading


Threading, in a programming sense, can be thought as of making your computer multi-task something. That is obviously a good thing, especially so for a systems game like Stationeers, because your processor (CPU) has a lot of things to do. You'll hear us talk about a "frame", which is the time (typically measured in milliseconds or "ms" for short) which you have to construct the image that will be sent to the users monitor for display. If you take to long, or even do so at constantly shifting speeds, the game "lags". There are multiple reasons that this can happen which you will hear people talk about on forums, such as being "CPU bound" or "GPU bound". GPU is the graphics card (or integrated processor), a device heavily focused on doing enormous numbers of math calculations concurrently (at the same time). When I say enormous, I really do mean enormous. Modern GPUs conduct math operations at a truly staggering rate.

While it is obvious that multi-threading is good for games, it is typically also very bad for them as well. This is because when you make an operation concurrent, it is very difficult to get that working together with the other threads going on. Especially so with the "main thread" - which is the one your game is using to put everything together. Modern game engines such as Unity or Unreal nearly always have some multi-threading out of the box, such as physics (at least some parts of it), audio (again, some), and some file operations. The rest is up to developers.

Sequential Operation of Worker Threads in Art of the Rail




We're pretty proud that Stationeers has always delved deep into unlocking the potential of all those CPU cores on your computer. But in many cases, we would make one thread for one group of tasks. Take atmospherics, which operated on one thread but constantly calculated what needed to happen. In Art of the Rail, I had a similar approach to vehicles. I had a companion thread that would move vehicles along their road or rail constantly, at a regular tick rate. This however caused some eventual scale issues and also left me the constant headache of the main and vehicle threads (as well as other ones) tripping over each other.

Unity offers an out-of-the-box approach to solve this called ECS, but it has a lot of restrictions. So with Art of the Rail, I took the general approach and rolled a custom system. What it involved was rolling up a variable number (based on detected core numbers, settable by player in settings) of "workers", assigning the tasks between these workers, and executing all the workers at the same time, but only applying their results at the start of the next frame.

What this means is that we get to do things sequentially, avoiding the problems of trying to keep data congruency between the state of things on varying threads. Work happens while the game is running, but it is all reconciled at the beginning of a frame, so all threads always agree on the state of the game.

https://store.steampowered.com/app/1286190/Art_of_the_Rail/

Applying this to Stationeers


We were having tremendous difficulty fixing bugs associated with the Room Manager thread in Stationeers. The purpose of this thread was to generate rooms, but it caused a lot of weird state issues due to concurrency and data trampling with the atmospherics manager. Not to mention it would sometimes take an enormous amount of time to run.

There wasn't a clean way to solve this, so I proposed we try the Vehicle Worker implementation from Art of the Rail we discussed above. The situation is much more complex in Stationeers, however. In Art of the Rail the vehicles are very independent making them an excellent candidate for truly concurrent handling. Stationeers has multiple dependencies, so it ended up being a much more complex process.

Broadly the following tasks are threaded, and handled using a mix of dedicated threads or concurrent worker threads:
  • Calculating the neighbors to mix with
  • Caching all the data for the main thread
  • Fire and burning
  • Any new rooms that need to be calculated
  • Atmosphere mixing between neighbors and networks
  • Internal reactions in Atmospheres
  • Pipe Atmospheres are handle specially

Thing atmosphere reactions are done on the main thread, because they touch a lot of different things.



[h3]The result is about four time faster than it was before, and it solved a whole lot of bugs associated with room creation issues.[/h3]

Order of operations for Game Logic is now

This will likely have impacts on your IC code, if you are tightly dependent on some of the order of operations and timing.
1. Room Generation
2. Atmospherics Simulation
3. Power Tick
4. Logic Chips/Devices Tick
5. IC Chips Tick
Dedicated Server development


A fair few fixes and changes have come through, mainly focused on Linux dedicated servers, but with some limited success due to issues with our build server. It is still not very pretty, and we are still working on this, but it is much better than before. We have also reached out to many of the Game Server Providers (GSPs) directly, to work with them to help better support our servers. This will be an ongoing focus for us. We plan to devote significant resources to this over the coming months.

Like what you see? Help out!

We're super excited about where to take Stationeers in 2022. If you are as excited as we are please consider leaving us a positive review - it means a lot to us. Also our DLC was made as a way for the community to support us, so consider grabbing that as well.

https://store.steampowered.com/app/1038400/Stationeers_Zrilian_Species_Pack/

https://store.steampowered.com/app/1038500/Stationeers_HEM_Droid_Species_Pack/

Changelog v0.2.3392.16643
  • Fixed Respawning after dieing in an explosion stops respawned character from being able to move. (beta bug introduced rev.16602)
  • Fixed Error spam thrown by Atmospherics thread when trying to calculate Temperature of a Zero volume atmosphere. Zero volume atmospheres are now deregistered if they accidently get created.
  • Fixed Terrain Manipulator mining terrain rather than adding it (bug on beta branch only, introduced rev.16557).
  • Fixed Rooms not being deregistered when a wall of a room is completely deconstructed. (introduced rev16566)
  • Fixed Error thrown by TerrainLod.
  • Fixed Server hangs when printing a Programming motherboard.
  • Fixed case where smelting ore could cause occlusion thread to crash, causing disappearing pipes bug.
  • Fixed Atmospheric Tablet reading incorrect values (due to occlusion thread not updating its local atmosphere).
  • Fixed a number of errors thrown by atmospheric interactions happening when Main thread was trying to modify atmosphere data. These now use AtmosphericEventInstance system to handle these interactions.
  • Fixed Error thrown by Audio Concurrency system when an ore was smelted while another ore was playing an impact sound.
  • Removed GetAtmosphereWorld function. Use GetAtmosphereLocal() or SampleGlobalAtmosphere() for Reading on main thread. Use CloneGlobalAtmosphere() or GetAtmosphereLocal() for writing atmospherics data the atmospherics thread.
  • Added new AtmosphericEventInstance functions for Grid operations (where an atmos does not yet exist) CreateEmpty, CloneGlobal, CloneGlobalAddGasMix, CloneGlobalRemoveEnergy. Also added Reset AtmosphericEventInstance for clearing a gas mix.
  • Load game button no longer throws exceptions if there are no saves
  • Stop world descriptions from disappearing when you leave the current game
  • Fixed bug where certain values would cause multiple exceptions when hovering over pipe analyser
  • Fixed Clients could sometimes fall through terrain when joining.
  • Fixed Helmets offset on clients.
  • Fixed Locked game at 60fps during initial scene loading.
  • Changed Forced Terrain generations to run synchronously
  • Fixed FrameRate Counter now runs in pause menu.
  • Fixed FrameRate limiter no longer accepts out of bounds values.
  • Fixed Simple, Good and Beautiful Graphics pre-sets turning on v-sync.
  • Removed double logging in console window
  • Removed Cell.CellLookup Dictionary, Was duplicating GridManager.GridCells.
  • Fixed Bug where terrain renderers being turned off at incorrect time when playing as server.
  • Fixed World atmospheres that are outside of rooms not being destroyed in a timely fashion.
  • Fixed Some world atmospheres not having a reference to their cell.
  • Fixed bug where languages were not showing and could not be selected
  • Cleaned up help logging in console, made it oneline. Still a bit messy. Will make it better soon.
  • Fixed Atmospheres in rooms in terrain having a volume less than 8000 when all terrain voxels appear to be mined out.
  • Fixed exception thrown when intialising console overrides in ConsoleWindow
  • Fixed DuctTape not fixing solar panels (and other things)
  • Added clearing console once dedicated server is ready to receive input
  • Fixed submitting large IC scripts in Multiplayer as server or client throws error spam and/or crashes the game.
  • Added small optimisation for room generation
  • Added interception of unity logs by our logging system so that we can deal with them individually
  • Fixed -settingspath not working if file already exists. Removed existence check. File is created if not.
  • Fixed Atmospherics and Logic Tick not pausing when in pause menu.
  • Removed IMGUI completely from server builds.
  • Fixed Terrain does not hold atmospheres. Rooms can now be reliably generated using terrain.
  • Refactored Atmospherics, Power/Logic & Room Generation to run sequentially on a new GameTick locked at 500ms. Previously these different systems were running concurrently and at increasingly varying rates as bases grew in size.
  • Order of operations for Game Logic is now: Room Generation > Atmospherics Simulation > Power Tick > Logic Chips/Devices Tick > IC Chips Tick.
  • Added new worker thread system.
  • Fixed World atmosphere being created when mining. Mining into terrain will now create an empty atmospheric cell that will pull in neighbour gas.
  • World Atmosphere sometimes being spawned on loading a game in rooms created by terrain.
  • Fixed slowdown of atmospherics processing in larger bases.
  • Refactored Atmospherics Processing to allow for parallel processing of most atmospheric functions. Atmospherics runtime is now about 4x faster.
  • Fixed FrameRate spikes when Clients were Reading and Processing Atmospherics data. This work is run on a separate thread.
  • Fixed Moved Jetpack emissions handling to Atmospherics thread.
  • Fixed submitting large IC scripts in Multiplayer as server or client throws error spam and/or crashes the game.
  • Fixed Air conditioner buttons not interactable for clients.
  • Fixed Explosion FX and sounds not playing.
  • Added sounds to remote detonator.
  • Added beeping sound to armed explosives.
  • Fixed Explosions not mining terrain.
  • Fixed Remote Detonator not working for Clients.
  • Fixed Error when an explosion triggered.
  • Fixed Explosions not removing clutter.
  • Changed increased the radius of terrain mined by explosives to match the radius at which force/damage is applied.

Hotfix 0.2.3344.16555

Dedicated Servers

We are actively working with those running Dedicated Servers, both on the forums and in discord, to ensure we get the best we can. As such, we have decided to release a hotfix with some urgent fixes, mainly focused on those running dedicated servers.

IMGUI issues on Dedicated Server Linux

Some of those running Dedicated Servers using the Linux binary are encountering a spam of warnings related to IMGUI. We use an excellent external library called Dear IMGUI in the main game, to allow us to do complex UI. This is not used in the "terminal" version of the game, but is still included in the distribution. As outlined in the last post, this move to a union of the main game and dedicated server code bases, its complex for us to remove individual packages and components - so something we need to look into. Until there, while you can safely ignore the warning being spammed, they can be disruptive to running the server.

Installing the Dedicated Server App

Adding:
-batchmode
To the startup parameters the main game will launch the game as if it is a dedicated server. Otherwise, you can install "Stationeers Dedicated Server" from the "Tools" category in steam. This can most easily be done via the SteamCMD command line application. Stationeers Dedicated Server is a tool that is free to download and run anonymously, you do not need SteamCMD logged in as a client to do so.

In future updates we will post some guides about how to install and run, in the meantime the community is exploring this process on the forums. It is challenging to write a guide, as we are still actively changing the process based directly on our communication with you. It is vital we invest time and effort making the Dedicated Servers excellent, so that true online communities for stationeers can be run.

Changelog v0.2.3344.16555
  • Changed server checks as a runtime for IMGUI runner
  • Removed unwanted meta file
  • Fixed RenderDistance on Harvey's and grow-lights.
  • Fixed broken mods breaking loading of the game in some situations
  • Fixed load command pointing to wrong place outside of dedicated server
  • Added extra optional arg to -load to initialise a new game and save it to disk
  • Fixed (potentially) clearing console for dedicated server
  • Added -settings as a launch command with support for multiple property assignments in args
  • Added FPS cap (25) to dedicated server
  • Fixed and enabled in-world debug visualizers
  • Added #if UNITY_SERVER checks to imgui package to ignore for dedicated server
  • Removed default.ini from StreamingAssets
  • Fixed Index Out of Range exception thrown by StringManager when a NaN or infinite number was passed in.

Stationeers Dedicated Server & Fixes

The dedicated server was not quite ready to go for the last patch but it's here now and it's better than ever.

Our deployment of the refactor also highlighted a suite of problems we needed to jump onto quickly. Some we managed to patch very quickly, including during the weekend when we deployed the update. Some took a little longer but are here now.

Dedicated Server Rework




With the complete rework of the multiplayer that we launched in our last major update, we applied the same treatment to how we approached dedicated servers. The steps we have taken allow us to walk towards truly being able to run public servers with many players. We think that, over time, the work we have done now is a great first step to really being able to build online communities for Stationeers. This is just our baseline, and we plan to extensively develop on this.

The old system was developed in tandem, parallel to the main game. This often resulted in bugs appearing in the dedicated server and complicating our development substantially. Now the dedicated server is integrated into the base game code, with the build for dedicated servers simply stripping unnecessary parts out. This massively simplifies how we build the game with dedicated servers in mind, and paves the way for additional command and tool support for those wanting to run Stationeers-based communities.

It is likely no secret that we are huge fans of multiplayer gaming, and proper dedicated server support has been a dream of the team since we began the project. It's a tremendous feeling for us to take the first steps along this path, and we hope you are as excited about this as we area. Please do let us know in the Discord, and discuss there as we will be putting as much effort as we can into expanding on this.

Mods & Workshop Support




Most mods, custom worlds, and IC scripts from the workshop should now be working again. There were some issues that crept in as we began removing all the Steam SDK hooks so that those who haven't run the game through steam, could still play it just fine. We are a firm believer that strict DRM is not appropriate for our games. Technically, there would be nothing required for the game to be torrented or given to another person. Obviously, though, we hope you buy the game and support our team. As such, there is still some remedial work we need to do to tidy up the lose ends of this, such as mod and workshop support. We will continue to monitor for any problems or missing functionality here.

General Bugfixing


There is a bunch of smaller bug fixes in as well and we're happy to finally be working hard to hunt down and fix some of the bigger issues that have been around for a long time (prior to the big refactor). You should start to see these in the next update. We have been working hard behind the scenes to continue to optimize the game. Recently we have been experimenting with pulling across additional job system multithreading that we implemented live on a devstream for Art of the Rail, another project at the studio.

https://store.steampowered.com/app/1286190/Art_of_the_Rail/
[h3]IMPORTANT
If you have saved since the update and were playing as a DLC race that save is likely corrupted! Please load a save from prior to the update. And your species and gender data will now parse correctly through to the new system. You will need to redo your other cosmetics settings as these will have been set to default.[/h3]
Next Steps

We are working on settling into a regular cadence of weekly updates, which we have been doing every week for another studio project (ICARUS) with great success. The updates won't always be major ones, but keeping to a weekly cadence helps us to keep the current build active and in a solid state.

Another focus is on better localization, and some love for our extremely supportive communities all across the globe. This will include localized voice for some of those territories as well.

We will now begin implementing the plans we have to take Stationeers from being a bunch of cool systems into a solid game loop. There is a tremendous amount of great systems in the game and we've been working on design behind the scenes to better tie it all in together.

Like what you see? Help out!

We're super excited about where to take Stationeers in 2022. If you are as excited as we are please consider leaving us a positive review - it means a lot to us. Also our DLC was made as a way for the community to support us, so consider grabbing that as well.

https://store.steampowered.com/app/1038400/Stationeers_Zrilian_Species_Pack/

https://store.steampowered.com/app/1038500/Stationeers_HEM_Droid_Species_Pack/

Changelog v0.2.3336.16533
  • Added password check when creating new game session
  • added settings commands to CLI
  • Added netconfig command for CLI.
  • Added server password locking
  • added queue to catch premature logs to console window, then print them after init process
  • added -settingspath launch command to direct exe instance to a different settings file
  • Added dev config for settings various properites in game without dirty scene
  • added svn ignore DevsConfig.json
  • Added in game chat using `say` command
  • Added old save prompt
  • Added WIP prompt when entering server list or hosting a game
  • Updated build script to properly support dedicated server builds
  • Added custom command line parser
  • Added new pipe label texture
  • Updated scale of cooked food
  • Updated pipe label texture
  • Added new 'discord' command in CLI
  • added basic form ask for server details when starting new game
  • Added commands for kicking/banning players from server
  • Fixed Loading a Save when playing as HemDroid and Zrillian that was created on the previous branch causes character to spawn as naken human with battery in suit slot.
  • Fixed Zombie Bodies begin created when respawning.
  • Fixed TakeControl command being called twice in certain load execution orders.
  • Fixed Respawned Characters not registering with CameraController.
  • Fixed Console Error Spam on Clients when a dead Stationeer body decayed into a skeleton.
  • Fixed Drop position of dead/unconscious bodies.
  • Fixed flat and angled solar panels from not always correctly seeing the sun due to misconfigured ray offsets.
  • Fixed PowerTransmitters can cause loading saves to break.
  • Fixed Dynamic Generator can cause loading saves to break.
  • Fixed Sometimes there would be the occasional ice on Venus.
  • Fixed Error spam from sterling engine tooltip when empty gas canister inserted.
  • Updated server list items to support new meta server updates
  • Fixed over populated server list with placeholder data
  • Fixed error that could be thrown when autosaving due to list of all Referencables being modified.
  • Replaced meta server IP
  • Replaced OpenUPM for DiscordSDK directly because openupm version didn't build for linux dedicated
  • Cleaned up unused interface methods from INetTransport
  • Fixed bug where container contents disappear too soon when closing
  • Fixed Error thrown by audio concurrency system when an audio source is destroyed in the same frame as playing a new sound.
  • Fixed issue of not being able to start a new game session after leaving current game session
  • Fixed jumping when console is open
  • Fixed Camera FOV changing in start menu
  • Made mousewheel scroll selection more intuitive
  • Changed flare particles to world space
  • Fix bug where swapping slots with the slot window open caused error
  • Fixed NRE when no player cosmetic data xml had been saved.
  • Fixes to get game to compile on linux
  • Fixed NRE in Thing.Mode in linux dedicated
  • Fix issue with mods not loading
  • Fixed batch console input for dedicated server
  • Fixed Key bind settings menu not showing any of the keybinds
  • Improved usability of CLI reading input
  • Fixed backspace not working right for CLI
  • Removed DoTween warnings in dedicated server builds
  • Removed unnecessary log when app finished loading in dedicated server build
  • Disabled discord SDK in batch mode
  • Reverted food scale changes
  • Removed x86 dll for Discord SDK
  • Removed server admin password from settings menu
  • Removed input form for CLI when creating a game session in favour for xml file
  • removed hashing on stored passwords for now
  • Removed log from build script
  • Removed shell32.dll from linux dedicated. Wrapped in !linux preprocessor
  • Deleted a bunch of vestigial brain code.

Hotfix 0.2.3304.16432

[h3]IMPORTANT:[/h3]
If you have saved since the update and were playing as a DLC race that save is likely Corrupted! Please load a save from before the update. And your species and gender data will now parse correctly through to the new system. You will need to redo your other cosmetics settings as these will have been set to default.

  • Fixed Loading a Save when playing as HemDroid and Zrillian that was created on the previous branch causes the character to spawn as naken human with battery in suit slot.
  • Fixed Zombie Bodies begin created when respawning.
  • Fixed TakeControl command being called twice in certain load execution orders.
  • Fixed Respawned Characters not registering with CameraController.
  • Deleted a bunch of vestigial brain code.
  • Fixed Console Error Spam on Clients when a dead Stationeer body decayed into a skeleton.

Hotfix 0.2.3300.16424

Fixed worlds with craters or asteroids not loading terrain on clients