The Daily Click ::. Forums ::. Klik Coding Help ::. Legend of Zelda AI coding
 

Post Reply  Post Oekaki 
 

Posted By Message

c-jayf



Registered
  06/07/2003
Points
  274
22nd June, 2005 at 21:47:53 -

If anyone has played the original LoZ for NES, and knows what the AI is like, could someone help me think of a way to make an enemy like that?

 
I hate witty signatures.

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
23rd June, 2005 at 04:39:04 -

Maybe you should just put a programmer wanted ad in the Solitaire Club?

I'd help you with this, but I haven't played Zelda in ages... besides I feel lazy.

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
23rd June, 2005 at 05:11:24 -

Why would this go in Solitaire Club? He's just asking how to do LoZ enemy movement.

 
n/a

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
23rd June, 2005 at 05:22:26 -

He asked before on how to make a LoZ like menu. (did the thread get deleted?)

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363

c-jayf



Registered
  06/07/2003
Points
  274
23rd June, 2005 at 16:04:09 -

Phredreeke, your Menu system didn't work either. Thanks anyways. All i want to know is how I can get the enemies to pursue Link. Im running off of TGF, so it's not too easy. (for me anyways). I've been programming for several years, prolly 4. I can do it, but im not a problem solver. So i need help once in a while.

 
I hate witty signatures.

c-jayf



Registered
  06/07/2003
Points
  274
23rd June, 2005 at 16:05:41 -

Ps:
Phredreeke, play Legend of Zelda. It's fun.

 
I hate witty signatures.

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
23rd June, 2005 at 20:05:58 -

if TGF has the ball movement option

Look in direction= position of link 0,0
movement start

that should send him on links trail (i hope....)

@jay.. i just bought the minish cap on the GBA and its good stuff, what do you think of capcoms attempt?. i personaly think the GFX are better than that of nintendos original.

Image Edited by the Author.

 
n/a

c-jayf



Registered
  06/07/2003
Points
  274
23rd June, 2005 at 22:48:22 -

The only problem is the TGF's ball motion is 8-dir. only, so If the Deku(or w/e enemy) is persuing him, he might go diagnol.

I bought Minish cap, and I loved it for 3 days. Then I beat it. Personnally I think the original is better, but thats because I think originals are unbeatable. I thought it was kind of cool that they attempted to redo the graphics or windwaker in 2D tho. Pretty cool stuff.

Image Edited by the Author.

 
I hate witty signatures.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
24th June, 2005 at 00:15:16 -

Alright, this is going to be a little fiddly in TGF.

The original LoZ movement, as I recall, has the enemies meandering around aimlessly for a while till they spot you, then chasing after.

I was going to go pretty in-depth here, but I just thought of something easier. Anyway, the movement:

Value A of an enemy is its direction, value B determines for how long it gives chase.

Value A(Enemy) = 0
Value B(Enemy) = 0
--Enemy: Set X position to X(Enemy)+1

Value A(Enemy) = 1
Value B(Enemy) = 0
--Enemy: Set Y position to Y(Enemy)-1

Value A(Enemy) = 2
Value B(Enemy) = 0
--Enemy: Set X position to X(Enemy)-1

Value A(Enemy) = 3
Value B(Enemy) = 0
--Enemy: Set Y position to Y(Enemy)+1

Value B(Enemy) = 0
Enemy is NOT overlapping a backdrop
Every 0"2' [or whatever]
--Enemy: Set value A to random(4)

At this point it'll wander around randomly. The following events handle background collisions:

Value A(Enemy) = 0
Enemy is overlapping a backdrop
--Enemy: Set X position to X(Enemy)-2

Value A(Enemy) = 1
Enemy is overlapping a backdrop
--Enemy: Set Y position to Y(Enemy)+2

Value A(Enemy) = 2
Enemy is overlapping a backdrop
--Enemy: Set X position to X(Enemy)+2

Value A(Enemy) = 3
Enemy is overlapping a backdrop
--Enemy: Set Y position to Y(Enemy)-2

Just pops him backwards out of a wall. The following spots if the Player is in front, so it'll run faster.

Value A(Enemy) = 0
Player X > Enemy X
Player Y > Enemy Y - 20 [or whatever]
Player Y < Enemy Y + 20
--Enemy: Set Value B to 20 [or whatever]

Value A(Enemy) = 1
Player Y < Enemy Y
Player X > Enemy X - 20
Player X < Enemy X + 20
--Enemy: Set Value B to 20

Value A(Enemy) = 2
Player X < Enemy X
Player Y > Enemy Y - 20
Player Y < Enemy Y + 20
--Enemy: Set Value B to 20

Value A(Enemy) = 3
Player Y > Enemy Y
Player X > Enemy X - 20
Player X < Enemy X + 20
--Enemy: Set Value B to 20

And then the original movement, speeded up:

Value A(Enemy) = 0
Value B(Enemy) > 0
--Enemy: Set X position to X(Enemy)+2

Value A(Enemy) = 1
Value B(Enemy) > 0
--Enemy: Set Y position to Y(Enemy)-2

Value A(Enemy) = 2
Value B(Enemy) > 0
--Enemy: Set X position to X(Enemy)-2

Value A(Enemy) = 3
Value B(Enemy) > 0
--Enemy: Set Y position to Y(Enemy)+2

Value B(Enemy) > 0
--Enemy: Subtract 1 from value B

Thats fairly simplistic but it should be fairly close to the LoZ AI given that they can only move in 4 directions. It doesn't take line of sight into account but I don't think the NES game did anyway.

Image Edited by the Author.

 
n/a

c-jayf



Registered
  06/07/2003
Points
  274
24th June, 2005 at 00:27:29 -

Thanks Again, Radix. I owe you... like... 3.

 
I hate witty signatures.

Sashman15



Registered
  14/11/2004
Points
  93
24th June, 2005 at 01:48:38 -

Oh, well my noob-ish way was to make an invisible ball-movement object that follows Link all the time but really slowly, slowly enough to stay behind a good bit. Then make line-of-sight for enemy, when he sees player, he starts following or "looking at 0,0"(coordinates from ball)the ball, and when he collides with the ball-movement object, he looks at 0,0 of player and follows him, if enemy cant reach player within a certain time limit(have a counter with max of like 80 counting down by 1 every 0:05), then have enemy look at/"follow" the invisible ball-movement object again, until enemy catches Link/player, or until Link/player exits the area. Well, help me out if im wrong, or just dumb.

Nice Radix, yours make a little more sense than mine, .

Image Edited by the Author.

 
Heyya, what you sayya?

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
24th June, 2005 at 02:50:15 -

Did you use a custom engine or the built in one?

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363

Sashman15



Registered
  14/11/2004
Points
  93
24th June, 2005 at 08:30:42 -

Who?

 
Heyya, what you sayya?

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th June, 2005 at 11:20:59 -

i did almost exactly what Radix wrote once, if i can find the gam file, i will post it.

done
http://www.scorpione.co.uk/AndyUK/topdownai.zip

it's not complete but should be enough to give you a rough idea how it works. I havnt played Zelda for the nes but i guess it is similr to this.

 
.

c-jayf



Registered
  06/07/2003
Points
  274
25th June, 2005 at 15:16:51 -

I did use a custom engine, yes.

 
I hate witty signatures.
   

Post Reply



 



Advertisement

Worth A Click