Dev Update 2023-03-08: Performance and Immersion

Stardeus

Stardeus is a deep colony sim set on a broken starship manned by drones and hibernating human survivors. As the AI, have your drones repair your ship, save your crew and travel the stars in this beautiful simulation.

Hey Space Travelers! A new major update is underway, and I will try to not spoil it for you, but some noteworthy changes were shipped already. The update is going to be quite technical, if you don’t like that, skip the walls of text to get to the second half. [h2]Room / Section detection rewrite[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/e798bdcec8a4b2671af9f9d3f622284325100fd2.png[/img] After releasing the major update, I decided to regroup and do an iteration of technical changes. Cleaning up the technical debt that inevitably accumulates over time is very important for a long term project like this one. Some systems that were created early proved to be not as efficient or flexible as they could have been. One of these systems was the Room / Section detection. It worked well with smaller ships, but some of you like them jaw-droppingly big, and every time floors or walls would change on a huge ship, all the rooms and sections had to be reevaluated. Depending on the CPU load, this could take up to 1 second, which is forever in computing terms. A full rewrite made the room change detection so fast that I don’t even have to run it in the background across multiple frames anymore. You may notice a significantly faster ship generation when starting a new game, this is thanks to this rewrite. The performance boost is also noticeable when you have a large amount of ongoing construction that makes the rooms / sections to constantly reevaluate. [h2]Pathfinding rewrite[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/7b4bdaaa461ae4f30d7b6b0538faebd040f1ba19.png[/img] After getting my hands dirty with Room / Section rewrite, I decided to take a stab at the most annoying system I had - pathfinding. The system was rewritten from scratch to get a whopping performance increase of up to 1000x for most pathfinding queries. Previously some more complex path requests could take as much as 500ms to get executed in a background thread, which would stall the workers as they were waiting for a pathfinding result. This was especially noticeable at 10x speed with a large number of workers. Now pathfinding runs so fast that it is virtually immediate. This also significantly reduced the overall CPU consumption and gave more breathing room for other CPU intensive tasks. Additionally, this rewrite forced me to go through tons of code and change it to adapt to the new, more strict API. Due to the extreme speed-up and the additional validations, I’ve found and fixed numerous race conditions and edge cases that may have caused some weird situations that could lead to undefined behaviors. If you had any issues with performance before, now is the time to reevaluate the experience. [h2]Lights system rewrite[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/d974290abb17997654f3c78dad20fa067fcc6177.png[/img] This is the last large rewrite I did before the next major update, I promise! Light rendering was something I wasn’t happy about. It involved two different cameras and two sprites per light source, and often looked weird when there were multiple light sources close to each other, and there was not enough control over how lights were blending with each other. The old light system also had an upfront performance cost, where a small number of lights would be as expensive as a large number of lights, which made the game run a few FPS slower on lower-end hardware. The new light system eliminates the cameras and sprites, and instead uses a small data structure for each light source, which makes it faster and more lightweight for small amounts of lights, yet still robust and powerful enough to drive thousands of real-time colorful light sources with two-color pulse and dynamic positioning. My tests show a 20% performance increase with high-end GPU at extreme number of lights (5000+). In addition to this, the light sources have received a “range” slider, where you can adjust the range of any configurable light source. The electricity cost will reflect the light range. And the Video settings panel has a bunch of new controls for the new lights system, including the overall light intensity and some performance related settings which should remain on “Auto” unless you want to mess around to get a few extra FPS. [h2]Landing Zones[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/07fc495bbea07602c3476b31145af3497b7ae0b2.png[/img] Stasis Pods and Storage Capsules used to drop anywhere on the ship, even if the area was fully enclosed and oxygenated. That was immersion breaking, and now this behavior had an overhaul. Since recently, Stasis Pods and Storage Capsules will only target unenclosed areas. Make sure you have at least 100 tiles of what is now considered a “Landing Zone”, or the incoming pods will ram your outer ship walls due to lack of space for proper landing. No more landing through the roof though! [h2]Real-time nebulas for everyone[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/b0c6beed861390a11f118c068624a673bbb07d0f.png[/img] I love the beautiful real-time nebulas that float when you fly, but unfortunately they were so taxing on the GPU that I kept them off by default, hidden behind a video setting with “unoptimized” in the label. Well, not anymore! I have reworked the visual effect that produces realtime nebulas and removed the most expensive processing that gave only slight visual improvement. Now simple real-time nebulas are the new default, and for a good reason - read on. [h2]Ship rotation[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/501cacd40f3a23dcd69b48372de97e37e67ea297.gif[/img] Since I’ve been focusing on increasing player immersion, I finally did a thing that was suggested by a few of you before. When you pick a destination in the starmap, the ship will have to rotate and align itself with the target before flying. The rotation will be visible in the game view, and it will look glorious with real-time nebulas! This also adds a new mechanic - when you have to escape incoming asteroids, you will likely have to pick a place that is aligned with your current rotation, or you will lose precious time reorienting your ship. While for now no changes are needed for the engine configuration, I will consider adding dedicated thrusters that will be required for rotating the ship. [h2]The little things[/h2] [img]{STEAM_CLAN_IMAGE}/38884233/b457916521f0d19fbbc3b719d5e61a234131a648.png[/img] There’s a ton of other smaller changes that shipped since the Derelict Ships update, here’s a few of my favorites: [list] [*] [b]Two new plants you can grow: Poppy and Cornflower.[/b] The products you can harvest from these plants will be used for something special that will be added in the next major update! [*] [b]Thin version of walls.[/b] Those required some special changes for the lights rendering to look good, but now you can make your colonists hear each other snore. Just think of all the steel plates you’ll save! [*] [b]Plan Move tool.[/b] Since you can use precision thrusters to move your ship around in the local map, the plan had to become movable as well! You can find the plan move tool in Plan (“L”) radial menu’s second page. Also, when you’re drawing your plan, holding Ctrl + Shift + Alt will let you click and drag the plan to move it immediately. [*] [b]Pets can now sleep in Armchairs![/b] (Yes, the raider-leather ones) [*] [b]Loading icon[/b] will show an animated drone holding a “Wait!” sign instead of a rotating cog. This is probably my favorite change ever. [*] [b]Rooms overlay (F9) will show tooltips[/b] with contents of each room when you hover the room list. [*] [b]Dust storm particles will not show up inside enclosed areas.[/b] This is a subtle little graphics change, but a very pleasant one, adding to the immersive experience. [*] Flying between galaxies will display [b]FTL trails[/b]. [*] [b]Pixel Art mode![/b] Go to Settings > Video > Texture Quality and choose “Pixel Art” or “Low Budget Pixel Art” to get a nostalgic retro art style. [/list] [img]{STEAM_CLAN_IMAGE}/38884233/b5bd2ee0fe4cec63491bbd9acaf283d10faff619.png[/img] That’s it for now, the next update will be a major one! The full changelog: https://stardeusgame.com/changelog Search for "[b]v0.7.0[/b] (2023.01.23)" and scroll up to read through what exactly has been done since the major update. [h2]Follow the Development[/h2] [list] [*] Official Website: [url=https://stardeusgame.com]https://stardeusgame.com[/url] [*] [url=https://discord.com/invite/89amEwP]Join Stardeus Discord[/url] [*] [url=https://www.reddit.com/r/stardeus]/r/stardeus[/url] on Reddit [*] [url=https://twitter.com/StardeusGame]@StardeusGame[/url] on Twitter [*] [url=https://twitter.com/dev_spajus]@dev_spajus[/url] on Twitter [*] [url=https://www.twitch.tv/dev_spajus]dev_spajus[/url] on Twitch (live development streams) [/list] [h2]Get Stardeus[/h2] https://store.steampowered.com/app/1380910/Stardeus/