Porting Games: Tips and Tricks
First to note, my experience is limited on this front, so I’m going to mainly focus on my thoughts and troubles that I went to porting Spartan Villa to the desktop.
For those who don’t know about the game Spartan Villa, it is a iPad/iPhone game using Unity3D (check it out, ponder its meaning, download it, and love it). I was charged with the task of porting it over to PC/Mac and possibly Android. Now, we all can say that Unity makes it easy to port games to different platforms, but there are still some things you need to consider:
- You only have 1 real input method.
- You need to try and maintain the code base with all platforms.
- Make sure your game makes sense in all platforms.
You only have 1 real input method
DISCLAIMER: Every game is different so this may not apply to you! Just things to keep in mind.
Now before you start yelling at me, let me explain. Going from the mobile space to desktop, you don’t want to retrain the player how to play your game. They are used to using their finger to drag, pinch, and swipe. And what’s the greatest thing about mobile platforms? Precise input. What else has precise input? THE MOUSE! Don’t get me wrong; if you pull up the keyboard on the mobile device, then obviously you need to use the keyboard on the desktop. But your main input is going to be the mouse, and for obvious reasons.
Obviously you can replicate the pushing down and sliding input to the mouse. The problem then lies with transitioning the multi-touch inputs to the mouse. The most famous one is the zoom feature, which is easily tied to the scroll wheel. But if your game has more multi-touch than just that, its going to be a challenge not with the implementation, but what would feel natural to the player. Speaking about implementation….
You need to try and maintain the code base with all platforms
Now this will apply to everyone. No one wants to rewrite the entire game for a different platform. So it should be your main focus to try and make changes whenever it is necessary. The biggest and obvious task is going to be input.
Now, I want to make this as clear as possible…..KEEP YOUR INPUTS IN ONE PLACE!!! This will make your life so much easier in the long run, because that’s really the only thing you need to change. If you have Input.GetTouch() in multiple spots within even 1 script, you are doing it wrong. It will always be wise to separate functionality from input.
Now, the nice thing is that sometimes all you need to do for your port is switch all touch positions to the mouse position and instead of finding out if there is more than 1 touch you can just see the delta from the mouse scroll wheel. BUT you have to be smart about how to go about doing this. Take advantage of the #if to exclude based on platforms so you aren’t running code that you don’t need to. That just make sense.
Make sure your game makes sense in all platforms
This is more of a design thing, but if you are teaching your player how to do the controls and you have finger movements, it doesn’t make sense to have that in a desktop setting. I found this out when I remembered that the tutorial is mobile orientated, so parts of it had to be remade for the desktop. But it’s the little stuff that’s going to make you look stupid if you keep it for all platforms. That’s really the only spot that I had encountered that needed be changed, but it is a lesson you need to learn.
So if you can help it, try to make your game as much platform-independent as you can. I know that’s rather hard, but if porting is in the future, then KEEP YOUR INPUTS SEPARATE!