Are you developing a game in Unity? In this article you read what measures you can take in advance, so porting to console will be a cinch!
This article is written to advise developers on how they can best optimize their Unity game before the process of porting begins. It does not describe the installation, and use, of platform-specific SDKs.
In this article, I want to focus on the three largest console platforms of the moment: the (original) Nintendo Switch, PlayStation 4/5, & Xbox One/Series. Of course, I’ll talk about how to prepare your game for porting to these platforms, but I also would like to shed some light on why you might want to prioritize one platform, or avoid the other.
Does your game play great with a controller? For example, if your game features many touchscreen-based puzzles, it might be difficult to port your game to PlayStation or Xbox, without losing its essence.
I recommend taking a look at what features each platform has, if it suits your game, and what similar games are doing. If possible, I highly recommend playing the games—similar to yours—on the different consoles, this way you can learn what it is you are looking for. If you cannot find a competitor’s game on a specific platform, there might be a good reason behind that.
Making sure your game plays great on a controller, will make it really easy to port your game over to console. I highly recommend using the new Input System, this assures that your controls will work pretty much directly when building the game for console (Rewired works too).
If you have an Xbox or PlayStation controller, you can already design and test your game to be played with it on PC.
Assuming your game uses Application.persistentDataPath to store save data, you should consider that each console has its own SDK that we have to use for saving, instead of persistentDataPath. Additionally, when you try to access Application.persistentDataPath on console, the application usually crashes immediately.
I recommend putting all your references to persistentDataPath between Platform Defines, designing your save system to support asynchronous saving/loading, and making sure you have the option to create playable builds that don’t depend on save data.
Performance is one of the larger struggles of porting your game to console, specific assets (or complete levels!) need to be completely remade to match the power of the machine.
In this article I won’t go into specific optimizations, I think there are a lot of resources online on how to optimize your game (most notably to keep the batch count low!).
However, I would like to give you advice on how you can benchmark your game, in advance, when you do not have access to development hardware.
If you are planning to launch your title on the (original) Nintendo Switch, I recommend benchmarking your game on an older Android phone/tablet. Assuming you added controller support, you can just connect a modern Xbox controller through Bluetooth and it should work fine.
This way, you can already get an indication of the performance, and start optimizing your game for Switch.
If you are planning to launch your title on Xbox & PlayStation, I would just make sure your game runs smoothly on a midrange gaming PC.
It is important that your project uses a recent version of Unity that is supported by all the platforms you want to launch on. A two-year-old LTS release of Unity is often still supported by most console SDKs, while a Tech Stream release might not.
When you don’t have access to the developer networks of your target consoles, I would recommend choosing one of the most recent LTS releases of Unity. LTS stands for Long Term Support, meaning that this release will be supported for a longer time, usually around 2-3 years.
Some consoles have a patch file size limit. When you create a patch for your game, Unity will compare the new build with the original—first submitted—build. This binary comparison creates a patch that only contains the differences between the versions. It is this patch that has a guideline on file size limit on some platforms.
In Unity, it is very easy to go over the max patch size if you do not structure your project properly.
To combat this, we use Asset Bundles, or Addressables (Addressables are a layer on top of Asset Bundles and are usually more convenient). Asset Bundles structure the data better, so that there will be fewer differences found during the binary comparison, resulting in smaller patches.
Additionally, using Asset Bundles/Addressables could also help conserve battery life on handhelds, like on the Nintendo Switch.
This is how you can prepare your game (with Addressables):
I hope you found this article insightful and that it can be of help for your own projects! This article was specifically made for the Unity game engine, but I am exploring the landscape of other game engines. Maybe there can be another preparation guide in the future, for Godot or Unreal.
Feel free to reach out if you have any questions about console porting!