Wednesday, May 10, 2006

A spaniard in the making

I continue to fool around with the path finding library.

Last time the library required you pass in a list of nodes. Nodes can be through to be tiles, in games like FFT, Advance Wars, Civilization or planets in games like master of orion.

The only thing I required of these nodes was that they knew their neighbours. But this proved to be a problem. Generally in tile based games a single tile does not know it's neighbours. So that meant to use the function - all tiles had to be translated to some intermediate state that did know about neighbouring tiles. Potenitally a rather time consuming translation.

This is how it currently works. But I've decided a much better way is to require two objects 1.) The Nodes 2.) The Node Neighbour Knower.

The Node Neighbour Knower knows when give a node, what those tiles neighbours are. This makes much more sense. Even if all the nodes knew their neighbours it's easy to write a small Node Neighbour Knower class that calls the nodes neighbours function. Ha say that seven times quickly. Where maps know about neighbours rather than tiles, as is probably the more common case, then we can just make the map implement INodeNeighbourKnower and not worry about costly transformations. Cheers all round.

I have several small game ideas perculating you can be sure in the year 2760 when I finsh EINFALL, that I will then make a smaller, rather than larger game.

Recently I added the tag "gamedev" to my del.icio.us inbox and it's really started to pick up a lot more sites. If only so much of what is to be read on the web wasn't rubbish.

I'm going to alter the code in my path finding library and then I'm going to bed.

EDIT:
My path-finding library is absoulutely generic mad. Luckily most of my generic flourishes are invisible to the library user. Still need to actually put some pathfinding in there :D

Oh and I booted up EINFALL and when in search of the city - to find it nicely generated, so that's good. It's very basic, so basic I'm not actually going to put up screen shots :D

This weekend I'm going to be pretty buzy but hopefully I'll get some time sunday. I want to build up my path finding library (this isn't getting sidetracked, as EINFALL will need it later) and probably trying to remove the tearing in EINFALL - this will probably done by stepping through the code and seeing what it does, I imagine this will be eye opening. I have VTune installed but I have no idea how to use it.

No comments: