iPhone 3G S

June 21, 2009 at 10:23 am

It's fast. I've been comparing its performance with that of the iPhone 3G, and it's been very impressive indeed. The first thing I tested was Sunset. The thing I got the clearest numbers for was loading loading time of the home screen version when it's hitting cache. There are many numbers across multiple dimensions here, so let me just illustrate with a very scientific chart.

While it might be a bit tricky to follow so much data, the gist of it is thus: Sunset on the iPhone 3G constitutes some level of awesomeness (or LOA), let's say one unit. Sunset on the iPhone 3G S has a higher LOA due to its shorter loading time. In fact, and perhaps counterintuitively, as the loading time decreases, the LOA increases by the reciprocal of the decrease (one half the loading time equals two times the LOA). Therefore, we can see that the iPhone 3G S causes Sunset to have two units of LOA, a 2x increase over the iPhone 3G. I will leave it to the reader to consider that as the loading time approaches zero, the LOA approaches infinity. Or, in other words, it approaches Chuck Norris. And like how the loading time can never actually reach zero, likewise can the LOA never actually reach infinity, AKA Chuck Norris' LOA.

0 comments

A few tweaks to the Sunset Home Screen version

June 18, 2009 at 6:16 pm

The Home Screen version of Sunset has gotten two improvements. The first is the addition of a default.png that is displayed whenever you launch the game instead of a screenshot of the state of the game when you last quit. This uses a feature that's brand new to version 3.0 of iPhone OS, so make sure you're up to date!

The second is the use of a cache manifest file which cuts the initial load time in half, and as far as I can tell actually allows you to load and play Sunset entirely offline. In other words, after you've saved the game to your home screen and launched it at least once, the game is installed and you can play it anytime, even when you don't have an internet connection. Cool, huh?

0 comments

Home Screen version of Sunset

June 12, 2009 at 8:20 pm

I just launched a refined version of Sunset, which I'm calling the Home Screen version. This version can only be played on an iPhone or iPod touch, and you have to launch the game from your Home Screen to play it. So go to the page in Mobile Safari, click the plus button on the toolbar, and choose "Add to Home Screen".

The Home Screen version of Sunset has received a few tweaks to deliver a better experience on iPhones and iPod touches. First, the browser controls are removed, and the added real estate is spent on a larger game view area. Second, the control pad now responds to touch events, rather than onclick events, which makes it much more responsive. In addition to responding to touch events, the control pad also now has pressed states for each of its buttons, which adds just a bit of an extra tactile feel to things.

Try it out!

0 comments

Day of Happiness

June 8, 2009 at 8:49 pm

iPhone OS 3.0: Want
iPhone 3GS: Want
Mac OS X Snow Leopard: Want
Safari 4: Wanted it. Got it :D

Not a bad set of announcements today. I like how many of them aren't even trying for something revolutionary and huge, but are rather trying to toss in a million little refinements to make things faster, cleaner, and just overall better.

I'm thinking about playing with some of the more recent improvements in WebKit. When I first started developing Sunset, Mobile Safari didn't give a lot of love to iPhone developers. No way to intercept touch events, pretty dismal performance, etc. Things have improved quite a bit since then. So much so, I dare say, that talented developers could make webapps that are now only a half step shy of their native counterparts in terms of at least delivering a decent touch interface.

Maybe I should make a refined version of Sunset, one that just goes a bit further with the WebKit stuff.

2 comments

DreamStream

May 20, 2009 at 12:23 pm

DreamStream is an iPhone app I helped develop, and it was just released on the App Store. Check it out!

The app is sort of a digital picture frame that streams its photos in from various sources off the internet. The Facebook integration is particularly cool.

0 comments

Premature Optimization

May 6, 2009 at 8:43 pm

"Premature Optimization is the root of all evil" says Donald Knuth (no relation). After having worked on the Sunset engine for the past year (most engine work is done now, but I sometimes revisit it), I've found that I should probably follow that bit of advice more than I do. A couple of examples follow for those who are into this kind of thing.

One of the first things I did was create a utility that could "compile" a level, which was the process of generating a quadtree from the level geometry, and then determining visibility between leaves. Also, collision detection was computed. The screenshot up above (click for a fullsize image) is from the level editor I wrote. Light green squares are solid, white squares are passable. The red lines show the quadtree, and the entire map image is tinted based on visibility (tinted areas are invisible from the position of the camera (represented by the blue arrow/carrot thing)).

As an added bonus, the screenshot also shows a few of the new textures, and the preview window is fairly representative of what the actual game will look like, so this constitutes the first media release of Sunset :D.

Anyway, the original game renderer was heavily focused on rendering as little geometry as possible, and it did this by rendering only the walls that were visible according to the compiled level data set. This was a fairly complicated bit of code, and it proved to optimize the wrong thing when the goal was performance. With geometry as simple as the levels in Sunset, it was actually faster to just render the entire level in one shot, going from one draw call per texture per visible leaf, to just one draw call per texture for the entire level. I would've saved myself a lot of work if I just tried that simpler road from the beginning.

Another example involved drawing bad guys and other sprite-based entities. Because of the way that OpenGL works, geometry for sprites must be drawn back to front (the furthest away bad guys first). For every single frame I build a list of visible entities (which, incidentally, I determine via the dataset I computed earlier for level geometry visibility, I guess that work wasn't a total wash) and then sort the list based off the distance from the entities to the camera.

Because of how frequently the distance between entities and the camera is calculated, I figured the method that computed it had to be really fast, so I employed a common trick when only an approximate distance is needed: I omitted the square root. This resulted in the ordering of entities being correct about 98% of the time. Sometimes, if entities were at just the right spot and moving in just the right direction, you could see them ordered incorrectly for about a quarter of a second. I figured that slight inaccuracy was worth the speed boost.

Well, just recently I decided to do things "the right way" just for giggles, and began computing distances complete with square roots. The result? Entities are always ordered correctly, and there was no qualitative drop in performance. Premature optimization, how foul.

I think Donald Knuth should insist on being called "Don."

0 comments

CNN should look into the description meta tag

May 5, 2009 at 7:29 pm

Bitter over ratings? Nawwww.

0 comments

Maidenhead Converter Released

May 2, 2009 at 11:10 am

Maidenhead Converter was just approved by Apple last night, and is now available on the App store. If you need something to convert maidenhead coordinates, or just feel like arbitrarily giving me a dollar, check it out.

0 comments

Announcing Maidenhead Converter

April 24, 2009 at 12:36 pm

I'm packing up and getting ready to submit to Apple my first iPhone app: Maidenhead Converter. It's not a game or anything, and in fact it probably has a very limited market, but it's still my first iPhone app, so that's cool.

It reports your current location in the Maidenhead Locator System, and also features a converter for going back and forth between Maidenhead coordinates and latitude and longitude.

0 comments

Major Sunset Milestone

April 22, 2009 at 9:15 pm

All of the original levels of Sunset have now had their layouts built for the new game, and I just finished drawing the last of the new floor/ceiling textures.

There are going to be four new levels in the new game (making a total of nine) and the new levels aren't quite done with layout or textures yet, but I'm making progress.

1 comment

Next Page