Sunday, 18 October 2009

Lara, I Love You!

Recently I had another song broadcast on One Life Left, a radio show about videogames. In fact, an award winning radio show about videogames! I reckon it was my songs what won it!!!

The recent effort was actually a collaboration (something which to my great discredit I failed to inform the OLL team of, so my collaborator was uncredited!). We'd hoped he'd supply guitars to beef up the sound (with a solo verse, no less!), but it wasn't to be. Still, he supplied a couple of gag ideas and maybe a rhyme or two, so he should have received some of the limelight! Sorry ...

Anyway, it's an ode to Lara from an admirer. Enjoy!

Tuesday, 6 October 2009


I've been busy recently with XNA stuff, trying to get a nice physics model of a vehicle going. You soon discover that you accumulate a huge number of "settings" - constants that affect the behavior of your model. Tweaking these to get the best values you can (or maybe different styles of behavior for different "makes" of vehicle), can be a bit of a pain, restarting every time you want to make a tiny change and test it.

Imagine my delight then when I read this article by awesome XNA blogger Sean Hargreaves about "Tweakables" - the idea that you set up these constants so that you can adjust them on the fly, while the game is running. I knew I had to implement this - it's just too useful not too! (See Sean's next article for other potential uses).

I looked at Sean's suggestions for how to implement this in XNA ... but of course, I thought I had a better idea.

So I created a custom attribute, "Tweakable" (of course!), which I added to some of my static properties (which were simple, lazily coded public member variables until then). Then I created a form which iterates through all the types in my game's assembly, and for any "Tweakable" properties it finds, it adds corresponding controls onto the form (some work here to give them nice labels, organise into a tab per type, etc etc). Finally, an event handler is dynamically added to the controls so that the property is updated when the control is "left".

Et voila - when my game loads I also get a form for adjusting all the "tweakable" properties I like!

I intend to implement the ability to save all the current settings to file, and load them again, plus to start with an initial set. This way, I can save settings I like or which are useful for debugging, and I can exchange settings the rest of my "team" (there are three of us working on something together). I also need to expand the types of variables supported (admittedly just floats so far - will certainly need Vector3's which may require a custom control ...).

Thursday, 10 September 2009

Le Mans

Another thing we did on holiday, was to make our pilgramage to Le Mans. There's a rather nice museum there - I took many, many photos of cars old & new, like this one:

Some legendary names - Go Jonny!!

I say that without irony - there have been more successful British Formula One drivers, but Jonny's still a hero in my eyes!

Speaking of heroes, here's me absolutely demolishing the lap time of the previous guy to have a go, while my eldest looks on:

They also had footage of that Mark Webber incident, where the Merc he was driving took off. Spectacular stuff!

Wednesday, 9 September 2009

Starry starry night

See, I said I'd blog some more!

On holiday in France near Royan, we heard it was going to be a good night for comets. Unfortunately, it quickly transpired that you can't really take photos of comets (at least, I certainly can't), but the night was AMAZING anyway, so clear (I swear you could see the galactic, erm, colorful stuff, y'know).

I knew I'd brought the tripod for a reason! I pointed the camera straight up and after a few experiments managed to capture the following with a 20 minute exposure:

Quite pleased with that, actually ...


Hi to both of my readers! I know I've been a bad blogger recently ... I intend to get back to it (with a vengence) now that memories of my holiday are distant. Watch this space ...

In the meantime, if either of you are feeling charitable, I'm doing the "Corporate Markets Challenge"(!) through my work, and need to RAISE MONEY to help the poor children. THINK OF THE CHILDREN!!!

So if you could sponsor me, it'd be much appreciated. Just visit, and please mention my team, "JIST Pick a Name", in your comments.

Thanks! You'll be rewarded with new blog posts soon ...

Wednesday, 29 July 2009

Born To Run

Just finished reading Born To Run, by Christopher McDougall, which is an awesome book. And now I want to do a 100-mile race. Unfortunately, 5k is more my distance at the moment.

Still, I've ordered some FiveFingers and hopefully that'll strengthen my feet up, as I get fitter and start attaining ultra-running distances. Probably I'll be up to 100 miles by next month ...

Wednesday, 22 July 2009


I tried adding bloom ... it didn't entirely work. Not sure what was going wrong ...

Then I added Lens Flare (which doesn't work on my laptop anyway because it doesn't support "occlusion queries"!) ... and the bloom started working! I'd prefer to understand why this happened, but hey, it looks real purdy now!

Tuesday, 21 July 2009


Having abandoned clever-clever terrain stuff for now, I've run with bog-standard terrain stuff and got as far as creating a "hovership" to fly around it.

I spent a while getting the "dynamics" pretty good - it feels fun to fly now (although I'll still work on it for a while).

This picture is with some slightly "looser" settings, so it's not so much hovering as full-on flying. Looks nice, but this isn't intended to be an air combat game.

Do you like the "fog" effect?! I think I'm going to spend a little while applying some "bloom" and maybe normal-mapping to the terrain. I might add shadows, although my laptop can't generate them (the 360 will be able to!).

Then I have to start thinking about bullets (or whatever), enemies, AI, multiplayer, power-ups, more scenery objects (to hide behind, for instance) ...

I'm going to be busy!

Football Fiesta

I was privileged recently to be invited to photograph the local junior football fiesta (on a strictly amateur basis, of course!). Here are some of my efforts.

The FA Cup ... as you do:

This kid was great - I love the pointing finger:

Nice penalty:

Nice day for it:

Spot the right leg competition:

Throw it precisely ... there my son:

Celebrations (for some, anyway):

The loneliness of the goalie:

Jazz hands:

The Barclays Premier League Cup:

The ladeez:

I do need a better lens next time, though ...

Sunday, 12 July 2009

Deathfield 1943

I've had a quick go of Battlefield 1937, or whatever year it's supposed to be, on Xbox Live Arcade. My experience goes something like this:

Run to nearest area of battle (takes about 3 minutes)

Repeat ad nauseam.

I'm the guy at the bottom with 10 points, from one kill the whole game.

What am I doing wrong?! I really, really want to like this game, but somehow it's just not working for me ...!

Suspect Sphere

The sphere terrain is mostly done, and it looks, well, ok ...:

This looks better in motion! But the normals aren't quite right, and it's a bit jagged, frankly:

Other problems - holes:

The pic's a bit small, but there's not supposed to be a hole up there! Also a big tear at one location:

All slightly depressing. This, coupled with thoughts about how we'll determine the "height" at a given location of the surface (measured in polar coords?) has given me a headache, and I'm considering throwing _this_ away too, and going back to basics - a common-or-garden, flat height-map. I think I'll still join it at the sides and top-to-bottom (so it's topologically a torus, geometry-fans!), because I don't want invisible walls and it's a reasonable way to avoid this.

But sphere would have been cooler ...!

Oh well, it emphasises that for a first project, the mantra "Keep It Simple, Stupid!" is worth sticking to.

Saturday, 11 July 2009

Chase Challenge

I ran in the JPMorgan Chase Corporate Challenge in London last Thursday. If you search on "Stephen Minton", you'll see I ran the 5.5k (I think?!) course in about 32 mins - not bad, especially considering how jam-packed it was!

Thursday, 9 July 2009

My lovely wife

My lovely wife knew I was a bit stressed with work, and she bought me a pressie - Tiger Woods PGA Tour 10 for the Wii. She really is very, very lovely!

I've played a couple of rounds so far, and it's just what I'd hoped for - "realistic" enough to be a good challenge, without overdoing it. The motion+ controller stuff seems to work nicely, I get none of the false readings I'm used to seeing in (say) Wii Sports golf.

What a lovely wifey!

Monday, 6 July 2009

Triangles galore

I got the lower-level-of-detail patches working. The scheme is something like this:

A bit hard to read (sorry!), but this was me working out how to navigate round all those triangles in an ordered fashion, to create a sensible triangle strip. Part-way through implementation looked like this:

Quite pretty in it's own right! Eventually I'd done it - it now looks like this:

You can see the "high-detail" joins. I'm also losing some of the rear-facing patches (though I don't do this right at the edges - we'll want to see any high "mountains" on those just-over-the-horizon bits).

Next steps - get it to dynamically choose either the high or low level of detail for each patch, and cull off-screen ones. Then I need to apply a height-map ... no idea how I'm going to get that to wrap properly yet ...!

Friday, 3 July 2009

Terrain ... ONNA SPHERE!!!111

So, lots of work on a clever algorithm which reconstructs a triangle strip for every frame, cleverly including / excluding vertices on an individual basis, clever clever clever. I did an awfully clever implementation of this (well, ignoring the view fustrum culling bit), and the whole thing was looking jolly clever.

Possibly too clever.

I decided it was overkill for a game, taking up precious CPU every frame which would be better dedicated to AI or graphical effects or physics processing or whatever. So I've shelved it, probably for good.

Not one to make life simple for myself, however, I've turned instead to spherical terrain, or "planets" if you like, Super Mario Galaxy-style. I'm going for a geodesic dome-style division of a sphere. Turns out these are pretty simple to construct - you start with (say) an octagon, and then recursively divide each triangle into four smaller ones, pushing the new vertices out onto the surface of the sphere you're trying to approximate.

This is a really rough drawing ... but you can follow the subdivisions by colour, red then green then blue then pink:

I'm doing my subdivision in two stages - two or three iterations to get me a set of "patches". With two iterations, that's 8x4x4=128 patches. Then I further subdivide in each patch, creating perhaps 32 rows of triangles. This arrangement allows me to test distance / visibility etc against each patch, and then render the patch (or not) accordingly, so 128 checks instead of a brazillion (see below).

That framerate's not looking too good though (7 frames per second!). Let's count up how many triangles we're talking about (let's ignore the fact that we've got a count up there already - 38656. For boring reasons, this isn't what we're going to get to anyway).

Start with an octagon (so, 8 triangles).
Split each triangle into 4, twice (so 8*4*4=128).

So we'll have 128 patches.

Then for each patch, we'll have 32 triangles per side. That's 32*33/2=528 triangles per patch.

That's 128*528=67,584 triangles total.


We don't need to see patches on the far side of the planet, in fact, we'll probably only be able to see about 32 patches maximum.

And, of those, we'll probably view roughly a third (let's say 12) at full resolution. The rest, we'll have at 8 triangles per side.

But we need the patches to join up nicely, and in general they won't. If we have a patch at 32 triangles per side next to one at 8 triangles per side, we're going to get gaps. So we "fill up" the edges of the low-res patches so that they're full resolution along each side. So each patch will have:

3 corners with 7 triangles = 21 triangles
18 edges with 4 triangles = 72 triangles
36-21=15 remaining triangles = 15 triangles

(this picture is with four triangles per side, but you get the idea!)

Total: 108 triangles

So the grand total once we've done all this is:

12*528 + 20*108 = 8496

That's not so much, is it?!

Now, is a 67k polygon planet going to be detailed enough? Some VERY rough sums: A planet with 0.5km radius (roughly what I'm aiming for), has a surface area of about 1.5km squared. That's 2.25 million square metres of territory. So our triangles will be about 33 square metres in size (say, 6m x 6m).

Hmm, not bad, but I'd like to get it better than that. Still, I've satisfied myself that a scheme along these lines will work - I can afford to have more than 8.5k polys in my terrain I reckon, plus I was conservative in a few places with this estimate. And I can consider (for example) three different levels of detail for each patch. With some tweaking, we should end up with a rather good environment to play in!

Thursday, 2 July 2009

Terrain part 1

... so, I'm fiddling with xna a bit. Trying to implement some good-looking terrain. I was inspired somewhat by Shamus Young's blog, which led me to this paper, and I set about implementing the algorithm described therein (I'm a sucka for this sort of thing - one day maybe I'll tell you about the time I implemented a lossy networks algorithm from a PhD thesis!).

I've got it sort of working. Here's a "naive" implementation with no clever algorithms (btw, the numbers at the top are frame-rate and number-of-triangles respectively):

Here's a couple of images at two different levels of detail. The algorithm is building a triangle strip dynamically (you can see the arrangement of the vertices is different to the picture above - that's because it's a quadtree in the algorithm, which leads to a different layout).

Now we get to the next point where the algorithm determines which vertices to include, and builds a (potentially complex) triangle strip:

Then I tried to implement the view fustrum culling part ... it isn't quite working:

I may pursue this further if I have some energy, but I think it's probably not the right route to go for a game anyway ... this algorithm runs every frame, regenerating a fresh triangle strip each time, which is probably overkill for a standard game. I'm going to explore some other options next, I think ... watch this space!