|
|
||||||||
Phit for the iPhone and iPod Touch is now available from the iTunes store. Get Phit!
|
|
||||||||
Progress on porting Phit to the iPhone has moved quickly this week. On Wednesday I set out to port my 3D renderer from Windows to the iPhone. This is a renderer I've maintained for several years and which I use in teaching 3D rendering for games at the Guildhall. (A renderer is a piece of software that displays 3D objects on the screen.)
Porting the renderer proved much easier than I expected. Now I can load and display 3D models—like this one from Unreal Tournament 2004—on the iPhone simulator.
I was surprised that the renderer ported over so well. It was written for the PC. On the PC it supports both Direct3D and OpenGL—I stripped out the Direct3D portion. It is quite a large piece of code, with about 40 files or so and maybe 15,000 lines of code. I've only ever compiled it with Visual Studio, and the gcc compiler used for iPhone is substantially different.
I thought the biggest hurdle would come from the fact that the iPhone framework is written in Objective-C, whereas my renderer is all C++. As it turns out, Objective-C files that have the extension .mm happily coexist in both worlds: they can call C++ object member functions as well as Objective-C object methods. So I wrote one or two Objective-C classes to interact with the iPhone OS and framework. I have my two dozen or so C++ classes that make up the engine. And then I have three or four "adapter" classes in .mm files that help my C++ classes talk to the iPhone OS.
I tried to get an iPhone this week to test the code on. (The iPhone Simulator on the Mac tells you nothing about how your code will actually perform on the iPhone. Presumably the iPhone will run quite a bit slower for complex 3D scenes.) Unfortunately, with the June 9th announcement of the new iPhone, nobody is selling iPhones anymore. So I got an iPod Touch instead. But I'm still having to wait because Apple hasn't gotten us our Developer certificate yet. You need that to make your iPhone/iPod Touch into a development device.
So on the one hand I'm learning the iPhone SDK. On the other hand I'm working on Phit, upgrading it for life on the iPhone.
Specifically, I wanted to improve the way the pieces move in Phit, making them smoother and more natural. The iPhone sets a high standard for user interface "feel", and I want iPhit to meet or exceed that standard.
So I'm creating a new physics system for iPhit. It uses Verlet integration to move and constrain pieces, and features a sophisticated collision detection system so that pieces can "stack" and won't pass through each other. The implementation I have now seems to work very reliably, but is slower than I'd like. Still, it begins to give an idea of iPhit might feel on the iPhone. Feel free to try out the new physics and let me know what you think.
Labels: games, iPhone, Phit, programming, technology
|
|
||||||||
Since the release of Phit last year, this simple, addictive puzzle game has become one of the web's most popular past times. Now it's time to spread the word that Phit is coming to the iPhone.For the past few weeks I've been working with Armor Games to port Phit into a native iPhone application. We're adding multi-touch capability so you can drag more than one piece at a time. We're updating the way pieces move to be more fluid and responsive. And we're providing a whole new set of fresh puzzles—even experienced players will discover new challenges.
We think Phit will be the perfect boredom-basher for iPhone users everywhere. Keep an eye on this space to find out when iPhit will be available in the iPhone App Store.
|
|
||||||||
I'm still in the honeymoon phase. I just discovered that I could add Phit as a widget in the Mac Dashboard and play it any old time just by touching a button. Now that's good mashup.Last night I discovered what Apple means when it talks about an "always on" policy, and again it has made me sad for the PC. On the PC, "sleeping" your system involves several seconds of the system semi-shutting down. Waking the system takes several seconds, and then you have to log back in. On my Mac, sleeping takes no time, and waking up takes no time. I close the lid of the laptop, it's asleep; I open the lid, it's awake. Why can't the PC do this?
I'm searching for a good alternative to Office 2007. Mellel and Nisus both look tolerable. We'll see.
It sounds like I'll need to use OpenGL ES as the drawing system for iPhit. Apparently it's the fastest option for games. I'm well familiar with OpenGL (I teach OpenGL at the Guildhall), so this should be a quick point of entry for me. But I'll run some performance tests early on to verify that I can get 30fps (that seems to be iPhone's max frame rate) with as many moving elements as Phit uses.
I also had a game design thought for iPhit. What if the user could tilt the iPhone in order to make all the pieces "fall" toward gravity? Obviously this would need to be something the user could enable or disable quickly—otherwise it would be too easy to screw up your game with an accidental tilt. But assuming it was controllable, it might offer a neat way to quickly shunt all the pieces off to one side of the board, or to reset the level by sliding everything up toward its starting position. Just a thought.
Labels: games, iPhone, Mac, technology
|
|
||||||||
I just played my first round of chess on my new MacBook using only my voice. The Mac has amazing speech input support. I can make chess moves just by calling them out—"Computer, pawn at e2 to e4." And I'm thinking, "Why have I never used speech input on my PC?" So I click the Speech icon in the Control Panel in Windows—I don't think I've ever clicked it before—and, oh yeah, XP does have speech recognition ("if installed," it cautions). I just never thought to use it before. Because the Mac is unfamiliar, it's forcing me to rethink how I use computers, and I'm discovering all sorts of new ideas.I suppose it's a bit like moving to another country. In the early '90s I went to college in England and suddenly discovered I was a child again. I was startled by street markings. I didn't get certain grown-up jokes. I was delighted by TV shows that seemed fresh and new to me, but which—I would later realize—were actually banal.
PC users must never look at Spotlight in the Mac OS. It allows you to do a sort of Google Search with Suggestions in real time on your system. On the PC I use Google Desktop Search, but Spotlight is faster and even more friendly. And it comes with the OS. I guess Vista has something like that, but who cares?
I installed the iPhone SDK and played with the iPhone Simulator for a bit. Then I tried to get their HelloWorld project working and was astounded that it failed to compile. I have implemented hundreds—nay, thousands of HelloWorlds in my twenty-five years of programming, and I don't recall one ready-made by the SDK developer that instantly spewed out a hundred error messages. No doubt I just have a setting out of whack somewhere. Still, it's a little worrisome.
Labels: games, iPhone, Mac, technology
|
|
||||||||
This week I start a new project. I'm porting Phit to the iPhone. The FedEx man just dropped off my new MacBook—my first foray into Mac. Liam uses them at school, so he initiated me. He showed me the button on the bottom of the Mac that tells the battery life. He helped me figure out which power cord to use. He assured me that the white light on the front of the Mac bodes well rather than ill. Then we formed a GarageBand and recorded our first megahit.I considered a Mac a few years ago but chickened out at the last minute. No right mouse button? No delete key? Why don't you just cut off my arm?
This time I have no choice. I'm making a game for the iPhone, and the SDK requires a Mac. So here I sit, searching for a Home key that doesn't exist (though Command+Left Arrow does much the same thing). Isn't it a little bit ironic, considering Apple's 1984 commercial, how totalitarian is their approach to user interface?
The Mac interface is so slick, though. A high-energy, full-screen movie greets me on startup. Everything is smooth and colorful. It's a beauty bath. I go back to my PC running Windows XP, and it's like watching an old Land of the Lost rerun. Great special effects, for the time.
My goal is to get Phit ported over soon after the iPhone AppStore opens. Daniel McNeely (of ArmorGames) and I have partnered to make it happen. We think people will absolutely love Phit on the iPhone. What do you think—how does Phit with multi-touch sound to you? You'll be able to drag two pieces at once, yank this one out of the way to get that one past. Sitting on a train. Or driving your car. It will rock.
You haven't played Phit? It's a simple puzzle game I made last year that you can play on the web. Try it—it won't bite. Though people do tell me it's addictive. I had a note from a lady who was quitting smoking and using Phit as a replacement.
Over the next few weeks I'll keep you posted as I delve into the dark, mysterious, vaguely Fascist world of making games on the iPhone. Check back often or you'll totally miss it, and then your friends will ask if you saw the last awesome post and you'll have to admit you didn't and then they'll realize you suck.
One last question. Who thought it was a good idea to sharpen the edges of a laptop?
Labels: games, iPhone, Mac, Phit, technology















