How did we get here?

Just what are we doing here? Well, two years ago (wow has it been that long already?) two friends and myself kicked into high gear on developing a card game. We were known for our crazy ideas and would often spend time over lunch breaks at work talking about the perfect BBQ restaurant, new inventions for the home, games we could make. Anything that struck our fancy that day, we talked about it. At that point in time we started to latch on to this idea of a card game based on food. That idea grew and eventually became a project on Kickstarter that funded. If you want more background on the development of the physical card game take a look at our story page.

What I want to talk about is how we got to where we are now. Even back then we toyed with the idea of an iOS game instead of a physical card game. None of us knew anything about the process of launching an iOS app, let alone a card game so we stuck with a physical card game. I actually had experience with some iOS development from projects at work, but nothing that ever even approached being published in the App Store.

Registering the App with Apple

dontpanicWell, about two or three months ago we started talking about an iOS app again. After a few days of talking it over and wondering if we could really manage to pull it off I created an app on iTunes Connect so that I could mess around with the Game Center API and figure out how easy it would be to build our game with that. That was only two months ago. December 29, 2014 to be specific. And immediately after clicking the Create button I began to panic. There was a problem with what I had just done. A really big problem.

Since day one, Apple has had a six month limit on how long you can have an App entry on iTunes Connect that hasn’t been published to the App Store. This is to prevent people from parking App titles and then selling them for loads of money later – kind of like domain parking. No big deal, I lose the name and have to re-register right? Wrong. Apple’s rules are (were) that once those six months are up and you lose the name, you can never have it back. Oh crap. With sweat dripping down my face at the realization that I may have royally screwed us over I began to search the Internet to see if there were any loopholes or ways around it. I found one article, that was one month old, from somebody talking about how they were kind of in the same boat. They had just e-mailed Apple and asked and were told that was no longer the rules. Hope! There was hope! With trembling fingers I filled out the online contact form on the Apple site asking if that was indeed the case, and if not could I possibly undo what I had just done.

Saving grace. Indeed Apple no longer gives people a six month limit. You can take as long as you want to publish your app. Why do I tell you all this? Well the reason I was so panicked was because I knew there was no way we could complete the game in six months. I mean no way, no how, just not possible. Well, we are now two months and three days later. Last night I played my first game (with myself on a second device) via Game Center. It actually worked! We had a functional game (albeit incomplete) that could be played online with other people.

Whats the big deal? Just write some code!

Matt has no concept of how hard it is to code something. Seriously. “Hey man, can you make the entire screen rotate on a 3D cubicle axis and pulsate in time with the music?” Okay, he never really said anything like that. But it is truly funny how neither of us really have any idea how hard the other’s job is. We both have a little idea as we have dabbled in each other’s worlds a bit, but the truth is I have no idea how much work it is for Matt when I ask him if he can tweak the layout a bit because I don’t think it will translate well in code.

On the flip side, sometimes he thinks something will be really hard for me to do and is super hesitant to even mention it. Then he gets shocked when I say “no problem, you mean like this?” and boom it’s done. Granted, that doesn’t happen often. But every once in a while that happens to both of us. We think something is going to be super complicated and then find out it was super easy. And vice versa.

Kind of like exporting a new binary for testing. We use Dropbox for deploying our binaries (maybe I’ll write a post on how we did that next week) so that I don’t need to physically have his device to load the latest build for testing. Been working like a charm for weeks. Until last week. For the past few weeks I have been doing a side job for another church. They have an iPhone app that broke with iOS 8 and needed updating so it would run again. I’ve been working with them on it to bring it up to snuff (it was last touched back in iOS 4) and last week we were ready to submit it to Apple.

So I do the normal thing, refresh the certificates for that account, build, upload and do all the submission to Apple. Couple days later I am trying to push a new binary to Dropbox for Matt to give a try to. “Cannot install”. What do you mean ‘cannot install’? I do this nearly every day. Okay, maybe I clicked the wrong button somewhere. Do it again. “Cannot install”. Grrrgh! Well after ten or fifteen minutes I finally refresh my certificate, just for kicks and try the export again. Boom! Works like a charm. Gah. Whatever. Somehow when I refreshed the production certificate, for the other account, it screwed up my developer certificate on my personal account. Go figure.

Problems? Apple never have problems.

Okay so, I learned two things last week about Xcode / Interface Builder (okay it’s not actually called that anymore since it is a part of Xcode, but it will always be IB to me). First, when you are using the new device capabilities system for having different images based on which device it is loading on (regular, compact, etc.), things don’t always work like you would expect. With the sizing system you can identify 3 different types of devices. iPhone 4s-6 (Compact x Compact); iPhone 6+ (Regular x Compact); and iPad (Regular x Regular). Because of the different screen sizes we wanted different image sizes for each of those categories. I don’t just mean scaled size, I mean sometimes a different aspect ratio altogether.

No worries. Apple’s new Asset Catalogs allow you to do just that. Weeeeeelllll, there is a minor glitch there. When working with, say, the iPhone 6+ (a 3x scale device) you would expect to put your image in the Regular-Compact 3x spot for the image. And sure enough, that is the one that the phone loads when you run it. However, in Interface Builder it seems to run in 2x mode, even when you tell it to simulate an iPhone 6+ size. So it tries to load the Regular-Compact 2x image, only there isn’t one. As a fallback, it loads the Any-Any or Compact-Compact image at 2x instead. Great. That’s the wrong size image you moron. This seems to happen with two different specific image sizes that we were trying to use. The solution I came up with was to double up the images, thus taking up more space on disk. Janky, but it works until Apple fixes that.

One more little oddity in Interface Builder. They have these really cool new auto-layout systems in place that let you dynamically size and position elements based on screen size and space. You can even do things like ratios. Unfortunately, it seems Apple forget to check for divide-by-zero when calculating the ratios. If you have something that sizes based on a ratio of another element, and that other element (for whatever reason) has a size of zero pixels – instant crash. Goodbye last ten minutes of new auto-layout configuration. Sigh.

We need more devices!

allyouripadAs soon as we started playing with the Game Center API in actual use it became very obvious why Apple recommends you have multiple dedicated iOS devices for development and testing purposes. Our first clue was when we realized we needed to see the game in action on a few different devices since the simulator only tells you so much. I mean, it is pretty close to actual size, but there is just something different about tapping a button instead of clicking it. A button that seems perfectly large on my laptop is suddenly really hard to hit with Matt’s phat fingers. Well, we both have phones and iPads so that will work out okay.

A second clue hit when I went to test my first Game Center connection between my iPad and my iPhone… which were both using the same account. If my phone could have talked I’m sure it would have said, “what are you, stupid? You want to play with yourself?” Yea, kinda hard to invite your own Game Center account to a game with yourself. I suppose I could change my Game Center account on one device, but that would screw up all my personal games that I play. I needed another device. Guess I would just have to look on eBay for an older iPad or something to buy.

As luck(?) would have it, Matt’s daughter dropped his wife’s iPad and cracked the screen. Not bad, but enough that they didn’t want the kids (or even his wife) playing with it and possibly slicing a finger open. Well that ain’t no thang. I’m a big boy, I can deal with a little blood smeared over my laptop keyboard. So Matt’s wife graciously allowed us to use her old iPad as a test device, and as a bonus it was still running iOS 7 so we could also test on a live iOS 7 device too!

Week 1 : Daniel