There’s a lot going on at Spiritwalk right now. Between monitoring Ranked Play’s release, the Packrunner rework, an in-development replacement for House gameplay, art for new units, and the normal bug fixes and quality of life features, we have been keeping quite busy!
One thing that we have been working on continuously since our Steam release (but haven’t spent much time discussing) is performance. It’s a less glamorous headline, but we know it’s important to a lot of you out there, so we’re going to dedicate this week’s update to our optimization efforts.
What’s the goal?
With a feature like “performance”, it’s important to clearly define a goal to measure ourselves against. As part of our release plan for Shardbound, we want the game to be playable (which we define as 20+ FPS) on our minimum spec machine. We used the Steam hardware survey ( http://store.steampowered.com/hwsurvey/ ) to help us nail down a system configuration that was below that of the vast majority of players. We then cobbled together a representative PC in our office and got to work.
Where to start?
One of the big advantages to using an engine like Unreal is that you get to benefit from their existing tools. Unreal provides a suite of profiling tools that have been invaluable for understanding what the major offenders are. We were able to quickly find that Shardbound is GPU bound (meaning that graphics performance, not game logic, was to blame for slow frame rates). From there, we used Unreal’s GPU profiling tool to break down the cost of rendering a frame.
[Unreal’s GPU profiler showing a snapshot of a frame on Broken Mesa.]
Each item in that list is a portion of the rendering pipeline, and many can be broken down even further. This screenshot is from a powerful desktop computer, but running it on our little minspec PC showed a very different picture. Notably, the Base Pass, lighting passes, and PostProcessing were taking significant amounts of time.
How do we fix it?
Our first step was to add quality settings. These appeared a while back, and have been extremely useful since they allow us to improve performance for low-end machines while not impacting quality for high-end ones.
Each of the quality settings contains dozens of individual tweaks to how the engine performs, allowing us to fine-tune how shadows render (or not!), what post-processing to apply, and so on. This is a slow process of repeatedly toggling settings to find the look we want, but it’s well worth the time!
From there, we found a handful of features that we were not using and were able to remove them completely. Lens flares and a screenspace dirt mask, for example, were not desirable for our style so we’ve been able to entirely turn them off.
At this point, with our basic settings established, it was time to enlist our artists to help us improve the content on the maps. This work has been more recent, with our Technical Artist “Rive” taking the lead. His work could take up an entire post by itself! For each map, we’ve gone through a process of:
- Reduce lights, especially shadow-casting ones.
- Tuning post-process settings to minimize cost while still looking good.
- Optimizing instruction count for the various materials (including characters) that appear on a map.
- Reducing overdraw from transparent objects.
- Tuning shadows based on the camera for that map.
- Adding Level of Detail models with a reduced poly count.
- Tagging objects that are expensive to render or did not contribute significantly to the scene so that they would not be rendered at lower quality settings.
- Adding Baked Lighting for static objects.
In addition, we have snuck in some visual quality improvements as we spent time in each of these maps.
[New baked lighting allows us to have shadows on the background columns.]
Yay, now we have such good performance?!
We had hoped that all these efforts would get us to a playable framerate on our brave minspec PC, but we were just barely there: 18-20 FPS, depending on the map. In addition, some players were still reporting framerates below that, especially on laptops with Intel Integrated Graphics. We were not satisfied with those results, so we needed to keep going.
We had reduced the quality and content for the lowest “potato” quality setting nearly as far as we were willing to go, so we knew that we had to do something more substantial than simply shave off a few more polygons. Luckily Epic ran into a similar problem with Paragon, and added an additional rendering mode they call Simple Forward Rendering. This mode turns off a substantial number of the features of the engine, making it act more like an oldschool forward rendered game. [If you are interested in the topic of Forward vs Deferred Rendering, this page gives some nice technical details on the difference: https://gamedevelopment.tutsplus.com/articles/forward-rendering-vs-deferred-rendering--gamedev-12342 ]
The Simple Forward Rendering pipeline only supports a small fraction of Unreal Engine’s features. The work we had already done for Potato quality got us 90% of the way there, so we went about making the final changes for Potato to support this new pipeline. After setting up our project to support it, we were able to get the stalwart minspec machine up to 40 FPS! This change should be rolling out in our patch this week, so if your PC has been struggling to play Shardbound please give it a shot!
What’s next?
First on the docket is to make sure that the Simple Forward Rendering optimization improves performance enough for us to check off our initial goal of a playable game on a minspec PC. We will be keeping an eye on it over the next few weeks and make any tweaks that are needed.
After that, we have freed up some resources to make more art improvements, and we have a lot of work to do! This includes making potato quality look better, improving the overworld, finishing the art for the UI, supporting ongoing feature development, additional map development, and the ongoing effort to get art for all of our units.
Of course, this is also not the end of optimizations for Shardbound. We’ll be continuing to improve the game for everyone as we keep building.
(I’d also like to give a big THANK YOU to the many Early Access players who are helping us improve performance by giving feedback, PC specs, and so on.)