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

Post Reply  Post Oekaki 
 

Posted By Message

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
22nd January, 2009 at 02:29:57 -

I need some help coding some AI for a platform game.
Well the thing is, I really don't know that much about AI unless I am making a simple back and forth "robot".
I want my enemies to be able to see the player, and when they do, have them chase him.
I want the player to be able to hide behind boxes, use smoke grenades, etc.. etc..

Right now I have it set up so that every so often the "bad guys" shoot a little active object, and if it hits a box, or the smoke or something, it is destroyed. (because the enemy can't see past that point)
Then again, this isn't a very good way of doing a LoS is it? (Line of Sight.)
A problem I have with this method is the game doesn't know which enemy that line of sight active belongs to.
So, when one enemy sees you, they all do, even when they shouldn't.

Any help would be awesome!
Any better ways to do this?
Any tips on my way?

Btw, I am using TGF1.

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
22nd January, 2009 at 03:33:54 -

I made some spottage engine for a zombie game engine I made a while back... if nobody comes up with something better before tomorrow I'll see how I did it and come back.

 

  		
  		

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
22nd January, 2009 at 04:41:44 -

bouncing the detectors back works awesomely. The detectors can then pass all sorts of information back to the enemy.

 
Craps, I'm an old man!

Deleted User
22nd January, 2009 at 05:09:19 -

http://www.create-games.com/article.asp?id=1154

This article got me started. I like the non use of actives for detection.

There is also an algorithm for a circular detection zone in the comments section. If you do a search in the forums you might be able to find on of the threads where sketchy was giving me a hand with an article. I think it's called "need some help following an article". He released a test engine in the downloads, it still should be pretty recent in there. It's for top down engines, but it can be meshed into a platformer.

 

traugott.simon



Registered
  23/08/2008
Points
  91
24th January, 2009 at 18:09:35 -

Bouncing it back is not really an optimal solution.
theres the danger that the detectors dont hit the enemy or hit the false one.

macadam you have to use fastloops and give every detector the same id as the enemy.
only possible via fastloops.


 
n/a
   

Post Reply



 



Advertisement

Worth A Click