The experience of porting X-Morph: Defense to Nintendo Switch
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.
It’s been quite a while since we shared the last piece of information about the X-Morph: Defense port for Nintendo Switch. We have an excuse for that, and it’s a good one - the game is almost ready! We spent the last couple of weeks working really hard to make the gaming experience on the Switch as smooth as possible. It has been an exciting process and we have also learned a lot from it. What follows is quite a detailed description of what’s been going on (there’s also a TL;DR version, just scroll down).
We made sure to transfer the whole X-Morph: Defense experience to the Nintendo Switch.
At first, we did not plan to develop X-Morph: Defense for the Nintendo Switch. Even though many people have been asking for it we just kept saying no. We were aware that porting the game to the Nintendo Switch would prove to be a challenge. Packing so much content and keeping the quality consistently high on mobile hardware is no easy feat. All the requests from players have stayed in the back of our minds and we finally decided to give it a try. So, in a sense, you have made it happen.
During the campaign, you will see all the levels, weapons and enemies known from the other versions.
X-Morph: Defense is quite a demanding game even for the latest consoles. The amount of visual effects and physics calculations keeps all the processing cores saturated with work at 100% most of the time. Nintendo Switch is a significantly less powerful device due to its portable nature. It meant we had to optimize many elements while keeping the experience largely unchanged. Therefore, we set some goals for ourselves. Stable performance, no gameplay changes, the same level of destruction, in both docked and handheld modes.
The new towers are available with the base game at launch.
Stable performance was the first one. Our aim was to achieve 30 frames per second both in handheld and docked mode. After we got the game up and running we began performance profiling to find problematic parts of the game. Through trial and error, we arrived at a stable 30FPS in 720p in handheld mode, without the visuals taking a big hit. Sure, we had to cut some props here and there and reduce some particle effects, but the game looks and plays great in handheld mode.
Our team has pushed the Switch hardware to its limits, EXOR never gives up on explosions!
As for the docked mode, we tried 1080p at first. An important fact here is that in 1080p the device has to render over twice as many pixels as in 720p. Unfortunately, the Switch does not become twice as fast in docked mode and the performance wasn’t satisfactory. Cutting objects from the game was out of the question since we didn’t want the handheld version to suffer. Therefore, we decided to reduce the resolution to 900p. Unfortunately, that wasn’t enough, so we also reduced the size of the post-processing buffer responsible for HDR bloom. The difference in rendering quality is negligible, but it gave us an extra 2-millisecond boost in frame rendering time that allowed us to equalize the handheld and docked performance.
The gameplay is dynamic and responsive, as you have to constantly adapt to the types of enemies attacking your core.
The gameplay itself is exactly what you saw in other versions of X-Morph: Defense. The number of enemies has not been reduced, all the missions are the same and all the levels play out exactly as you would expect them to. We had to reduce the amount of debris left by the enemies, but we compensate for that with added score multipliers, counting both for the resource gathering and the final score. Some maps have undergone cosmetic changes to reduce the strain on the hardware, but these changes have no effect on the gameplay.
The destructible environment has always been one of the biggest advantages of the game. Keeping this feature and maintaining performance required some clever trickery.
The destructible environment was a big challenge. Buildings consisting of physical chunks require the device to render a huge amount of polygons and it was too much for Nintendo’s handheld. To combat that, we made custom, static versions of all physically simulated destructible objects in the game, which we swap for the dynamic versions once they are damaged. This saves up performance when it comes to the polygon count, but costs 90MB of system memory in our case. It is a lot. Nintendo Switch has a lot less memory on board than the PS4 or Xbox One. Just to get the game running we had to reduce memory usage by about 30%. Code optimization, texture size reduction, and sound compression got us there, but it was not a cakewalk. Memory fragmentation was one of the greatest issues, causing crashes and rendering the game unplayable. We fixed the stability by allocating static memory pools for the game components, such as sounds, particles, GUI, videos and save files. We eventually managed to stick to the limits.
Even though we had to cut down on some visual effects, the game still looks gorgeous.
The only gameplay feature we had to cut is the co-op mode. Our split-screen mode requires the device to render almost twice as many elements as in the single-player mode. It doesn’t mean that all calculations are done twice - the physics, AI, or pathfinding require only a single operation. Our experience from working with other platforms shows that split-screen requires about 30% more processing power. Such a number exists under the assumption that we have some spare CPU cores and we can use them to parallelize some calculations. We do not have this luxury on the Switch - we use 100% of resources at all times. It means we would have to cut down on some features and do a lot of extra work. This is why we decided to leave the split-screen out from the game for now. We do not rule it out in the future, but can’t promise anything at this point.
The red-hot rivers of lava on Iceland are one of the most eye-catching features in X-Morph: Defense.
We know that download sizes are a big concern in the Switch community. Through numerous optimizations, we have reduced the package size from over 4GB to just a little bit over 1.6GB. Among other things, we have used OGG Vorbis compression on our audio files and removed the 4K-ready textures, as they would never be utilized anyway. Moreover, this is the first release of the game on the Switch, meaning we do not need to keep older versions of the maps just to keep save files compatible. This way you will be able to have X-Morph: Defense installed alongside other games, without worrying about the free space on your device.
The boss fights remain as epic as ever.
X-Morph: Defense will be available together with all the updates that were previously released on other platforms. It means that you will be able to enjoy the survival mode, additional tower types and all the little changes that happened over the course of the game’s lifetime. All the pieces of premium DLC will be available for purchase day one. We also do not raise the cost of the game - it will be around the $20 price point, with currency-specific adjustments.
Tricking your enemies into taking a suboptimal route is very important. The control scheme remained unchanged, so you have perfect control over the battlefield.
Last, but not the least important is the release date. We wanted the game to be released before the end of 2018. The reality has verified our plans, but the delay is not that big. X-Morph: defense will become available on Nintendo eShop in very early 2019. We are also looking into releasing a physical edition of the game - we will share more info about this as soon as everything is 100% confirmed.
And finally - TL;DR:
- Very early 2019.
- The base game has all the free updates that were previously released on other platforms.
- All DLC available for purchase at launch.
- 720p/30FPS handheld, 900p/30FPS docked.
- All gameplay features including fully destructible environments and building physics remain except split-screen co-op.
- 1.6GB install size.
- $20 price point with currency-specific adjustments (check Steam pricing for reference).
- No gameplay changes.
- Digital download from Nintendo eShop.
- We’re looking into physical release options.
Developing the Nintendo Switch version has been a challenge, pointing out problems we did not know about and allowing us to optimize the game beyond what we imagined. All the optimizations will also find their way onto other platforms with future patches. This way our fans can enjoy improved performance on all devices. We hope you’ll have as much fun playing it as we had working on it.
Let us know if you have any further questions!