The Road To Evolution - Optimization
Welcome back to our deep dive series on Primal Carnage: Evolution! We have previously explored the Soundtrack, Gameplay & Visuals, with more to follow..
Today we’re talking “optimization,” giving a window into a fairly broad topic. Making sure the game runs well has been a major priority for us during Evolution’s development.
Firstly, we’ve tried to keep the file size of the game on the small side - many titles today are incredibly bloated, flooding your disk drive for no good reason. Even though a lot of our textures are larger now, we have smarter ways of compressing them.
Packing three (or more!) texture masks into one, for example, reduces the number of seeks on the hard drive. This makes the game run faster while also taking up less space on disk. This process is nothing revolutionary in terms of game development, but it’s something that we’re making much more use of.
CONSOLE TARGETS
Evolution runs at up to 60fps on PS4 Pro / PlayStation 5, at 1440p resolution.
The base PlayStation 4 model runs the game at standard HD res of 1920x1080.
On the PS4 Pro & PS5, there are settings to swap between Fidelity and Performance, however we’re still finalizing these at the moment. Expect more granular details on the differences between the two modes closer to launch.
Over the course of the closed PlayStation beta we’ve been fine tuning things, reacting to reports our community testers have been sending in. For the most part, we’re now hitting our 60 frames per second target with just momentary drops to around 45-50fps under heavy load. However, we will also offer the option to just lock to 30fps on console for those who don’t like a variable framerate.
The base model currently PS4 runs with a 30fps cap in place by default, but we’re hoping to include the FPS Lock option there as well so that you can toggle it Off (for those who really want to push their old hardware).
Primal Carnage: Extinction for PS4 was limited to 30fps itself, but would often fail to meet that target. Over the last couple of years, a great deal of effort has been put into optimizing every game level, every shader, every prop, to claw back as much performance as possible. This means that Evolution is a major step up visually but also runs much better with our refinements.
A GREENER WORLD
This debug view of UtiityBase shows before and after the game’s shader overhauls. Green is good, meaning the object is simple to shade and render, and/or doesn’t have much transparency.
Red is bad, a costly draw call - usually something that you can see other objects through. Anything that shows as pure white is the most expensive, taking up the most amount of resources to display.
The new Ubase is a forest of green, with distant objects now using optimized shaders and lower density models far away compared to when viewed up close. Some areas did actually increase in shader complexity, such as the base wall, but this is the nature of game dev trade-offs. Those assets instead gain performance elsewhere by using only one third of the texture memory that they used to.
The landscape terrain is still very much in the hot zone, even after extensive optimzations. Wherever possible, it’s now covered up by new 3D models. Drawing terrain requires a lot of resources, so areas like cliffs which were landscape formations before have been replaced with models instead.
Going this route for cliffs actually makes them cheaper to render, while visually being more detailed. These meshes can also swap to simpler versions at a distance much more efficiently than the standard landscape terrain can manage.
MEMORY AND MERGING
Other techniques to improve performance include merging many small assets into one, to reduce how many draw requests are being made at once.
Rendering dozens of small assets can often take longer than drawing one big object, since each of those little props is its own set of draw calls. Combining them into one can speed things up, but it’s a careful balance making sure that the merged object itself doesn’t eat up too much memory. Essentially, a tradeoff between CPU bandwidth and the amount of RAM available.
For Evolution, we increased the pool of memory used for graphics functions on PlayStation to the upper limits. The consoles have a shared stack of RAM used for both general processing and graphics, which the developer has to decide how to spend. We found that we could raise the amount devoted to visuals quite a bit further than it had been set in the old game, especially on PS4 Pro - where we now make use of double the original Primal Carnage: Extinction’s video memory.
PARTICLE MAGIC
Particle effects are used all over the game, from the player’s weapons fire to incidental details like leaves falling from trees and butterflies circling flowers. They help make the game world feel more alive and give punch to your actions. Too many stacking up can have a major impact on performance, though.
The biggest issue is “overdraw” - similar to how the transparent leaves of trees can be costly when stacked up, so can dozens of transparent smoke and fire particles. We made judicious cuts to draw distance on certain FX elements, like not showing tiny sparks when far away and swapping to simpler versions at long range. However, this won’t help when particles are right in your face.
Near camera culling is used to remove particles that take up a lot of your view when close-up. Particles both smoothly fade out and shrink in size before being destroyed, reducing overdraw as much as possible. We’ve also found ways of remaking many of the old effects with fewer actual particles, by getting creative with shaders.
STILL IMPROVING!
All through development, we’ve never stopped looking for new ways to improve how the game runs. Assets are continually being adjusted, maps have been getting further fine tuning, and the core game code itself has received some cleanup in a few areas to be more efficient lately.
From chasing down memory leaks and crashes, to optimizing flamethrower collision detection… Evolution is way more stable and performant thanks to our long-running beta.
Want to help test? You still have a chance to join the beta!
We’re on Discord.
If you'd like to get all the latest Primal news & previews first, or take part in our regular community contests and polls, join the Official Primal Carnage Discord channel!
STAY TUNED FOR MORE INFO…