point 'n' click adventure pathfinding?

BlitzMax Forums/BlitzMax Beginners Area/point 'n' click adventure pathfinding?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

try a simple 2d grid then which is your room, and you simple walk from a to b by interpolating between these 2 points. To prevent walking through walls you could create a look-up for that grid. The lookup has, like, points moved away from walls.. uhm..

room:

.   .   .   .   .   .   .   .

.   .   .   . | .   .   .   .
              |
.   .   .   . | .   .   .   .
              |
.   .   .   . |  .   .   .   .

.   .   .   .   .   .   .   .


lookup:

.   .   .   .   .   .   .   .
            .   .
.   .   .     |     .   .   .
              |
.   .   .     |     .   .   .
              |
.   .   .  .  |  .  .   .   .
            .   .
.   .   .   .   .   .   .   .


As you see I 'moved' the gridpoints a bit around the wall.

No matter where you are in that grid, you can just walk to anywhere looking that look-up, the gridpoints force you to walk around the wall. Doesn't really work for very big 'n complex rooms with zillions of walls in all kinda shapes, but for simple stuff it might work..