# Multipath

Get help using Construct 2

### » Mon Jul 15, 2013 12:06 pm

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.
B
4
S
1
Posts: 11
Reputation: 374

### » Mon Jul 15, 2013 12:11 pm

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.
B
17
S
9
G
4
Posts: 473
Reputation: 6,311

### » Mon Jul 15, 2013 1:25 pm

You could also blockade one of the ways with an invisible object
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

### » Mon Jul 15, 2013 7:30 pm

> 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 ?
Krish
Hey! Did you know that you can hire me to make your games?

B
21
S
6
G
5
Posts: 391
Reputation: 5,672

### » Mon Jul 15, 2013 7:41 pm

Here is one way to do something like that:

Path demo
B
24
S
9
G
7
Posts: 756
Reputation: 7,342

### Who is online

Users browsing this forum: No registered users and 10 guests