In what class should global pathfinding information go?
by Josh Albrecht · in Torque Game Engine · 04/30/2003 (6:23 pm) · 3 replies
I have some nice node-based pathfinding stuff working, thanks to David Massey's tutorial he posted on the forums a while ago. His code stores the nodes inside the interiorInstance class, and as a result, the pathfinding only works after entering that building. I would like to add those nodes to a global vector of pathfinding nodes so that players can navigate the entire map.
However, I am curious as to where the best place to create such a list of nodes would be. I thought perhaps something like terrainBlock, but I'm not so sure. Both the clients and server need access to this node information. I looked at the documentation about the structure of the engine, but i still couldnt decide where the best place would be.
If anyone has any thoughts or suggestions as to what the best place for a list of pathfinding nodes would be, I would love to here them. Thanks! :)
However, I am curious as to where the best place to create such a list of nodes would be. I thought perhaps something like terrainBlock, but I'm not so sure. Both the clients and server need access to this node information. I looked at the documentation about the structure of the engine, but i still couldnt decide where the best place would be.
If anyone has any thoughts or suggestions as to what the best place for a list of pathfinding nodes would be, I would love to here them. Thanks! :)
#2
04/30/2003 (9:21 pm)
Thanks, but that isnt exactly looking for. I already have something like that working in my game. I want to know in what class I should create a structure to hold the information for all the pathfinding nodes so all clients can access it. He does it in the script. That isnt efficient at all.
#3
This may not be the exact solution you want, but it's not a bad one either. Very easy for mappers to use this because they can see where the waypoints would be. At most you may want to duplicate the Marker class with a Waypoint class, take out what you don't need from marker, and add info if you need it.
05/01/2003 (5:01 am)
Josh. Look at the "Marker" object. I implimented some camera keyframing stuff for kicks (sigh, working on the patch) and how I did it was just to create a mission group and throw a bunch of markers in it, they contain position and rotation, and used them as keyframes, then interpolated between them. This may not be the exact solution you want, but it's not a bad one either. Very easy for mappers to use this because they can see where the waypoints would be. At most you may want to duplicate the Marker class with a Waypoint class, take out what you don't need from marker, and add info if you need it.
Torque Owner Ben Swanson