Zelda Style Enemy Patrol

Get help using Construct 2

Post » Tue May 29, 2012 10:30 pm

I would like to ask your help how to make enemy patrol on random positions like Zelda game, there a concept pic what im talking about:



I tried to make one, but it's unstable and unplayable i managed to put random expression it goes wrong...


Would you help me?
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Wed May 30, 2012 12:07 am

Basically, a random grid based movement?
Sorry, haven't played Zelda in a while, not sure exactly what you're asking.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed May 30, 2012 2:33 am

[QUOTE=sqiddster] Basically, a random grid based movement?
Sorry, haven't played Zelda in a while, not sure exactly what you're asking.[/QUOTE]

Grid based movement is not required, just simple 8 or 4 dir movement.

You can see these pics if you remember:



B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Wed May 30, 2012 3:01 am

Just clever use of waypoints, triggers etc. Can be tricky, specially in more complex maps. Of course that's not the only way.
B
58
S
13
G
10
Posts: 632
Reputation: 12,515

Post » Wed May 30, 2012 5:23 am

[QUOTE=Kiyoshi] Just clever use of waypoints, triggers etc. Can be tricky, specially in more complex maps. Of course that's not the only way.[/QUOTE]

I've done this before, well i couldn't make a correct random waypoints
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Wed May 30, 2012 12:08 pm

just tried something for fun gridPatroling.capx
Last edited by Yann on Sun Sep 14, 2014 9:12 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed May 30, 2012 9:43 pm

[QUOTE=Yann] just tried something for fun http://dl.dropbox.com/u/23551572/C2/gridPatroling.capx[/QUOTE]

Nice one! that's a lot of events

It makes me wonder how to stop moving enemies for some seconds according my concept pic, i tried to put "Wait X Seconds" to some events what happen to detect the collision, it stopped every enemies and cant continue moving. How i should to do?
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Fri Jun 01, 2012 2:36 am

Bump, i would like to know it's possible to make an AI enemy may randomly chooses the different waypoints with horizontal and vertical (no diagonal)
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646

Post » Tue Aug 14, 2012 7:29 pm

Hey Man, can't you use 2 local variables to work for you?

(I'm also working on some Zelda style game, haven't tried this yet though)

One variable we call "Time" and the other "Direction".

You just remove X*dt from "Time" every second and when it hits 0 you call a event that sets "Direction" to random.
Then you determine the AI direction by the number you get with a event:
If 0 go UP / If 1 go DOWN... ETC!

Set "Time" to a something above 0 again. (perhaps a Random number for variety?).. and repeat!



Just an idea I just had.. I will also try it out!

Schoening2012-08-14 19:31:19
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Tue Aug 14, 2012 7:29 pm

You probably found some solution already ^^
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Next

Return to How do I....?

Who is online

Users browsing this forum: Callan S, getplay, Kagubro and 21 guests