Tuesday, September 28, 2010

Minimum Requirements For Your Game

I think at a minimum, a game should provide:

  • Menu:
    • logical structure
  • Pause option:
    • have some way for the player to pause
  • Save and resume:
    • have some way to resume a saved game
  • User options: 
    • sound / music adjustment
    • controls adjustment (if applicable)
  • Credits:
    • developer info w/email
    • link to website / other games

So what are your minimum requirements for a game?

Wednesday, September 22, 2010

Stable or Cutting Edge?

So... when you are developing your next awesome cocos2d game / app which approach do you use?

[stable approach]
1. Take the stable release and never look back (forward).

[cutting edge approach]
2. Take the newest release and revise your application and always look forward.

I've been using the cutting edge approach on LoH and it's been okay but I'm sure I'd be further along if I took the (easier) path. You end up refactoring your code when and if things change but we are so close to version 1.0 that I think it's easier to keep up incrementally vs one huge update later on.

Cutting Edge
* Use the newest features and functions (like easily integrate UIKit stuff, e.g. Email / Game Center)
* Quick support on bug fixes and patches
* Enhances code

* Slower / longer development cycle
* Re-factor code
* Fix errors and debug

Is there a third option I have overlooked?

Friday, September 17, 2010

Batch Transform (transparent) Images

I used the following to remove the backgrounds from around 32,000 sprites in about 4 hours. My sprites are also now all in English with no spaces (only way I could get the Automator shell script to work).

Requires ImageMagick, an open source command line image processing utility. The easiest way to install it is by using MacPorts.

Phase One (prep all folders)
Pre-process Automator workflow to rename all sub folders from " " to "-" (eg "skel with sword" to "skel-with-sword"). This is required for the entire path all the way to (and including) the .png file, so to make it easy I moved my artwork folder to my desktop. This same workflow is also used to rename all the image files. Now that all the spaces have been removed the shell script inside the final Automator workflow will run without errors (yeah spent about 4 hours on that problem and if someone can get it to work with spaces in the path / file name, please let me know).

Phase Two (prep all sprites)
Using another Automator workflow, renamed all sprites to use English (e.g. Lauft = Running) words. I also used this script to update the base names (e.g. SkelSword, SkelStaff, SkelBow, etc). Note: this is not required at all but I figured while I was at it, might as well make the files easier for me to use.

Phase Three (individual sprite folders)
1: Copy one of the sprite images to the desktop, rename it "background.png" and then open in Pixen and make it a solid color using the existing background. This file is then used by the shell script with ImageMagick to remove itself, i.e. make transparent, against the other image(s).
2: To process we run a third Automator workflow and select all the images to be made transparent (that match background.png). Repeat steps 1 & 2 above for each folder of sprites.
Note: if you skip step 1 because the background looks really close to the previous one, you may end up with 3/4 sprites (I know I did!) and it wasn't worth the few seconds it takes to create the new background.png file.
Speed: On my 2.4GHz iMac it would take less than 2 minutes to process ~600 images. At this point if you have the folder displayed in Finder with preview on, you'll see the new transparent images as they are processed.

Okay now that I'm typing all this out I'm thinking, WTF is wrong with me? But it actually worked very well and fast! Now it is very easy for me to repeat this process and I have re-used these Automator workflows many times.

It was actually very good that I recorded the process while it was still somewhat fresh, in case I ever have the need to repeat the process.

Note: I have included a link to my Automator workflows for anyone that wants to use them. If you do happen to get it to work with files / path names with spaces in them, please let me know. Thanks

Testing Your Game Center Apps

Update: October 6th, 2010 - looks like there are some new Sandbox screens. I'll try and update the images.

So now that you can access Game Center on your (compatible) iOS device running 4.1 (or higher). Testing your own GC apps is now a bit of a snafu.

Here's what I have found: First, you'll need to get your app setup in iTunes Connect (see Apple Docs). You'll need to test a debug or ad-hoc build, I have found both of these builds will work (in case you see it posted elsewhere that you must use a debug only build). 

Once you install your test app on your device;
1. Launch Game Center and tap your email, select "Sign Out" and now close Game Center.
2. Open Settings, tap Store and tap logout (this helped me once and I still do it, not sure if it's required but it certainly won't hurt). 
3. Now launch your test app and sign-in with a sandbox test account OR (better still) create a new account. 
Note: I use a bogus email account since I don't have email addresses hanging around for testing purposes. I will try to grab and post a screen-shot because once you launch the sandbox version of GC you'll notice the new account setup screen is noticeably different.

First Clue: Login to sandbox:

Sandbox Signup:

Production Signup:

Tuesday, September 14, 2010

iOS Developer Utilities

Open Source iOS Add-ons

There are several open source iOS add-ons that I use and maybe there are some developers that do not know about them. Here's my listing:

* In-App Purchasing: Excellent blog post with source code to easily add In-App Purchasing to your app. The only thing that I have updated is to use the keychain and not NSUserDefaults. See Keychain Access below.

* Ask for Review: Add this to pop-up an alert after X-days or X-launches of your app and prompt the use for a review.

* Keychain Access: Add this to easily access (store and retrieve) data from the secure keychain. Use it in combination with In-App purchases for an increase in security.

* Mobile App-Sales: Use this to track your iTunes Sales info (jonkean's branch works now).

* Three20: I personally don't use it but many developers do.

I will keep this post updated as I find new ones too.