Pathfinding in a Multi_Level world
first i'm not sure that the term Multi_level world is clear but i can expain it as a world with multi grids such as a bulding with 3 classes. ofcourse the pathfinding is very expensive in the games in a world without levels of searching grid.. but what about the multi_Level world, and how can we perform the pathfinding. i.e suppose the game's type is a FPS game and the world consist of Levels. When enemy player see the main player he will attack him or find a path to be more close to him and attack him.... but when the player is in another level differ of the enemy player the pathfinding will be complicated. I gess that in order to solve this matter we must suggest new structure of the grid and new helpful algo beside the A* algo. help me please Thanks advanced.
A* does not just work on grids, it works on graphs. If you add connections between floors/levels/whatever to your graph, A* will find paths through multiple floors. This will be somewhat more complex for grid-based worlds where you could just use the grid for a graph in the simple case, and now you have to take inter-floor connections into account, but it's not very hard. (My own A*-on-grid code has some ugly part where it goes to add the nodes above, below, left and right of the current node to the open list - if I'd add a check there for an inter-level connection at that tile, paths to other levels would become possible.)
It would also be most unrealistic if an enemy knew where you were and started pathfinding when you are several levels away from the enemy.
thank you marijnh.
It's nice to hear that A* algo used in the Multi level world - if the term is true - but i don't know what the way to do that..My algo do finding path just in 2DGrid so i think to use the graph to attach the grids together.
in my last year project - which is 3DGame Engine - I do the following:
- the enemy walking in the world by a graph of way point that defined in the editor ..so when the enemy did'nt see the main player he will walk (move between some nodes determined in special area ) by the graph without spend any time in A* algo.
- when the enemy see the main plyer he will use A* on sub_map which attached to him runtime and so he will attack and persuit the main player.
i havn't the time to be assure of my algo but as begining i gess it's good somewhat, but i know it isn't profisional and don't work correctly.
have you another way?
And can you please give me more info about using A* in the multi level world?
It's nice to hear that A* algo used in the Multi level world - if the term is true - but i don't know what the way to do that..My algo do finding path just in 2DGrid so i think to use the graph to attach the grids together.
in my last year project - which is 3DGame Engine - I do the following:
- the enemy walking in the world by a graph of way point that defined in the editor ..so when the enemy did'nt see the main player he will walk (move between some nodes determined in special area ) by the graph without spend any time in A* algo.
- when the enemy see the main plyer he will use A* on sub_map which attached to him runtime and so he will attack and persuit the main player.
i havn't the time to be assure of my algo but as begining i gess it's good somewhat, but i know it isn't profisional and don't work correctly.
have you another way?
And can you please give me more info about using A* in the multi level world?
A* works on any set of nodes. A grid typically means that each node has 4 neighbours. All you need to do to change it is make sure that nodes which lead to other neighbours are represented appropriately, for example by adding a 5th neighbour connecting to the appropriate grid space above or below. You will probably also want to alter your heuristic by assuming that locations on different levels are further away than the equivalent location (in 2d space) on the same level as the player.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement