Posted 27 August 2005 - 11:35 AM
My main idea at the moment is to have a pre-defined network of nodes for each scene (perhaps detailed in an XML file, methinks) and then to dynamically create nodes at both the position where the player sprite is, and where the user has clicked. The only problem with this is, I'm unsure as to how I would determine the neighbour nodes of the two dynamic ones. I've thought about a system of finding the nearest nodes, but this is unsatisfactory, as those nodes could be behind an obstruction, or something.
Another Idea I had was to dynamically create a whole uniform grid of nodes every time the user clicks to walk anchored around the start and end positions, and putting nodes on the closed list based on an image with the no-go areas blacked off. This seems amazingly inefficient, though.
Right, so none of these seems quite right, so I'm hoping that someone here has a better head for these things than I do! does anyone have any suggestions as to how I'd go about doing this?
Thanks a lot.
Posted 27 August 2005 - 09:49 PM
You should tell us more about the type of space we are searching.
You could define the world as a network of connected areas covering all of the game world, and then whichever area the player is in is the first search node. This will only work for a world that is broken up a lot.
Posted 28 August 2005 - 01:33 PM
I'll look into GPG1 (I might be able to sneakily flick through it at a local book shop, or something), though, thanks a lot for the suggestion.
Posted 28 August 2005 - 02:56 PM
This way you can easily build a mesh representing the walkable surface in 3D Studio MAX or some other content creation package.
Using a triangular mesh you can also create paths which look more natural, since they can pass through any point along the connecting edge of the triangles, instead of one pre-defined line.
If you do manage to check out GPG1 you'll see some good examples of this.
Posted 29 August 2005 - 07:15 AM
That is quite a good idea, actually, brilliant in its simplicity. I'd considered a square grid but thought that it would make movement far too quirky; I just didn't think to use tiangles! Thanks a lot for the suggestion... now to make it work:- I guess that's bye bye bank holiday (and beyond...)!
And Nomad, that site was a great help while writing the algorithm, but now I've got it I need to make it work!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users