As mentioned last month, I recently started to port my game to Xbox One and was shocked to see the performance at the beginning. This was partly due to me not doing things well and brute forcing lots of things on the PC. Is it Unity related too? who knows but I am not a great programmer and like to hack things together 🙂
Before I briefly talk about it, here it is running WITHOUT any optimisation for Xbox One.
https://streamable.com/e/fi7ud
As you can see, the framerate was appalling and something that you cannot see here are the broken levels (procedural generation issues).
I had to take a step back and profile the game like mad and ended up with the following fixes that worked for my game.
- Image Effects
- Ambient Occlusion was quite a killer so I dropped quality although you cannot notice it
- Motion Blur sample dropped to its lowest
- Removed all unnecessary scripts related to image effects
- Removed all unnecessary audio from environmental objects (torch fires for example) – I will revisit this down the line
- Removed all animator components that I left in there from importing objects
- Implemented layerCullDistances instead of just using the far clip plane for everything
- Particles and detail objects on a different layer etc…
- Turned off Motion Vectors on objects that were unecessary
- Redo my procgen dungeon code to stop levels breaking (not performance related but still needed fixing)
Theres probably a fair amount i’m missing here but you get the general idea. Anyway, after all of the above plus more the game was finally running at a stable framerate that I was happy with. This can also run at 4k on the Xbox One X. It was also interesting to find out that I was able to make it playable on my primary dev computer (Macbook Air 2012) and boosted performance by at least 110%-130%. I can even turn on real time shadows on my macbook when developing! its pretty awesome 🙂
Heres the progress on March 10th with much better performance.
The Second Week
Last week, I started to get more bandwidth to improve the game dramatically. This included even better particles for certain enemies which also ran great on the Xbox One.
This was the first test to improve the particle systems but at the same time making sure it ran ok on the Xbox One. When I was happy with the frame rate and performance, I then added a few more different attacks to spice up the gameplay.
Today
Now this brings me to today. For the last week or so I have been heavily updating the existing House HUB scene. This included batching objects properly, reducing 36 reflection probes down to just 2 and also removing all backfaces where possible. This was the last main chunk of work in optimising the existing scenes and you can see the great results here.
With all this work now completed, it should be easier with the new knowledge at hand.