Archive for July, 2010

ASIPathFinder

Here’s a nice looking piece of code to help you out with that next great RTS game you’re planning on writing for the iPhone; from the same dude responsible for the awesome ASIHTTPRequest, it’s ASIPathFinder!

What is ASIPathFinder?

ASIPathFinder is a complete implementation of a cooperative path finding algorithm, and will probably be most useful for writing Real Time Strategy games. It is written in Objective-C, and is compatible with Mac OS and iPhone OS.

What is a co-operative path finder?

asipathfinder.png

A co-operative path finder allows multiple objects to find a path on a map, planning ahead to alert other objects of where they’re going to travel. This means that an object can avoid other objects ahead of time, before they collide.

It’s said to be based on the techniques described in this paper, but if you’d rather just see it in action, why yes there is an app for that:

ASIPathFinder is based on code I originally wrote for my Space Harvest game for iPod Touch and iPhone.Download the game to get a feel for its capabilities.

SpaceHarvest

So there you go, BSD-licensed and everything, documentation here and project on github!

Continue Reading →
3

UI Automation

Here is a great walkthrough of how to get started with UI Automation that new UI scripting test goodness you may have noticed in the latest SDK, in between trying to get all your previous projects up to speed, if you’re anything like us:

In this post we’re going to look at the UI Automation library/tool that Apple added to iOS SDK 4.0. This is a huge step forward for test automation on the iOS platform. While it’s not without some compromises, it’s worth looking at to see if you can reduce the time you spend on manual testing.

UI Automation is both a probe for Instruments as well as a JavaScript library provided by Apple to exercise and validate a running application. In this case, “running application” isn’t restricted to the simulator—you can also automate the application on a real device. To my knowledge, this is the first time I’ve heard of anyone being able to do this.

This is huge. Having the ability to automate workflows in your application yields two benefits: you cut down on manual testing which saves you time, and you can rely less on your memory to execute all your tests. Instead, you just push a button (okay, two or three buttons) and run your full regression suite. Have I piqued your interest yet?

Excellent stuff!

UPDATE:

And check out the post-mortem post, More UIAutomation!

Continue Reading →
4

iAds + Burstly

So you’ve probably checked some into the Apple iAd Network by this point and found they look pretty easy to set up, but if not here’s some links to get you up to speed:

iAd Network Resource Center

How To Integrate iAd into Your iPhone App

How To Guide For Apple iAds

All About Apples iAds

and perhaps you’ve heard that while the first few out of the gate with iAds are making some good coin at the moment, fill rates are pretty low; and just at a guess, we’d kinda suspect that iAd enabled apps are going to outstrip the growth in ads pretty seriously so you’re not going to be seeing Magical Money Fountain™ posts like that too much longer.

And besides that, there’s the issues that iAds are only available a) in the U.S. b) on iOS 4 devices. Both of which will probably become not so important in the future sure, but still some concern presently. What to do about that?

Well hey, look what’s out today:

Announcing Burstly 4.0 SDK with iAd Support

You may recall when we checked out Burstly a couple months back we were pretty impressed, although we haven’t got around to actually doing anything with it (that’s part of project #6 on the OhMiGAWDItsNotDoneYET List…) yet; so now that it includes the iAd network, looks like it’s even more so the preferred platform for your monetization efforts now. But be sure to let us know if you have any actual experience either way!

Continue Reading →
2

GameFontMaker

Here’s a handy tool for your bitmap font creation needs, GameFontMaker:

… So, I present to you what I think may be the first native Cocoa bitmap font creation tool for games, GameFontMaker!

At least, I think it is… Maybe… I didn’t do a lot of research, but I have seen a lot of fellow iOS devs wishing something like this existed for OS X, as the only other alternative runs under Windows.

Even if it isn’t, I was getting sick and tired of my really awful bitmap font creation tool that used FTGL, SDL and duct tape and generally produced hideous bitmaps without a lot of fudging of numbers. This is much, much better than that.

Yep, it’s pretty basic so far, but it does the trick of stamping out any installed font into a .png and providing a descriptive xml file with glyph attributes, so hey that’s a start!

UPDATE:

Project home page is here for latest build and now GPL’d source!

Continue Reading →
1

Runtime Compatibility

Here’s a good article on how to write code that deals appropriately with current runtime iOS versions:

Tips & Tricks for conditional iOS3, iOS3.2 and iOS4 code

Make sure you read the comments too; in particular, we like this trick for dealing with deprecated methods

Make a @protocol, eg DeprecatedMethods, that defines the deprecated methods, then cast, eg [x setText:@"foo"] to [(id<deprecatedmethods>)x setText:@"foo"]. No more compiler warnings, and the deprecated methods are still obvious in the source.

as we’re firmly in the “all possible warnings on, and warnings are errors” development style camp, but sometimes you just really have to use a deprecated method. That’s a very stylish method indeed of resolving that conundrum.

There is a particular kind of runtime compatibility that may cause you particular grief next time you’re updating though; MPMoviePlayerViewController is the new way to play movies in any target view, but it seems that the behaviour of the old MPMoviePlayerController has been changed when linking against the 4.0 SDK, so soon as you recompile your project hilarity ensues. Here’s an article over at Dr. Touch about the issues:

The 3.2 Hurdle of MPMoviePlayerController

as of today you’ll note it says

… I had to revert to compiling against SDK 3.2 and disable the 4.0 code for the time being. Will open an inquiry with Apple later…

So if you’ve got some MPMoviePlayerController code that needs updating, watch out for issues!

UPDATE:

Here’s another post on dealing with the movie playing thing:

Getting MPMoviePlayerController to Cooperate with iOS4, 3.2 (iPad) and Earlier Versions of iPhone SDK

UPDATE 2:

And another …

Play Video with MPMoviePlayerController in iOS 3.0 and 3.2/4.0

Continue Reading →
1

Accessing The Cloud

For those of us who haven’t bothered paying much attention to that whole server side of things, here’s a nice gentle introduction:

Accessing The Cloud From Cocoa Touch

Walks you through POSTing data to the server, which chances are you’ve had to handle at some point by now; but also shows some simple server PHP code for handling that data, and has some basic recommendations for server side development. Nothing too terribly deep, but if you’re as blissfully unconcerned with server programming other than “hire a web guy” as we’ve been to date, this would be worth a read no doubt!

Continue Reading →
0

ThoMoNetworking

Here’s an interesting looking abstraction for your local communication needs: ThoMoNetworking!

Writing network code for Cocoa or iPhone/iPad apps isn’t terribly difficult – but it’s not very exciting either.

Want to exchange objects between two processes, on the same machine or remotely, without having to dig down into the C API of Core Foundation? Then ThoMoNetworking is for you.

ThoMoNetworking gives you client and server classes that connect automatically via Bonjour – nothing to do on your side. Pass an object to the server, and it will pop out at the client, and vice versa. If you want, have your object distributed to all connected clients in one go. It couldn’t be much simpler.

No, it really couldn’t. A handful of lines for all this, working with any object conforming to NSCoding:

But wait, there’s more that you get for free with ThoMoNetworking without having to worry about it ever again:

  • Sockets – we use them so you don’t have to
  • Bonjour – your servers and clients will find each other on the local network automatically, no need to mess with IP addresses and port number
  • Handling dropped connections – ThoMoNetworking will immediately reconnect or notify you if the other side is no longer available on the network
  • Asynchronous network calls – we handle all the threading for you so that your main thread does not have to wait for the network

All your base are belong to us – works out-of-the-box on OS X, iPhone, and iPad.

That does look pretty darn handy, indeed. Especially if you have some desktop <-> iDevice connectivity in mind. Download the source here!

h/t: MacOSXHints!

Continue Reading →
0

Tip: Quit In iOS4

So there’s certain classes of apps for which being backgrounded under iOS4 is more trouble than it’s worth; and if you’re wishing you could have the old school behaviour back and to Hades with this multitasking thing, here’s the trick

Fortunately there is a simple way to make your iOS 4 apps terminate for real when the user taps the home button.

This is a simple process:

1. Open your info.plist file

2. Add The Key UIApplicationExitsOnSuspend

3. Set the new key to YES

Now your applicationwillterminate: method will be run when the user taps the home key, and your app will exit for real.

Now you know!

Continue Reading →
1
Page 3 of 3 123