Multipath

0 favourites
  • 5 posts
  • Hello,

    I'm working on a tower defense game in which i planed multi paths for enemies to reach the tower.But enemies selecting only shortest path.Can any one help how to select random path.

  • If you use the Pathfinding, the A* algorithm behind it will only give you the shortest path. You'll need to do the paths yourself if you want it in another way.

    As I did the same as you, here is how I managed multipath : waitpoints. Just put some waitpoints on the paths, and associate a "waitpoint route" for every spawner or every mob (depending on what you want). Then, instead of looking for a path to the exit, look for a path to next waiting point, and again until you are at the objective.

  • You could also blockade one of the ways with an invisible object

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You could also blockade one of the ways with an invisible object

    What happens to the next minion on the same path.. if it needs to take a different route?

    How about if we could have multi target.. and assign certain sequence..

    say minion1 = targets (1,3)

    minion 2 = targets (2,3)

    so that way minion1 would take a different route collecting target1 and then target3 .. than minion2 that'd take 2 first and then 3.

    Eventually both reach 3 in different ways. (ofcourse the way you place targets 1 and 2 matter)

    Ashley ?

  • Here is one way to do something like that:

    Path demo

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)