The Daily Click ::. Forums ::. Klik Coding Help ::. Creating AI
 

Post Reply  Post Oekaki 
 

Posted By Message

Pontus Lundin



Registered
  31/05/2006
Points
  18
12th April, 2007 at 15:16:41 -

Hello.
I am trying to create AI in my game that I am making with "The games factory V. 1.06" program.
I want monsters to follow the player. When the monster collide with the player, the player takes damage and loses health. When the monsters walks into backdrops or active objects that are not ment to pass trhough, the monsters should only bounce, or rahter looking like they are doing the moonwalk (like in real pro games you know) And when they are boucning into each other they shall not combine with eachother either. It would be prefered if I could learn how to build a pathfinding system, but not so much needed.

I hope someone could help me out, without this problem being solved I'm stuck in my work and cannot go any further.
I would be happy if someone could create a simple example gam file but a simple explanation is okay.

I have tried alot and I cannot get the Boucning of backdrop to work. they keep walking passed the backdrops from time to time and I cannot figure out how to correct this error, PLEASE help!

Thanks in advance, hope to get helped soon.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
12th April, 2007 at 15:47:19 -

Enemy collides with background
-Bounce
Did you set the backgrounds to Obstacle - Yes
Simple AI tutorial i found on my computer (topdown): www.solcon.nl/s.tennapel/aiandpathfinding.zip

Image Edited by the Author.

 
Oh sweet mary.

Bo Fu



Registered
  02/04/2004
Points
  413

VIP Member
12th April, 2007 at 22:51:31 -

In addition, to stop the enemies from overlapping one another:

Enemy collides with Enemy
-Enemy: Bounce

 
If wishes were fishes then we'd all smell like ladies' underwear.

Pontus Lundin



Registered
  31/05/2006
Points
  18
13th April, 2007 at 09:08:26 -

The thing I downloaded failed to work. something called "gffloop.gox" is missing!
And I have tried the bounce thing. Unfortunate the enemy tends to pass through the obsticals sometimes and even themselfs sometimes despite that boucing. Dunno what to do.


Image Edited by the Author.

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
13th April, 2007 at 10:19:43 -

Download Fastloop foor TGF.

 
Old member (~2004-2007).

Aptennap



Registered
  23/04/2004
Points
  916
13th April, 2007 at 11:38:02 -

What are the events of the enemies?
Fastloop : http://files.cellosoft.com/extensions/FastLoop16.zip

Image Edited by the Author.

 
Oh sweet mary.

Pontus Lundin



Registered
  31/05/2006
Points
  18
14th April, 2007 at 01:57:01 -

The Idea.
The idea is to make monsters follow you around the frame.
preferbly that they can look the player up. I dont know how to do so, so I havent done much about the AI so far.

I have set so that:
ALWAYS monster (that is a ball moving object) is looking at hero.
When collliding with backdrop, bounce.
When colliding with active object "Wall", bounce

That is pretty much what I have done really.

BTW When I tried to open that pathfinding thing they program complained that it is missing more files. This time it was "gfdirect.gox". any webpage where I can find these files. Might be more files that I need.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
14th April, 2007 at 03:09:20 -

That's Direction Calculator : http://www.clickteam.info/extensions/extview.php?id=185

No wonder, the enemy is going through the wall, he always faces the player so when he bounces he will just face the player again and go through the wall. You would have to make that when the enemy faces a wall he must find a way around it...

The tutorial I gave you is just waht you need it will find the player and then begin to shoot it (but you can change that part in anything you like, ofcourse). One qeustion : why do you have an active object 'wall'?

Image Edited by the Author.

 
Oh sweet mary.

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
14th April, 2007 at 07:04:05 -

I have set so that:
ALWAYS monster (that is a ball moving object) is looking at hero.
When collliding with backdrop, bounce.
When colliding with active object "Wall", bounce



Careful, I did this a lot back in the day and what you'll get is the famous Michael J. Fox movement for your foes. They'll continuously bounce and stutter haplessly into the walls and you may not want that.

I used the equally famous but much better "Last Known Location Pursuit Method" for Lab Rat #37 and it is a really cool way to get enemies to follow your hero around. The article is at or near the top of the best articles on TDC, you should take a look.

P.S: Sorry Michael J. Fox, but it's what I could come up with upon short notice.


 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
14th April, 2007 at 07:07:17 -

Oh, and Aptennap it's possible that he has an active object for a wall because he plans on doing something cool with it in game. For example, Hasslevania's main walls are obstacled backdrops but there are also active objects in there for secret walls you can break and etc.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Pontus Lundin



Registered
  31/05/2006
Points
  18
14th April, 2007 at 14:14:42 -

Thank you all so much. This gave me a much better view upon how to solve things. I hate to ask, but the example could be easier to understand if there was some info to read how it really works.




Image Edited by the Author.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
14th April, 2007 at 15:33:45 -

Well i didn't make the example i just found it on my pc, i have a lot tgf tutorials and examples on my pc (72meg).

 
Oh sweet mary.

Pontus Lundin



Registered
  31/05/2006
Points
  18
14th April, 2007 at 15:42:38 -

Oh okay. Well Im gonna get how these things works eventualy
Would be faster if there were mre info. Again thanks it's enough to be able to continue

What more example games do you have?
I have been playing with KnP and TGF a very long while in my life, but it isnt until now (since I found communities) that I have begun to expand my knowledge. Feel like a total newbie

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
15th April, 2007 at 01:09:22 -

Platform, mario, radar, paralex, zelda scroller, 32 dir shooting, 360 dir shooting and some other stuff...

 
Oh sweet mary.

Pontus Lundin



Registered
  31/05/2006
Points
  18
15th April, 2007 at 04:34:11 -

Could you upload some or is there a place you know where I can get these examplefiles?

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
15th April, 2007 at 05:05:43 -

http://www.create-games.com/downloads.asp?genre=Engine&ord=
http://www.create-games.com/downloads.asp?genre=Tutorial&ord=



 
Old member (~2004-2007).

Pontus Lundin



Registered
  31/05/2006
Points
  18
15th April, 2007 at 13:29:02 -

I should have seen that
Thanks for the help... Now I just have to learn how all this work. To bad not much of the ai examples have more explainations. like that Example you gave me. I did exactly like the example file and it didnt work. Well I didnt make any with the player section. But the player section couldnt be that important?

Having a real ahrd time understanding how to build a Ai

 
n/a

Reno



Registered
  11/01/2005
Points
  906
15th April, 2007 at 17:49:17 -

If you want some AI then you give the NPCs needs to fullfill so that they are full of life and active. This allone with good pathfinding code and object 'traits' can make a swell AI engine.

 
Reborn Again

Pontus Lundin



Registered
  31/05/2006
Points
  18
17th April, 2007 at 13:38:52 -

What I want is an Zombie AI. A groups of zombies chasing me in a frame. The amount of Zombies differ but Maybe total of 10 zombnies in one frame. I am having a hard time understanding how to create a good stable AI. Im begging that someone could tell me where to get a good example game where there will be a pretty good explaination along with it. Preferbly that someone makes a example game That is focused on zombies and such... I hate to ask stuff but I cant really figure out this AI stuff. especielly now when Im talking about groups of zombies like 10...

 
n/a

savvy001



Registered
  27/03/2007
Points
  295
21st April, 2007 at 06:33:07 -

try this
line 1
zombie alterable value = 0 every 2.0 sec when zombie reaches window edge les then +300 set movement to movement 1
(bouncing ball) set speed to 10 and the direction to player 1 / movement start
this way he wil chace you when on screen

line 2
every 0.2 sec when zombie collides with player 1 ad 1 to zombie alterable value 1

line 3
when zombie alterable value 1=1 every 0.1 sec set to path movement 1 / movement start
when zombie alterable value 1=2 every 0.1 sec set to path movement 2 / movement start
when zombie alterable value 1=3 every 0.1 sec set to path movement 3 / movement start
when zombie alterable value 1=4 every 0.1 sec set zombie alterable value to 0

when player = overlapping zombie every 0.3 sec ad to alterable value 1

the zombie wil not bounce but play with you by moving away folowing a different path each time and comming back after a while
mean while ad some attacks in between and your set
tweak the timed actions to your needs
or do something else rather then the path movements

hope this is usefull
greetz

 
Living in space

Pontus Lundin



Registered
  31/05/2006
Points
  18
26th April, 2007 at 12:13:32 -

Thanks for the help. having hard time understanding this help but I might figure it out. btw IS this ment for MMF program. if that is the case, then i need to know if this works on TGF version.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
26th April, 2007 at 16:03:58 -

It will work in TGF.

 
Oh sweet mary.

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
27th April, 2007 at 12:21:30 -

when zombie alterable value 1=1 every 0.1 sec set to path movement 1 / movement start
when zombie alterable value 1=2 every 0.1 sec set to path movement 2 / movement start
when zombie alterable value 1=3 every 0.1 sec set to path movement 3 / movement start


Okay, not to sound like a total tool but MULTIPLE PATH MOVEMENTS??

Is this done with the default path movement for active objects? This would rule because it'd make my own enemies a lot more interesting than just back n' forth, up n' down, blah blah the same all the time.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Aptennap



Registered
  23/04/2004
Points
  916
27th April, 2007 at 15:38:33 -

Yea your right Tgf doesnt support multiple movements...

 
Oh sweet mary.
   

Post Reply



 



Advertisement

Worth A Click