ancient wisdom

To content | To menu | To search

Monday 22 June 2009

1.07

1.07 - The Hints Version - has been languishing in Apple QA for a while now. I guess they're snowed under with 3.0 / 3GS business.

In the end I went for a system which offers hints via a question mark in the top left corner, but it only appears when you've taken significantly more than the par moves, or reset the puzzle. You can make it appear immediately from a button in the daisy menu. The idea is that if you're doing fine you won't be bothered by it. If you're struggling, you're offered some help.

There's a couple of levels where the frog's feet can get in the way of the hint button. I make the button disappear in these cases. It's not ideal, but I'm hoping that in actual use nobody will encounter this limitation. If I'd designed the button in from the start, I'd have just dropped the levels that clash, but I don't want to go removing content from installed games.

Pressing the hint button once gives you an intermediate goal position to aim for. Pressing it again gives the best move to take next. Pressing it a third time hides the hint.

Once you've reached the hint position, it disappears. If you still need help, you have to press the button again. I'll just have to see if this works in the wild - it may be that when people turn to the button for help, they want to be led through the entire solution. I'm assuming they only want a kick in the right direction.

If you've taken a hint during the game, you won't get a yellow flower in the garden, even if you come in with a perfect score.

I'm curious to see how this version fares. If you have any opinions on it, I'd love an email or blog comment about it. (Or just write an app store "* - why dose this app evan exist?" review.)

Meanwhile, 1.07 has been in QA so long that I'm nearly ready with 1.08. There's a bunch of niggly performance / feedback stuff that I've finally got round to fixing, which should make the buttons feel more responsive (and in some cases actually be more responsive).

Thursday 21 May 2009

hints

A 'hints' button is probably the most requested new feature for Ancient Frog. Time spent on free updates for Frog is time not spent working on the next game, but since each update gives me a little bump in sales, I'm going ahead and adding this feature. Having hints will also mean I can put some harder levels in the demo without (I hope) alienating people - I'm hoping this will make the demo a more effective sales tool.

It's an interesting problem to tackle, though. I'll start with the technical, and move on to the presentation.

The first thing that's needed is for the game to be able to work out what the best move to make is. This turns out to be really hard. A typical puzzle takes about 20 steps, and each pose can typically reach about 16 other poses, so that makes about 10^24 possible moves to search through. If it takes one microsecond to check a move, it would take about three times the age of the universe to find a solution.

Now, real puzzles don't allow the full range of movement at every step (they wouldn't be very interesting if they did), and there's a whole bunch of optimisations and shortcuts you can take to discard obviously wrong solutions. During development I wrote a tool to check the solutions to every level, and on a fast dual-core machine with 4GB of RAM, I have to leave it running overnight to verify all 100 levels. Some of them it can solve in under a minute, others take over an hour.

Clearly, this isn't going to work on the iPhone.

So what can I do? Well, I can store the solution that was calculated during the build process, and lead the player through that. But that only works if they're at the home position, and if they're looking for hints it's probably because they've tried a load of stuff and got stuck. I could make the game insist that they reset to the start before getting a hint, but that's not very elegant.

A better solution is to search backwards through the cached solution, looking for poses which are reachable in a couple of moves from the current pose. If we find one, we pick up the solution from there. That's great, but it only works if the player is on pretty much the right track. If they've gone off down a dead end, this system won't be able to find a pose in the solution that's close enough to their current position, and we're back to requiring a reset.

Luckily, we have another useful list of valid moves - the undo buffer. Because Ancient Frog stores every move to allow the player to step backwards, the hint system can use that. It just needs to search backwards through the undo buffer, and for each pose, search back through the solution to see if it can step from the one to the other. In the worst case, it would move back through the undo buffer right to the start, and then forward through the cached solution to the end. In practice it can usually get onto the solution after just a few steps back.

As a final refinement, it looks for shortcuts in the undo buffer (the player may have spent some time going in circles, or taking several moves to reach a pose right next to an earlier position), and trims them out.

That's the stage I've just finished. I can press a button, and the game will show me the best next move. It's pretty effective too - I've tried tying it up in knots, and in my testing I haven't been able to create a situation where it seems to be taking longer to get back on track than I'd expect. It won't always get the perfect solution from a pose several moves in the wrong direction, but it does a pretty good job of it. And if you start from the beginning, it will always lead you down the optimum path.

So that's that problem solved. But the aim of the exercise is not simply to find a solution and lead the player through it - it's to provide a hint. What I want is to provide an intermediate goal for the player to aim at, which will help them on their way. One of the criticisms levelled against the game in some of the App Store reviews was that playing it is a matter of trial and error rather than problem solving. That's not the experience I want people to come away with - clearly I haven't done a very good job through the level progression of teaching the tricks of the game. The hint system gives me another shot at it.

In each level there is usually one (or more, in harder levels) core move that holds the key to solving the puzzle. One that I use a lot is the sidestep across a gap:

The key to solving this type of puzzle involves getting into a position such that the hands can plant on either side of the gap, with enough room to swing out of it on the far side.

What I want my hint system to do, then, is identify these core moves, and show them as the intermediate goal. I don't want to manually tag the move for each of the 100 levels (and not just out of laziness - if the player is coming from a position off the cached solution, their core move may be in a different position). So how do I automatically identify it?

I'm currently experimenting with this, and it seems that the foot moving a particularly long distance in one go is a good measure of a core move. But there's work left to do in balancing how many moves ahead to limit the hint to, against how important the core move is. I'm also undecided about whether I should be showing the pose immediately before or immediately after the core move.

The remaining tasks required by this feature become easier to implement technically, and harder to design from a useability standpoint. For instance, I need to decide when to show the hint button - should it always be visible, or only appear if the player is struggling? How do I define struggling? Resetting the level is a good indicator, but some players don't even realise they can do that. When the button does appear, where should it go? only the Daisy corner is in clear space - anywhere else, and I'm in danger of covering up a peg. How do I mark puzzles that were solved with hints? I don't want people to feel they're being penalised for using a feature they were offered, but I've also had emails from people who've been solving the game the hard way and don't like the thought of other players just being handed the solution on a plate.

These are all surmountable problems, and I look forward to fiddling around finding the most elegant solution. But I thought it might be interesting to show what goes into satisfying a request as simple as 'add a hint button'.

Alongside this work, I'm also knocking the PC version into shape for a slightly unusual potential platform - more details on that when it's not a secret any more!

Saturday 16 May 2009

level 79

I had an email from a player who's solved every level at par, except for 79 which he couldn't do in under 26 moves.

Sorry Philip, it is possible.

An impressive achievement nonetheless! It's clearly time I made some new levels...

Wednesday 13 May 2009

Off Sale!

Results of the sale:

  • Day 1 - sales sharply up, with the increase in volume more than making up for the decrease in price
  • Day 2 - sales down, revenue back to where it was the day before the sale
  • Day 3 - started losing money, stopped the sale.

So that was an interesting experiment. Even with Ancient Frog featured in 'What we're playing' with a big red 'SALE!' sticker across it, lowering the price lowered the revenue.

The logical thing to try next is raising the price. I think I'll have to couple it with some upgrades though - new features, and maybe a bunch of new levels.

This business stuff is quite interesting, but I'm definitely happier (and better at) making games than selling them.

Saturday 9 May 2009

On sale!

I had a bit of a jump in sales. It took me a couple of days to work out why (please, Apple, give me some stats!) - Ancient Frog has reappeared in 'What we're playing' on the App Store. So I thought I'd take advantage of that and the bump I expect to get from 1.06 coming out, and put it on sale. See if I can ride it up the charts a bit and make it stick for while.

I've dropped it to $2.99. Of course, I could just make 40% less income now.

I won't keep it on sale for long - and it'll be very short if it doesn't look like the volume is making up for the drop - because I don't see how such a low price can be justified in the long term. Still, the App Store has surprised me before - when I started work on Ancient Frog, I never imagined it going for $5, still less breaking even at that price.

Sunday 3 May 2009

The Demo

I never did write a follow up post about the result of releasing the demo.

The reason is that I'm not really sure what effect it had after all. It certainly didn't reignite sales of the full version - shortly after the demo came out, sales dropped right down to a trickle. On the other hand, I'm not convinced that the demo is to blame - downloads of the free version are also pretty dismal, so I don't think people are getting that instead of the full version.

Sales were heading down anyway when I put the demo out (that's partly why I did it), and I think that as it dropped out of the charts, that accelerated its decline.

It's all just conjecture - I have no traffic stats from the App Store, so I'm just left guessing at what causes the effects I see.

I'm pretty happy with how the game did overall - featuring on the front page did it a world of good - but it would be good if I can stretch its tail out a bit longer.

A few more articles like this: http://www.msnbc.msn.com/id/30508084 would do nicely.

1.06

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

1.05

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

1.04

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 support@ancient-workshop.com 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

history

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:


Poker


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.



Europa

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.




Underground

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.


frog.exe

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:


OscilloMAME


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 2 of 2 -