• Create Account

### #ActualDgekGD

Posted 05 August 2012 - 03:57 PM

Probably, for such algorithm as A*, you have to convert your terrain to pathfinding graph firstly. For example, in my game i check the slope of every triangle of the terrain:
float slope = 1.0f - normal.y;

and if the slope is close to 1.0f, then i mark this part of terrain as unwalkable, otherwise convert it to the node in pathfinding graph.
In resulting graph just use A*.

When a character moves, game automatically sets y position(height) of a character based on the position of a triangle below it.

### #1DgekGD

Posted 05 August 2012 - 03:56 PM

Probably, for such algorithm as A*, you have to convert your terrain to pathfinding graph firstly. For example, in my game i check the slope of every triangle of the terrain:
float slope = 1.0f - normal.y;

and if slope is close to 1.0f, then i mark this part of terrain as unwalkable, otherwise convert it to the node in pathfinding graph.
In resulting graph just use A*.

When character moves, game automatically sets y position(height) of a character based on the position of a triangle below it.

PARTNERS