Path finding
by Jason Fermor · in Torque 2D Beginner · 05/21/2014 (8:49 am) · 5 replies
Hi. How would I go about path finding? Basically I want an AI character to move to the position of the player. I thought about using the moveto function but this means the ai will also pass through any boundaries rather than going round them. Thanks. Jason
#2
05/22/2014 (4:49 am)
Where could I get an old version from to have a look? Or is there anyone willing to write the code for me? Obviously I will pay for your hard work. Thanks. Jason
#3
05/22/2014 (5:42 am)
The old code wouldn't work for you. The legacy engine systems are very dated compared to T2D MIT.
#4
In TGB the t2dTileMap and t2dTileLayer had A* support. These objects were removed and we gained the much more flexible CompositeSprite in the conversion to T2D MIT. However, the A* pathfinding support was not re-implemented because it is not base game functionality - it is only used in a handful of games and time/labor constraints sealed the deal. It makes more sense to keep the engine lean and only provide (and maintain) core systems when you have a shortage of hands to do the work.
The good news is that there are dozens of good A* tutorials on the internet. I know that a few people here on the forums have implemented light versions in TorqueScript and I believe someone mentioned moving their implementation engine-side (not sure on the state of that).
05/22/2014 (7:38 am)
First, the bad news:In TGB the t2dTileMap and t2dTileLayer had A* support. These objects were removed and we gained the much more flexible CompositeSprite in the conversion to T2D MIT. However, the A* pathfinding support was not re-implemented because it is not base game functionality - it is only used in a handful of games and time/labor constraints sealed the deal. It makes more sense to keep the engine lean and only provide (and maintain) core systems when you have a shortage of hands to do the work.
The good news is that there are dozens of good A* tutorials on the internet. I know that a few people here on the forums have implemented light versions in TorqueScript and I believe someone mentioned moving their implementation engine-side (not sure on the state of that).
Employee Michael Perry
ZombieShortbus