Another week is nearly over and I feel that we are still progressing well as a team. Having talked to the others they all seem to be proceeding well with their areas of research and I feel that I’m doing pretty well as well. I’ve now finished a first version of a 3d graphics/maths tool-kit that gives us access to matrices, matrix stacks, frames and view frustums. It also has a 4d vector class in it that was provided by Kieran. It also includes a maths class that has definitions for commonly used constants like Pi, and 2Pi and also has methods for converting between degrees and radians.
In addition to finishing the graphics tools, I have also started outlining the algorithms for our path-finding, I’m sure it will be no surprise to anyone with even the smallest interest in AI that we will be going with an A* algorithm, however we will be running the algorithm over a navigation mesh rather a way-point map. This is slightly more complicated to implement, but gives a more realistic movement to AI controlled characters.
A navigation mesh breaks the play area down into a number of convex polygons, some implementations only allow triangles, some allow n-sided polygons, personally I feel that triangles will be easier to utilize A* with but n-sided polygons may be easier to create automatically (we hope to have auto-generation of the nav-mesh, although that may well be a second term project). The search algorithm then finds the quickest route between the start point and destination point, each polygon is given a cost value that is often based on average distance between the centre and the edges, or average distance between the centre of each edge. The actual path however will be worked out using an algorithm that will calculate line of site and so smooth the path of the unit.
I’m currently working on a couple of diagrams to clarify the exact process in my head, and will post them up here when I get a chance in the meantime however there is a simple explanation here.