Over the last few weeks I've been trying my hand at rigging up a basic navigation mesh for path finding. Using a navigation mesh should allow a more natural feel and responsiveness to character movement while moving through the map.
The general theory is quite straight forward, polygons are created on the walkable areas of the map and are linked together if they're direct neighbors. The pathfinder then uses the edges of each polygon to navigate through the mesh.
The initial implementation of this is quite basic and only uses the centre points of each edge so the paths used still look like they're on rails but I plan to update it so the whole area of the polygon is used.
The red lines in the examples below are the paths generated from the start to the end points, not elegant but a good start
Well it turns out that there was a major issue with the new shadows where they didn't maintain the correct positions if the parent was moved. It was visible in the previous video as the parent was situated at 0,0.
A little annoying but glad it reared it's ugly head sooner rather than later.
Onwards with pathfinding, currently working on a navigation mesh for path finding.
Its been a few months since any sort of update, mainly due to other commitments but I was also struggling with getting my head around how to tackle randomised building generation. At this point my plan of action is.... I don't. I can get away with having a few different variations of each building which will do for now. In the future I could always create an algorithm to make it completely random but that'll be saved for another day.
A couple of days ago I began writing a separate prototype for the buildings which includes a new method for handling shadows. The new shadows can now work with any polygon which should work nicely with the effect I've got in mind for the game's atmosphere.
Below shows the prototype in action, it achieves the effect I was after and only uses 162 triangles but this will likely multiply five fold once the textures are sorted out and extra elements like furniture are added.
I know the textures are ropey but it's just a quick prototype to demo the progress. It's also a good testbed for building related feature development.
So at the end of the last year I entered the Oryx Trial with a somewhat poor entry and unsurprisingly didn't win. I didn't expect to but the point of entering was to push myself into writing some classes which would be used in my other game. I must say it's also inspired me to get back into the game development side of things.
Since the new year I've made a big push and managed to get the random city pretty much sorted and integrated with the 3D stage. Now although this is pretty much regurgitating previous posts, a lot of work went into rewriting big ol' chunks of code for it to work more accurately and quicker.
Now the main thing that's up with this example is that there's a delay when you hit the edge of the city block, this shouldn't be a huge issue as I've purposely scaled the map down to down to show this. The map is really ten times the size so by the time the player reaches the edge of the map, the neighbouring block would have already loaded (in theory =P) The way the map works is on a 9x9 grid, when the player reaches half way through a block it starts loading in neighbours. The delay is present as threading in AS3 is still in beta so I'm currently daisy-chaining the processing off the main frame rending. When the player moves to a new block, the loaded blocks shift over so only new blocks have to be loaded. This now does mean that you can walk infinitely in one direction and the city will keep generating buildings around you.
There is a minor issue where some buildings don't get loaded which I shall have to look into but I'm happy with the progress at this point. There are still a few pieces which can be optimised at this stage but I thinking I'll work on a different piece of the game for now. I'm really hoping to have something fresh for the next post as this is yet another post which contains the same as previous entries but with minor updates.