Walkable zones

Started by
10 comments, last by Trienco 18 years, 5 months ago
An analogy can be made between the 2d walk map and the collision mesh. The collision mesh would allow for better movement in a true 3D environment. Just simplify (viz. remove) all detail of the wourld mesh, and add in walls where you don't want the player to go. Test world collisions against it, but draw the world mesh.

Which method is best depends on the nature of the game. Dungeon Siege maps are put together like a puzzle from many tileable nodes. There is no collision against most environment entities (trees and such). And there is no true collision with things like building walls. Instead, there is a narrow band of unwalkable polys that border walls. Since the no walkable poly ever meets the wall, you can't go through it.

The collision mesh wouldn't work well for such a pieced-together world. It's better for maps modelled as a solid unit, and I'd imagine it to end up looking like a network of canyon-like tracks.
Advertisement
Are you using the 2D map for A* or the polygons themselves? Because you might end up with a whole lot of tiny cells in the 2D map. If you could simply store a pointer to all neighbours for each polygon you can directly use them for the pathfinding. Just set the neighbour ptr to 0 if something is not walkable or seperated by a wall. Could also be used for other things like line of sight, just follow the line through each intersected polygon and check if the side it would leave through is blocked or not (and maybe test all objects within that polygon). Not so useful if the map is very highres and you have more polygons than you would have 2D cells, anyway.
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement