Multipath

Get help using Construct 2

Post » 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
Posts: 11
Reputation: 224

Post » 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
8
G
4
Posts: 461
Reputation: 6,097

Post » 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

Post » 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?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662

Post » 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,292


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, lwgames and 6 guests

cron