During the recent week, I managed to get some real progress done on my Ark-Anti-Noid prototype. I was very close to scrapping it alltogether, but fortunately I was able to resolve all the problems I had with it.
As this game is designed to be played on mobile devices, this poses quite a few new challenges. I stumbled on one of them this previous week.
Unity is reporting touches on the iPad screen in pixels, so obviously we need to transform them into world coordinates by using
Camera.ScreenToWorldPoint on them. Which in turn - for 2D games - is using the ortographic size of the camera to do the calculation. Which is all fine and dandy, unless you make one simple mistake - have more than one scene and by accident you set the ortographic size in the first scene to be different from the one in the other scene. I had this done - my menu screen would have an ortographic size of 5 while the camera scaler script would scale the game scene to 3.2, in order to keep everything visible on the screen.
This simple mistake results in the world coordinates being calculated using the wrong size, so they are offset from where you actually touch the screen.
I spent about three evenings on trying to debug this, going through several mobile builds with increasing level of debug messaging. At the end I’ve decided to log the ortographic size of the camera as well and this clued me into this rather simple bug.
Another challenge wasn’t really code related. Since I use an iPad to test the game, I need to use Xcode as well. Every project there needs to be signed with a provisioning profile, so I’ve made a development one in order not to pay Apple anything yet.
Unfortunately, you have to select this profile every time in Xcode by hand, since it doesn’t have any way to set a profile as a default. You can set it in Unity and it will set it in the exported Xcode project, saving you the time to do so, but.
The Automatic Signing Team ID setting looks like this and offers no help whatsoever as to what should be entered in the field. Is it my name? My email? Unity’s documentation is not helpful either, refering me to Apple’s Developer Portal, which is pretty useless as the free development profile is not listed there and exists only in my Xcode.
And in Xcode is where you can see it. Not in any menu, not anywhere else, just in this small info icon I wouldn’t ever thought to click on, because what do I care? Well, apparently I should. This short random code in a parentheses is what you should enter as Team ID in Unity.
After dealing with all the mobile problems, I had another, even more tougher one - this game was not fun at all. At least I thought so, and I made it, so I should know if it’s fun, right? I didn’t like the gameplay at all. It should be fun, but it was just missing something important. I was almost ready to throw it out - after all, that’s what you should be doing with failed prototypes.
But then I had an idea, which in retrospect was simple enough that I really should do it this way from the beginning. I’ve added just two features to the game, improving it quite a lot in the process.
First, spawning a brick now costs points (and I’ve fiddled with the speed at which the player is awarded the points for the time played, so overall it feels like the game is a bit faster without me doing anything). This restricts the player from spamming bricks all over the screen - they can still do that, but they won’t get many points in that case.
Second new thing was adding some indestructible bricks to the field. This makes the bounces that the balls do more interesting and I can play with the positioning of these bricks to make it even better.
I still should balance the game further, but I think it has reached a point where I should invest some time to make it look better. I set out to do this with very basic graphics on purpose, but there are still things (like menus, UI, some subtle gradients in the background) that I can easily do most of it.