Wednesday, 29 June 2011

Reflections on resolution

We have reflections! They are even diffracted by the waves in the water.

Ok, the math(s) is bullshit and I'm almost certain that diffraction isn't even the right word but it's a great way of soaking up some of that excess graphics power on iPad2


It's a little sad really, iPhone4 and the old iPad can handle it perfectly well at reduced resolution but I think people are more worried about counting pixels than the quality of those pixels. Of course we could give iPhone4 owners the option to run in pretty-but-standard-res mode or more-basic-but-retina-res mode but people would just get confused wouldn't they?

Tuesday, 28 June 2011

Topia: Herding and Emergent Gameplay

The gameplay side of Topia is still very much in the experimental stages but since the herding went in we've found ourselves losing a lot of time to it, even though it really isn't what could be called a 'game' yet.

Josh made a video of himself playing and it's up on Touch Arcade.




He seems to get something very different out it from me, in fact he seems a little fixated on building mountains under herds and watching them slide off, often into the sea. I think he finds this soothing...

I found 'playing' it distracting in a slightly different way. I'd been working on the herding for a while and have certain types of creature tending to join with others into small herds (that's what the little red hearts are about) and these small herds join together to make big ones.

I was trying to take some pics of a very big herd for the previous post but it turned out that a bug had turned into a gameplay feature: When a creature dies I have to do a little maintenance to make sure that it's removed from any herd it's in. I suspected this 'herd maintenance' code was causing a problem so I quickly hacked it out and replaced it with something to make the entire herd disperse as soon as a single creature drowned.

So there I was, trying to get as big a herd as possible together but trying to avoid any of them falling in the water (instant death, for now) which becomes virtually impossible when there are more than 100 creatures in the same herd. The 'game' became trying to keep track of the entire herd, building land to stop the stragglers falling into the water and dying.

This 'game' proved strangely addictive. Each time I failed to save them all the herd would 'explode' into a crowd of confused individuals who would then start to reform in a sea of hearts. After a minute or so there might be a herd as big as the original or maybe it would be split into three, all moving in opposite directions so I'd move back to coaxing them back together.

Two hours later I grabbed a few screens and made myself stop wasting time.

This really wasn't even part of the planned gameplay though now people have seen and enjoyed it, it may end up becoming part of it. It's at times like this that I'm glad I'm not working to some designer's plan.

Wednesday, 22 June 2011

Topia: We have herding!

More info on what this is doing and a movie coming very soon but for now, here are a few quick screen grabs of herding version 0.1



Sunday, 19 June 2011

Magic Carpet: Settings for High resolution

Thanks to some helpful pointers from people playing the game I managed to get Magic Carpet working in high resolution. The game was written in such a way that it doesn't handle CPU speed increases elegantly or indeed at all really (only partly my fault) so GOG have shipped it with DOSBox's 'cycles' set to 20000 which is about right for running it with the default options.

Magic Carpet in all it's foggy 640x480-with-reflections glory


If you edit dosboxMC.conf and change cycles=70000 seems about right for 640x480 with all of the useful options turned on.

Run it and the game will be way to fast in low resolution but press these keys:

R to change the resolution
F5 to turn on reflections
F6 to turn on the sky

and it seems about right. You can also press F10 for stereo mode if you have red/cyan 3D glasses but that needs even more cycles to make it playable.

ctrl-F11 lowers the cycle count
ctrl-F12 raises it

140000 seems about right for hi-res stereo mode.



Saturday, 18 June 2011

Magic Carpet re-release

On Thursday evening I discovered, after being alerted by a Facebook 'mention', that Magic Carpet had been re-released for Windows on gog.com. As I hadn't played it for a long time I paid up the $5.99 and downloaded it. It turned out it was 'just' the original packaged up with DOSBox but the price was right and I was very unlikely to get round to setting it up myself. That would have required all sorts of hassle like trying to work out where my boxed copy of the original is for a start.

Screenshot from the Edge review


It was weird to be playing a game I wrote the graphic engine for seventeen years ago and once I'd checked the manual to work out how to turn all of the options on, several things struck me. 

  • The reflections and animated water were pretty cool for the time. 
  • Stereo 3D with red/cyan glasses was (and still is) cool.
  • Stereogram mode was a stupid idea, specially when I got the maths so very wrong (1/z not z you idiot).
  • Sean had done a pretty good job of moving all that stuff around at a decent speed.
  • What to do at the start is so much more confusing than games these days.
  • DOSBox emulation of the 640x480 Vesa mode we used for 'high' resolution is really, really slow.
  • The draw distance is pretty pathetic.

Sadly, that last one is the thing that strikes you the most as you try to play. The fog really does seem to start just in front of your nose. I think I should warn anyone reading this that most of the rest of this post is probably going to turn into an excuse for this pathetic draw distance.

I had been working the Graphic Engine for Magic Carpet for a while. In fact, for the a year or so I was the only programmer working on it. It was aimed at 50+ Mhz 486 CPUs and pretty well optimised when you consider it textured with gourad shading and translucency. In my prototype version the tiles/triangles that made up the landscape were about 20 metres across and it drew, I think, 20 tiles before the fog faded it out completely. This meant you could see 20x20 = 400 metres before the fog faded the 'horizon'. Characters, trees, the lumps in the landscape and the speed of the carpet were all scaled accordingly.

then some smart arse decided it would be cool to make castles and things out of the landscape itself. These looked kind of cool but suddenly the tiles had to be the width of a castle wall or the walkway that the archers patrolled to defend it. Now the tiles were only about 2 metres across. The engine still only drew 20 tiles to the 'horizon' (I couldn't up this number and expect a decent frame rate on the target hardware) but 20x2 is only 40. The fog now kicked in at just 40 metres. characters were scaled up accordingly, the landscape smoothed out and the carpet's speed scaled up by a factor of 10. Suddenly it only took about a second or so to fly to the 'horizon'.

This sort of thing doesn't happen when you code games on your own...

Since trying to play it I've downloaded the mac version of DOSBox but haven't got round to trying it yet. Hopefully I'll be able to play in glorious 640x480 'HD' when I'm only using one level of emulation*. I had previously been running DOSBox (an emulator*) on Windows7 running on VMWare (an emulator*) on my iMac.

*Is it emulation when it's all related Intel CPUs? I really don't know. 

Thursday, 16 June 2011

Topia: Age of Creation

I've been working on this for a while now and the engine behind it for rather longer. Since WWDC information is starting to trickle out such as this very early hands on Video on Touch Arcade so I'm going to start blogging about it here.
  • It's not going to be an RTS.
  • The engine is completely dynamic, the landscape can and does change in realtime.
  • The world isn't really a sphere, it's using the maths behind one of coolest, simplest tricks I ever saw in a game (Populous the beginning) by Alan Wright, ex of Bullfrog, now at Lionhead to fake a very convincing sphere which is then almost as simple to work with as a flat surface.
  • Another primary goal is to get more stuff moving around at the same time than anyone has seen on a handheld device. I'll almost certainly go into this in another blog post when I can get some time off working on actually programming to make it happen.
Gameplay is still at the experimental stages and is still in a state of constant flux as Josh Presseisen from Crescent Moon Games and I continue thrash it out over IM.



Friday, 3 June 2011

Ground Effect OpenGLES2.0 Update

As many of the more recent App Store reviews have pointed out, the current version of Ground Effect does not support native iPad. This isn't because I didn't try increasing the resolution, it was the first thing I did when I bought the original iPad on the first day it was available.

Sadly it turns out that the emulation of OpenGLES1.1 on iPad and iPhone4 is broken in a few ways. The most significant of these for Ground Effect is fog. The quick iPad version ran at a rather pathetic 13 FPS!

Some people suggested I should just turn the fog off and shove out an update but I really didn't like the way the game looked without the subtle fog.

Instead of the easy option I decided to look into converting the whole codebase to run under GLES2.0 on devices that support it (3GS, iPod Touch 3rd gen, iPad, iPhone4, iPod Touch 4th gen and iPad2) while older devices fall back to good old GLES1.1

This update will be released fairly soon but has taken a back seat because of other exciting, distracting projects.


The screenshot above is from the almost finished build, seen here running at 30 FPS on iPhone4 at Retina resolution. Note the new craft, water with specular highlights, water that takes shadows of the landscape and higher resolution landscape textures.

Try to ignore the black trees, lack of fog and the fact that I could have just printed a '2' in the corner of the screen and it doesn't actually prove the game is running 30 FPS (60/2=30) at all.