ancient wisdom

To content | To menu | To search

Sunday 3 May 2009


1.06 is on its way through Apple. No exciting new features in this update, but lots of worthwhile performance optimisation. If you'll indulge me for a moment, I'll get a bit geeky about it:

I developed Ancient Frog on a second generation iPod Touch, and didn't really pay enough attention to the difference in hardware spec between that and the iPhone. When I got my iPhone, I was slightly disappointed by Frog's performance on it. So I made fixing that the focus of this update.

The first thing you should notice is that the loading time is a lot shorter. It was spending fully 2 seconds loading one of the data files, and I've dropped that almost to nothing by changing the format of it. The problem was that I was using human-readable xml,which is a good, robust, extendable, portable way of handling data. It's just not the most efficient way. Now that Ancient Frog is finished (barring these continual updates!) I was able to simplify the data to a binary format by making explicit certain assumptions about it. For instance, from now on, frogs have to have exactly 4 legs. So if you were holding out for a 'centipede' level, I'm sorry.

Most of the runtime optimisations I made involved improving the performance of my lower level maths functions.

My maths library has a SinCos() function, but on architectures which don't have a sincos instruction in hardware it was just doing a simple sin() and cos(). I replaced that with a single tan() (plus some quick maths).

When you're pulling the frog's legs around, it's doing a hefty bit of work to calculate where the joints should go to respond to your movements. This involves a lot of checks on the angle between two vectors. Originally I was doing this naively with two atan() calls, but a bit of head scratching showed me that I could do it with just one (plus some quick maths).

I also moved to using a fast approximation for the atan() function, and discovered that the loss of precision didn't matter.

I then spent a while repeatedly looking at which function was at the top of the profile, and hitting it until it wasn't. There's pretty much no end to how long you can spend doing that, wringing ever smaller gains from the code. After a bit I decided enough was enough.

The upshot is that the iPhone version is now as responsive as the Touch version was. The limiting factor now is the rendering performance - there's a large amount of overdraw required to give Ancient Frog that rich glowing look, and since it's not a twitch game I'm prepared to accept it dipping below 30fps.

The one thing that bugs me is the shadow of the frog itself. It uses an approach (multiple z-buffer renders) which is simultaneously cheap (visually) and expensive (computationally). A better approach using FBOs is just a bit more work than I think the end result would justify, so I haven't touched it, but I may come back to that. The thing I do like about the current shadow is that it gets softer-edged the further away the body is from the leaf. But the effect is so subtle, I think you're only likely to see it on the last 3 levels (with the Mystery Frog).

Tuesday 28 April 2009

level 62

By popular request (well, by one request), here's the solution to puzzle 62 - the Corroboree level from Ancient Frog LE.

I think I made a mistake in using the perfect solution as the par value. The game would be less frustrating (and a bit richer) if the par value reflected a really good but not necessarily perfect solution, and if it were then possible to come in under par. Players wouldn't be banging their heads against the wall on the really nasty levels, and there'd be a feeling of having beaten the game if they got a better score.

There's a fair bit of smoothing out of the progression and difficulty in general that I'd like to do now that I've seen it played by a much broader base of people, but I don't like to change a puzzle that someone is in the middle of at the time the update goes out.

Meanwhile, 1.06 is getting ready to release. The trouble with optimising is that there's no absolute end to it, and once I've started I find it hard to stop.

Thursday 16 April 2009


I've just uploaded version 1.05 to the app store. Expect it to come out the other end of Apple's QA in about a week.

It took longer than I'd hoped (the joys of fatherhood!) so I bumped some of the features I wanted to a later update (hints, a prettier garden, performance improvements). What it does have is a spiffy new page-turn effect (it's cooler than it sounds!), and an action replay feature.

Action replay was suggested by player 'Cogunn', and I kicked myself for not thinking of it first. If you've been struggling for hours on a particular puzzle, the petal shower is a meagre reward. Now you can press the little 'replay' button (top right, during the petal shower) and watch the frog retracing your footsteps.

The replay function in the original Civilization was one of my favourite parts of the game, and I was always disappointed that they dropped it for the sequels.

Wednesday 1 April 2009


Version 1.04 is up, and my iPhone has arrived, so I was able to check that the silent switch now works. (It does!)

The Light Edition, Ancient Frog LE, is also live on the app store! It will be interesting to see what effect a free demo has on sales. Some people swear by them, some say they cannibalise your sales. The next few days' stats will be interesting to see.

level 88

This wasn't requested as such, but it's a tough one, and a good puzzle to illustrate how the game is played.

A lot of puzzles have this core element - there's a gap across the board of one peg width, and to bridge it you have to arrange the frog so it can make a sidestep. In this case you have to sidestep across the gap more than once before you're in a position with enough room to make the turn to the goal.

Sunday 29 March 2009

splashing out

Apple finally sent out the financial reports for February. Still no actual money, but at least an indication that there will be some.

My iPhone game has made enough that I can afford to buy... looks around sheepishly... an iPhone. I've ordered a 16GB one in white.

I used an iPod touch during development, because it was the cheapest way to bootstrap myself into iPhone programming, but it meant that I have been unable to test the phone-only features such as the 'silent' switch. And so, not unexpectedly, Ancient Frog wasn't honouring it correctly. And so, also not unexpectedly, people were (quite understandably) complaining.

My reward for this sloppy quality control is a shiny new toy. Hurray!

solution to level 8

I'm considering making an archive of the solutions to all the puzzles. Meanwhile, level 8 has been requested:

Thursday 26 March 2009

a good idea is a good idea for everyone

Time for some SATIRE!

Most of the Ancient Frog reviews have been lovely, literate and positive. And emails to have been even nicer - I think I've hit a genre that attracts frankly nicer people than did any of my previous games. But those 1-star blurts are what stand out on the sell page.

Monday 23 March 2009


I've been rummaging through my old projects, and I thought it might be interesting to give a quick pictorial history of the games I've made.

I'm annoyed that I don't have anything to show for my really early stuff on the 8-bit and 16-bit machines. I purged my old cassettes and floppies in a fit of madness some time ago. My first published game was a type-in listing in Your Computer magazine (£50!), but frustratingly it was in one of the issues which is missing from this archive (some time in 1986).

The earliest game code I can find is a little Wolfenstein-style raycasting thingy for the Ruputer wristwatch computer:

But let's start in 1997, when I joined the games industry as a programmer at Criterion...

Redline Racer

Sub Culture

I wrote the assembly language transform & lighting code for the new SIMD instruction sets that were just appearing. This was in the days of the 3DFX Voodoo, so software rendering was starting to be phased out. I was glad I had the chance to do it before those days were gone.

Then Criterion started up an experimental small downloadable games division, called Fiendish Games. This was a fantastic opportunity for me - each game had one artist and one programmer working on it. Still twice as many people as I'd like, but closer to my ideal model than the big games.

Tower of the Ancients

Tower started life as a 2-week demo by one of the Criterion programmers. I jazzed up the scoring system, then just went to town on the bells & whistles. Motion blur! Bump mapping! Block physics! And so forth. I also did some of the 2D artwork, including, childishly, enhancing Adam's membrum virile in the loading screen's image of the Sistene Chapel ceiling.

Then some dues had to be paid:


Mah Jongg

It's not all glamour in the games industry.

At that point, Criterion decided it didn't want to be in the downloadable games business any more, and Fiendish spun off as Small Rockets.

First up in the new company was Star Monkey

Star Monkey

Up until Ancient Frog, this is the game I was most proud of, and the only one I played after it had been released. It's a very old school one-hit-and-you're-dead shoot-em-up, with oodles of alpha blending and lighting tricks. It shipped with the in-game level editor (disabled, but in a trivially re-enableable way).

Star Monkey editor

You could write a complete new shoot-em-up using these tools. I don't think anybody ever tried.

Then came my big mistake. My friend AD approached me and said "Peter Molyneux wants me for a new game he's starting. Would you like to be lead programmer on it?"

What I said was "OK, sounds interesting."

What I should have said was "No! No! A thousand times no! I'd rather move to the other side of the planet and leave the games industry forever!"

Still, I got there in the end.

The Movies

In contrast to Star Monkey, this is a game that I never played at all. (At least, not the version that existed at the time it got released.) A horrible experience, cramming in everything that the games industry is famous for doing wrong. I'll have to do a post about it some time...

So anyway, I started working on stuff just for me.


A hopelessly ambitious game, now abandoned but still simmering in my mind. I did at least get the basis of a good game engine out of it.


This came closer to being releasable. I'm pleased with the look of it, and the city map generator, and particularly the London Underground Automatic Station Name Generator. But despite being playable, I never succeeded in nailing the 'fun' part. So it sits languishing on my hard drive waiting for inspiration. Again, it considerably advanced my engine (particularly the 2D & markup stuff), so not utterly wasted time.

So I started on Frog.


Initially developing on my phone (a Windows Mobile device), but soon switching to PC.

But this wasn't paying the bills, and I fancied a change of country. New Zealand beckoned, and a brand new career creating digital interactives for museums.

Interactive Floor

Interactive Table

Build A Dolphin

Sound Chamber

Climate Simulator (with me for scale!)

Quick hiccup to write a patch for MAME to send the display list from vector games to the sound card, so you can hook up an oscilloscope and see them as they originally appeared:


Meanwhile, the Mac/PC incarnation of Frog was proceeding very slowly.

Frog (PC)

It was working as a game, but the graphics were taking me forever. I wanted it to look good on 1920x1200 monitors, and still work at 800x600, so not only was all the source artwork at ridiculously high resolution, the levels were also constructed in layers which could resize (dynamically at that!) to any aspect ratio. Looked lovely, but the race was on between the game and my increasingly pregnant wife, and there was no way I was going to finish it before I had a newborn baby on my hands.

So I returned to its mobile phone roots. Only this time, something a bit sexier. The iPhone looked like the perfect platform - it was rapidly establishing itself as a gaming device, it was perfectly suited to a game whose only action involved dragging things about the screen, and with a fixed (and relatively low) resolution, I'd be able to simplify the levels enough to actually finish it. The only question was, would it be powerful enough?

Ancient Frog (iPhone)

Long story short: Yes.

Tuesday 17 March 2009

now what?

Well, Ancient Frog is out there and starting to earn its keep. It's patched to a respectable level, although I'll probably have another bash at the pesky undo gesture, and I'm tempted to give the menu screen a makeover. There's also a 'light' edition to consider, much though I'm wary of that (it's very hard to decide which levels to leave in - if I throw in a couple of tough ones, people might think all of the paid ones will be too hard. If I don't, they'll think there's no depth to it).

But that aside, for the first time in far too long I'm able to start considering new projects without getting pangs of 'unfinished business' guilt. It's a bit of a mental luxury, indulging myself in thoughts of all the neat little ideas that have been piling up during Frog's development. It's tempered slightly by the thought that, once I start on one of them, the others have to go back in the cupboard until I'm done.

My intention this time is to bang out something really quickly, using the tools and experience I've built up, and focusing on the tightest, most cut-down game mechanic I can manage. The fact that that has been my intention for every game I've worked on for at least ten years, and they've always ballooned in features and overrun in time, makes no dent in my optimism.

Wednesday 11 March 2009

easy money

Ancient Frog has dropped off the App Store front page. When it appeared there a week ago, I saw a roughly 10-fold increase in daily sales. It will be interesting to see what the long-term effects of that boost are. Will it drop straight back down again, or will word-of-mouth have given it some traction?

I suspect (hope!) that UK sales (currently around 1/4 of total sales) will take longer to die back down. It's #21 in games, #5 in puzzle games, #3 in family games there - so it should keep popping up in front of people as they browse around on the device.

Sunday 8 March 2009

version 1.03

I've just uploaded Ancient Frog 1.03 to the app store. It'll probably spend about a week in Apple QA before going live.

The big bug fix is the stutter in the ambient sound loop. It's been gnawing at my conscience since I released the game - I knew it was annoying, but I released anyway in my mad rush to clear the decks before the son and heir turned up. I had a few hours of peace and quiet today and was able to have another look at the problem. In the end I admitted defeat on my original approach, and switched to a less highly compressed audio format. This puts the package size up by about a megabyte, but I think it's worth it for seamless looping.

The other addition is to tell people in the tutorial that the daisy is a button. Lots of people weren't stumbling upon this (and it's not that obvious really). The solution is a bit clunky (nobody reads text in games), but it's better than completely throwing people in at the deep end. It also makes the end of the tutorial a bit less abrupt, so win.

Saturday 7 March 2009

a twisty turny puzzle

I'm rather pleased with the way that turned out. It looks like something by Eadweard Muybridge.

Here's the solution to another level. Unless you have a photographic memory, this shouldn't prove to be a spoiler. I like this one because it's such an apparently simple layout - home position, goal position right next to it and facing the same way, and one spare peg - but the solution goes round and round in circles.

puzzle hints

I had an email from an Ancient Frog player, frustrated that he couldn't reach par on the 'easy' puzzle 15.

Difficulty ratings are an inexact science in Ancient Frog - in many cases, a puzzle will switch from frustratingly hard to really trivial just by changing one move. I try to rate them so that puzzles requiring twisty turny routes are marked harder than ones which are mostly solved in a straight line. Overall, the difficulty levels average out to about right, but sometimes they just don't reflect what a particular player is experiencing,

Anyway, I sent him the solution, at least in part to show that the par rating was achievable. It was a bit of a faff describing the route (using ascii art), so I decided to write a little tool to generate solution slideshows.

Here's the output for puzzle 15. (look away if you don't want to know the results!)

page 3 of 3 -