Optimizing Godforge: 200+ heroes, million-polygon worlds

Check out our interview with Fateless co-founders and co-CEOs Simon Lockerby and Hisham Saleh, where they share the critical optimization strategies they used to manage a roster of over 200 heroes and high-fidelity environments containing up to a million polygons in Godforge. They explain how working in Unity helped them successfully reduce memory usage from 4 GB to 1.3 GB and achieve a 57% increase in frame rate.
SIMON LOCKERBY: Godforge is a turn-based squad RPG focused on mythology. You might fight with Ra, Zeus, or even one of the Mayan gods like Cizin, and go up against epic boss battles.
When we started working with Unity, some of the biggest challenges we had around optimization for mobile was around really size of build, the frame rate in game, and actually download speed.
We had a number of things that we wanted to try and optimize, including shader variants, pulling the frame rate up, reducing the size of our APK download, and overall download speed

SCALING PERFORMANCE OVER TIME
HISHAM SALEH: As we are growing and developing the game, it's not like a six-month project. This has been a long process. So the optimization targets and the target devices over time has actually shifted, and that's just an expectation.
We always want to be able to support as many mobile devices as we possibly can. We wanted to make sure that we had a beautiful PC build and so we've focused on making sure that the team knows here's the bottom, here's a benchmark of what you need to be able to achieve. And then we want to make it look as good as possible on the lowest and then on the mobile highest as a focus for this. Unity built a lot of tools for us to be able to do that.
SIMON LOCKERBY: That's really helped us future-proof because the tooling which came in from the Unity team. It helped us identify when large meshes are going in or duplicate meshes were going into the build, to make sure that we were using atlases right from the get-go, and all of these systems that have been put in place just means that we're able to control the future size of the build, future download speeds, frame rates, all that type of thing.
HISHAM SALEH: If I look at what we were really focused on, you know, these environments, these even characters, and what we're seeing onscreen. If you've got millions of polygons, which I think, not quite millions, but maybe a million polygons in a scene, and you're trying to load everything all at once, it's not going to load very fast.
So, occlusion calling really made it so we were able to do all the things that we wanted to do, everything could look really cool, but it could also load fast, and so the players would come in, they'd play the battle, and instead of it being, I don't even know, sometimes it was five or six seconds or something, it was ridiculous into, you know, it loads pretty snappy on a really great device and maybe like one secondor two seconds at a very maximum on the lowest end devices.

OPTIMIZING ASSET LOADING PERFORMANCE
SIMON LOCKERBY: The biggest thing was when we got all of ours, because we're a hero collector, we have a number of different heroes, over 200. So, we can have over 200 portraits for heroes available to a player at any time. So, getting those into an atlas just made the sort of load speed of our hero roster like lightning fast compared to what was horrendous.
HISHAM SALEH: Applying best practices to Addressables really reduced the CDN size and it really did so much for us. I mean, it was mainly about making sure that we didn't load things we didn't need to load, bringing things to the player when it was necessary, and not having tons and tons of versions and copies of it kind of floating around in the build.
Sometimes, when you're really focusing on getting things done and making sure that the game looks great and feels great, and plays well enough, you can lose sight of these best practices, and so you have to kind of go back and fix that.

IMPROVING MEMORY AND FRAME RATE
HISHAM SALEH: Asset tuning had the biggest impact on it, I would say. I think that when we were looking at a low-end device that has 2 to 3 GB of memory, it's rough for a game that has, of the quality bar that we're looking to do, and so optimizing mipmaps and making sure that everything was standardized and loaded properly and at the right time, really made it so it was possible for us to hit the bar that we were looking for.
SIMON LOCKERBY: We literally went from, I think it was a 4 GB of memory before we started to do these optimizations, down to 1.3 GB. So, it was a colossal change.
The Unity team was able to improve our shader variants by like 76%. They were able to improve our frame rate by 57%. There's some great tooling around identifying the type of device that was just trying to play the game.
So, you know, on load, we're able to choose a low, medium or high setting, depending on the type of device, and therefore it would be actually activating the right type of profiling for that device, which again is a real game changer for us when we sort of go into live.
Explore more Made with Unity games on our Steam Curator page, and check out more stories from Unity developers on the Unity Blog and Resource Hub.
