Battle for Vesta Bug Details
by john on Jul.22, 2010, under Uncategorized
This is a strange one. Battle for Vesta has run solidly since version 1. No crashes, problems launching, or other problems. For version 2.2 I tested it on my iPhone 3GS, iPhone 3G, and iPad. I also ran it on the iPhone 4 in the simmulator. I didn’t see a problem with any of these systems.
After v 2.2 went live I began to get reviews saying that the app doesn’t do anything. This was concerning as I wasn’t able to replicate the problem on any of my hardware. Eventually it became clear that the problem only affected iPod Touch owners, so I borrowed my brother’s and was able to replicate it.
I started putting breakpoints in my code yet the debugger wasn’t hitting any of them. Finally I put one in main.m and was able to see the debugger hit:
int retVal = UIApplicationMain(argc, argv, nil, nil);
But once it entered UIApplicationMain nothing seemed to happen. It is pretty tough to debug something that the debugger won’t let you see.
I started retracing my steps and looking at what I had done to enable the Retina Display and Universal Binary aspects of the update. The first thing that I did was look at the Info.plist file entries. The Universal Binary instructions that I followed had suggested splitting the “Main nib file base name” entry into two entries: “Main nib file base name (iPhone)” which points to the iPhone (and I assumed iPod Touch) version of the nib file and “Main nib file base name (iPad)” which of course points to the iPad version. That turned out to be the problem. I added the old “Main nib file base name” entry again, pointing to the iPhone/iPod Touch version and everything worked again.
I find it very odd that the iPod Touch wouldn’t look for the iPhone version of the file, but live and learn.
I have submitted a 2.2.1 update to Apple. I’ve also made Battle for Vesta free in the meantime, so that nobody pays money for an app that doesn’t currently run on iPod Touch. Once the update goes live I’ll put the price back at $2.
Update:
The bug also appears on iPhones under iOS 3.1.3 but not iOS 4.
Update 2:
The 2.2.1 update is live. Battle for Vesta will remain free for the rest of the day and go back to its regular price tomorrow.
Apple in a Corner?
by john on Jul.17, 2010, under Uncategorized
The media has been all aflutter for the past three weeks about the iPhone 4′s antenna. For more links about the issue than you could ever care to read check our Daring Fireball’s coverage.
Yesterday Apple had a big sit down with the media and characterized the issue on their own terms and offered a band-aid. Now everyone is getting a free bumper or other case with their iPhone 4. Seems like a sensible solution for those few that are experiencing problems. However there is a deadline: as of right now you have to buy your iPhone 4 before Sept 30th to get your free case.
What are the odds that the Sept 30th cutoff indicates that there is some sort of hardware revision in the works? Either Apple is working furiously on a solution or at that point they plan on ramping up production to put a bumper in the box with the phone. Otherwise they’ve painted themselves into a corner, with the phone being seen by the overeager media as defective after Sept. 30.
Steve Jobs said that they would reevaluate the situation before Sept. 30. I think that “reevaluate” is a euphemism for “hardware fix” but they would never announce that right now, as it would kill sales right when they’re booming.
In any case it is unimaginable that they’ll simply stop offering free a bumper on Sept 30 without any change to the phone.
Battle for Vesta v2.2
by john on Jul.12, 2010, under Uncategorized
I’ve updated the game to support the iPad, iPhone 4, and the multitasking capabilities of iOS 4. This means full resolution on all devices and starting off right where you left off if you resume pretty quickly.
Please leave feedback, requests and bug reports here.
FREE TODAY – Battle for Vesta
by john on Mar.25, 2010, under Uncategorized
Battle for Vesta is free today thanks to FreeAppADay.com. Go grab it for cheap, and then tell your friends.
Battle for Vesta Icon
by john on Mar.22, 2010, under Uncategorized
My brother Matt came up with a new icon for Battle for Vesta. This one is so far superior to the other two that I’ve had. I think it captures the essence of the game about as well as is possible in 512×512 pixels. It clearly indicates that this is a space battle game, that you’re getting attacked, and that the game is 3d. Plus it uses one of the ships from the game as well as colors from the game. Now the game will look even better on your phone.
In other Vesta news, I’ve submitted the 2.1 update to the App Store, so it should be live in a couple of days. There are a few bug fixes and other nice little things and one big thing: a new weapon. The new weapon is a smart laser. It will seek out and try to hit the enemy ship that is currently highlighted on the radar. You charge it by collecting crystals, so you don’t have unlimited shots with it. Also, you have to unlock it by beating the game. Once you’ve unlocked it it will fire one smart laser at a time. Beat the game again on a harder difficultly level and you’ll be able to fire more smart lasers at a time, up to five. I’m quite pleased with how they fly. It is a little bit like the rockets in Robotech.
Adding Save Game to Battle for Vesta
by john on Mar.08, 2010, under iPhone
One of the most requested features for Battle for Vesta is the ability to save a game. This is an entirely reasonable request. Playing the game all the way through can take some time and it is inevitable that you’ll get interrupted by a phone call or some other distraction and find yourself wanting to pick up where you left off.
Also, over the last few updates the game has gotten a lot harder. I find myself getting shot much more frequently and making it through the last few missions is really difficult. Sometime I just want to replay the mission that I just died on rather than start over from scratch.
I started thinking that the retry functionality was the low-hanging fruit and that I should implement it first. Then after some thought it occurred to me that I could kill two birds with one stone. The simplest way to do this was to save the starting conditions at the start of each level and then add a new way of starting the game, a “retry” button. Pressing the retry button would start the game up on the same mission that was last played. So if you die or get interrupted you can always go back to the start of the last mission you were playing.
It turns out that this requires very little code, but it took me a bit of googling to find the bit of the iPhone framework that does what I need. It turns out that there is a persistent dictionary for the iPhone called NSUserDefaults that allows you to store key/value pairs. It also handles persisting them to flash so you don’t even have to worry about the filesystem. So now I have some simple code to save a game in my startLevel() function:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setInteger:level forKey:@"levelKey"];
[prefs setInteger:myLevels.goodRemaining forKey:@"goodRemainignKey"];
[prefs setFloat:shieldPower forKey:@"shieldKey"];
[prefs synchronize];
and some complementary code to pull that information back up when a user hits the retry button:
void retry()
{
gameOver = false;
if (isHit && deathCounter <= 0)
{
isHit = false;
uKills = 0;
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSInteger retryLevel = [prefs integerForKey:@"levelKey"];
NSInteger retryGoodRemaining = [prefs integerForKey:@"goodRemainignKey"];
float retryShield = [prefs floatForKey:@"shieldKey"];
if (retryLevel == nil)
{
shieldPower = 6.0f;
level = 1;
energyCollected = 0;
}
else
{
shieldPower = retryShield;
level = (int)retryLevel;
energyCollected = 0;
myLevels.goodRemaining = (int)retryGoodRemaining;
}
startLevel();
}
}
And that's about all it took to add both save and retry to Battle for Vesta. I'll be submitting this update to the App Store today, so you'll be able to use this feature soon.
I should mention that my Googling eventually led me to the the iCode blog which had a helpful walkthrough of how to use NSUserDefaults and which convinced me that it was the correct (and simplest) way to implement what I wanted. However the blog states that the synchronize message is not needed. In my experience it is needed as I tried it without it and it didn't work.
MacWorld Reviews Battle for Vesta
by john on Feb.24, 2010, under Uncategorized
James Savage at MacWorld took a look at Battle for Vesta today. It came away with 3 out of 5 mice in what I think was a very fair and accurate review. As positives he cites intuitive controls, “buttery smooth” graphics, and solid space combat. As cons he lists pretty much what I myself think are the problems: need more variety in enemies, upgradable ship, and multiplayer.
I can say right now that head to head multiplayer isn’t happening, but all the rest is coming eventually. I do wish he had used a more compelling screenshot, but the game is so fast that it is really hard to generate your own while playing.
NSConf: Game Kit and Online Play
by john on Feb.21, 2010, under Uncategorized
Jeff LaMarche
GameKit is a provided framework that only works over bluetooth. Some hardware doesn’t have support for this functionality.
Handles peer discovery and connection.
Three modes: Server, Client, and Peer. Peer is the friendliest to use.
Important to set delegates to nil prior to releasing the associated object.
Very easy to send data to all peers. You can send to specific peers as well.
Data always arrives intact so one send results in one receive.
Bluetooth is a very easy way to have multiplayer.
Online play is more difficult.
Apple doesn’t want you to use threads for networking. Use the UIApplication event loop instead.
NSStream doesn’t have a concept of discrete data. So sends don’t equal receives.
Use Bonjour to be able to find peers.
http://iphonedevbook.com/ has code for this networking stuff.
NSConf Notes: Games with Core Animation
by john on Feb.21, 2010, under Uncategorized
Drew McCormack wrote Sumo Master as a hobby project and to learn Core Animation.
Pretty simple top down 2d game.
Iterative design process. Accelerometer control didn’t work out. Went with touch.
Wrinklypea.com does design work, has some really nice looking UI and character design work.
For many things you can let Apple handle the animation for you. Views, buttons, help system, etc. Use modal transition styles to control how view controllers come in and out of view.
You can apply CA animations to UI elements in order to spiff up your UI.
Trick for squashing sumos: move the origin from the center of the sumo to the rear and then scale in along the y.
Performance tips: reduce the number of layers, merge layers that you can, make layers smaller, opaque layers are faster, cache CATransform3D objects.
http://bit.ly/sumophysics for info on the physics of the game.
NSConf Notes: Mini Sessions
by john on Feb.21, 2010, under Uncategorized
Mark Aufflick: Notifications.
http://mark.aufflick.com/talks/apns
Limited to 256 bytes. Register device with Apple and then pass token back to your server. Then your server can use the token to send a message to Apple which will be passed to the device.
The notification itself is a binary format. 256 byte limit is payload only. Payload is json formatted.
If a user removes the app you get a notification.
There is a Perl library available that sends notifications.
Separate Sandbox(test) and Production connections for push notifications.
http://github.com/aufflick/p5-net-apns-persistent
Justin Williams from Second Gear Software
Sold off his iPhone business and is focusing on Mac products.
Hard to find a marketing niche in the app store.
Had to find a buyer for his app. Complained enough on twitter that someone approached him asking if he was serious and wanted to sell it. Sold it for 2 to 3 years worth of revenue for the app.
Once you agree upon a price you might want to get lawyers involved. Then sign papers, get money.
Transferring ownership of the application is likely impossible. You have to contact World Wide Developer Relations. They email you a list of four questions. Then they don’t respond. After 90 days got unofficial notification that unless you are selling the whole company they won’t do the transfer.
To ease the pain of the transfer the new owner offered the apps for free for a week, hoping that old users would figure it out and update to the new app.
A workaround might be to create an LLC for each app in case you want to sell it. Very annoying. Apple is not talkative on this topic.
Rod Strougo of Prop.gr – Cocos2D
Wraps a bunch of more complicated technologies for making games.
Two physics engines. Box2D is C++. Squirrel is C.
Box2D is tuned for 1 meter objects, so scale your objects to that.
Cocos2d is at http://www.cocos2d-iphone.org which comes with Box2d, but you can get Box2d from Google Code as well.
Looks like a cool set of libs to quickly build 2d games.
