Vector Blaster now available for iPhone

My game Vector Blaster is now available on the iTunes App Store for iPhone. Vector Blaster is an arcade-style game inspired by Tempest.

For the iPhone version I ported Rude Engine over to use OpenGL to take advantage of the graphics chip in the iPhone. (Things actually ran fine just doing pixel painting, but it was a fun project..) I also redid the input system so that it works with the multi-touch interface. I think it turned out surprisingly well, sliding your thumbs around on the screen really feels like you’re using an analog wheel like the old Tempest arcade game. For music I ported MikMod over to the iPhone and used the same great tracks I licensed for the original… they sound incredible on the little iPhone speakers.

Enjoy! 🙂

Touch screens and gaming

I’ve been spending a bit of time experimenting with some game concepts on iPhone, and how a touch screen input system effects them. In some cases I’m impressed how well certain input schemes work with it, and with others I’m surprised how poorly they work.

When holding the iPhone in landscape mode with two hands your thumbs are free to tap and slide the touch surface. Sliding movements on the touch screen work very well–especially up/down gestures. One concept I was toying with mimicked a trackball and it had a great hand-eye correlation between sliding and the result on screen. Tapping the touch screen with your thumbs starts to break down when you’re required to tap with any amount of precision. Without tactile feedback I find it easy for my thumbs to drift unless I’m looking directly at what I’m supposed to tap. Games with more than one button per thumb (i.e. two buttons) become challenging after a while.

My experiments really hit home for me how critical tactile feedback is for a game. The game is on the screen, but it’s played with your fingers. With a game controller or keyboard or mouse, your brain instructs your fingers what to do. Your nerve endings report back what was performed. Your eyes register the game’s response to the input. Your brain is then delighted or disappointed with the outcome.

With a game controller, if your brain is disappointed by an outcome in the game, it can evaluate the response against the signal sent back by your nerve endings based on what your fingers performed. Your brain can then adjust what your fingers perform for next time. But without tactile feedback, the only information your brain gets back is timing information. The sensation of hitting the left side of the d-pad isn’t there. The pressure felt from the right analog shoulder button is missing. All your brain knows is when it touched the screen. A lot of the subtle feedback you get from playing a video game is missing, and thus at a very low level it’s difficult to derive enjoyment from playing a game on a touch screen.

This is partly why sliding movements work so well… As with a trackball, the surface of the trackball pretty much feels the same the entire time you’re playing it. The feedback you get when sliding on the screen is in the acceleration/deceleration of your entire thumb and part of your wrist–not just a finger–so it registers louder with your brain than a tap does.

Overall, I don’t think touch screens are the “next” big thing in gaming. I’m open to new ideas, but today, I remain unconvinced…

And while we’re on iPhone… I’m totally unconvinced of the usefulness of the accelerometer for gaming. I’m yet to see a good use of it and I haven’t had any success with it myself. First, you have the same issue with tactile feedback. The iPhone isn’t very weighty so it’s hard to feel precisely how it’s oriented in your hand(s). Second, the accelerometer feels kinda laggy. It might take the software a while to process the data.. (?) Third, the accelerometer is attached to the screen! You can’t make any interesting movements with it without preventing yourself from viewing the screen.

iPhone battery life

I bought a first-gen iPhone a few weeks ago from a friend who had upgraded to the new model. Immediately I was dismayed by abysmal battery performance. Overnight the device would go from a 100% charge down to a 30% charge. Sometimes it would completely drain overnight just sitting idle on my nightstand.

Apple suggests a number of things to improve iPhone battery life, but it took a few days worth of careful experimentation to determine what exactly on that list was killing my iPhone. Turns out its two main things…

1) I live in a very low-coverage area, and some spots in my house the iPhone will ping-pong between “No Service” and getting service. Leaving the iPhone in these spots kills the battery very quickly. I’ve found that the only way to have the iPhone survive the night is to leave it in a spot where it gets one bar of service steadily.

Apple suggests you turn on “airplane mode” in these situations. Excuse me? I’ve had numerous other GSM cell phones over the years in this house and none of those drained themselves to death when they ping-ponged between service. The N-Gage would go for 4-5 days… Sony Ericsson P800 would go for 3 days… Panasonic G50 would go for 4 days… and most recently, my Nokia 6013 would go an entire week flipping between “No Service” and getting service. The polling frequency on the iPhone must be far greater than these other devices.

Actually, I don’t even care about receiving cell phone calls while I’m at my house. Why can’t I tell the iPhone, “if you’re within range of the wifi access point named XYZ, disable cell service”?

2) Fetching my email over wifi kills the battery. Even if I leave the iPhone in a spot where it gets service, if I enable fetch mode the poor thing won’t survive the night. This appears to drain the battery even faster than spotty cell reception.

Everything else about the iPhone so far I think is pretty dang awesome (and useful), but the battery life problems trump the utility of the device. I’d love to be able to leave the thing laying around my house wherever and checking my email every 15 minutes, but alas, I can’t do that with it.

William Owen Rose

William Owen Rose
July 24, 2008
9lbs 4oz, 21″

Mom and Baby are doing well, and Dad is very excited! More photos of the little guy here!

Citation spotted

We interrupt this blog for a moment of self-congratulation…

I was checking google to see if anyone had made any links to a directory on my web server I was considering deleting, and I discovered a link to a lampoon article I wrote on the RIAA back in 2002, RIAA sues makers of black magic markers, from an unlikely source, the prestigious (because they cited me) Rutgers Computer & Technology Law Journal. Their article Harmonizing fair use and self-help copyright protection of digital music cites my spoof as one of three thorns in the side of the RIAA. Yes, they got the joke, and no, I did not actually read their paper before posting this entry.

Damn, now I have to maintain that link. 🙂

Don’t buy recycling code 7 products

You learn something new every day.

While investigating Bisphenol A and trying to figure out what bottles I owned contained it, I came across an article on the seven resin identification codes (or “recycling codes”) put on the bottom of plastic containers. I had always assumed that if a container had the recycling symbol on the bottom that it was recyclable. As it turns out, that’s not always the case.

Resin code 7, even though it is commonly drawn as a 7 within the chasing-arrows recycling symbol, is never actually recycled and ends up in the landfill. Code 7 means “other plastic”, which means its not one of the typically found 1-6 plastics, or its a combination of plastics.

And even though resin codes 3-6 are recyclable, not all municipalities will recycle them. Check with your local recycling authority to see if they accept products with resin codes 3-6. But even if they do, according to this article, they might not actually do anything productive with it–they might just be putting them in a separate pile until they figure out what to do with them.

The only guaranteed guilt-free plastics you can buy right now are ones with resin codes 1 and 2. So next time you’re in the store and looking at a plastic product, check the bottom. Give preference to products using type 1 and type 2 plastics, and definitely do not buy type 7 plastics.

Unknown password requirements prompt phone call from the bank

My debit card uses Verified by Visa, a service where online purchases through member banks ask you for a password to complete the purchase. One problem with this service is they have some lame password restrictions (a-z, A-Z, 0-9, no special characters) so I can’t use my “common” set of passwords with the system, and I don’t use the system often enough, therefore I’m always “forgetting” my password.

So I just did a transaction with a domain registrar in France, failed the password check, reset my password, and then completed the transaction. Two minutes later I got a phone call from Visa wanting to verify that it was in fact me who performed the transaction. It all could have been avoided if they had just posted their password requirements when you go to login. I wish all websites would post password requirements on their login screens.

I don’t think posting password requirements would be that big of a security risk, since if you’re trying to break into the system you probably figured the requirements out through other means (like another account you created on your own, or bozos like me that post the password requirements elsewhere–see above). Almost every single time I have to click the “forgot your password?” link on a login screen I didn’t actually forget it–I just couldn’t figure out which password I had used because I didn’t know their password requirements. It usually goes like this:

“Oh yeah, this is the site that only allows letters and numbers, and you have to have at least two of each. I want these last two minutes of my life back thank you.”

Sometimes they add insult to injury by forcing me to change my password when I click on the “forgot your password” link. When I pick a “new” password I end up discovering my old password when they say, “your new password can not be your old password.”

Grrrr!!!

How do you define reentrant code?

I’ve found several places around the net where claims are made that Lua is reentrant, but I just found a case (on my platform at least) where Lua is not. I discovered a bug in our system where Lua was being preempted right in the middle of a number to string conversion and the end result was invalid. (Of course, this only occurred about 1 in 200 runs of the code, which made it challenging to figure out what was going on).

The number to string conversion is performed with sprintf(), and sprintf() is not required to be a reentrant function. I’m sure it is on major platforms (Windows/Linux) but unfortunately it is not on ours.

The problem occurred when this sequence of events took place:

* Thread 1: Call Lua, Lua calls sprintf()
* Thread 1 is stopped within sprintf()
* Thread 2 is started
* Thread 2: Call sprintf()
* Thread 2 is stopped after sprintf() completes, Thread 1 resumes

Lua script like this would frequently exhibit the problem:

for i=1,10,1 do
local string = foo .. i
end

The concatenation operation would result in foo + bar instead of foo + i, where “bar” is a fragment of the sprintf() operation left over from Thread 2.

A possible fix for this would be to have Lua use an ftoa() implementation instead of sprintf(). However I fixed it in our case by simply not performing sprintf() in the second thread (this issue was isolated to one portion of our execution fortunately).

If your code is “proven” to be reentrant, but you rely on another library that is not proven, can you still claim your code is reentrant?