Need a (very) little help with 3D A* Pathfinding

Blitz3D Forums/Blitz3D Programming/Need a (very) little help with 3D A* 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.

Frank/jfk

On types: they are great, and I use them heavily, but ... using types in pathfinding for your nodes can slow things down a slight bit. Primarily this is because it takes time to allocate memory every time you create a new node with the New command, and free it up again with the Delete command. This time is very small, true, but when you multiply it across hundreds+ nodes in a single pathfinding attempt, and do path finding for dozens of units in any given frame, it becomes meaningful, particularly on older, slower machines.

That's why I use arrays for pathfinding. They are faster because once the memory is allocated, you're all set. Also, because the total # of nodes on the map are usually unchanged, you don't need all the benefits of dynamically creating and deleting the nodes.

If you are targeting more recent machines, and don't really care about the very slight performance hit, use whatever you are most comfortable with.

PS: Frank, I checked out your 3D proggy. Looks cool. How do you make the little guy move around? The mouse and the arrow keys only seem to move the camera.