Game Development Community

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

About the author

Recent Threads

  • text with sprite

  • #1
    05/22/2014 (4:18 am)
    Stock T2D MIT does not have intelligent path finding. I have seen the A* algorithm implemented in older versions of the engine, both in script and C++. If I were to implement path finding, I would start there.
    #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
    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).
    #5
    02/23/2015 (6:45 am)
    Hey Jason,

    Not sure if you're still looking for a path finding solution for t2d. If so checkout this resource. Should just drop in for you.

    I realize this thread is rather old, but I figured I'd post an update to close the loop.

    -RT