The Daily Click ::. Forums ::. Klik Coding Help ::. Side Scroller Visual AI, any ideas?
 

Post Reply  Post Oekaki 
 

Posted By Message

AuraDragon



Registered
  13/03/2009
Points
  14
16th March, 2009 at 02:01:50 -

Hey,

I came up with an idea for a Side Scroller Stealth Action Game's AI, and just wanting to know what people thought of it, I haven't fully coded it as of yet...

Okay, so every 'Guard' has an ID for starters, and they have a Field of Vision cone (which also has an ID and is invisible) for starting detection, once the Player enters the cone the Guard shoots half a dozen invisible particles once a second at half a dozen points on the edge of the Player's character's body, using the Advanced Direction extension, trig and a loop to calculate the exact direction to travel and moving a short distance at a time (3 pixels?) until either reaching the player's body or colliding into an object, this is also checked in the loop.

That's all I have so far, but upon detecting the player it changes one of the Guard's flags(a caution state flag), using the ID to figure out who's flag to change, and if the player is detected again by the next second's detection the next flag will change to set the guard's state to Alert, the rest is undecided on how it works exactly.

:] Any comments, or suggestions on how to do it a better way? Since multiple guards and multiple detection loops could get rather nasty for the game performance. As for sound, I assume just making different sized circles pop up for a second based on the amount of noise, with either a circle around the Guard's ear or just the guard's whole body for detection (which would be rather crude as legs can't hear last I knew ).

EDIT: This is for MMF2



Edited by AuraDragon

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
16th March, 2009 at 02:12:07 -

Explain why you need to shoot the particles? O_o

Maybe I misunderstood the point.

 

  		
  		

AuraDragon



Registered
  13/03/2009
Points
  14
16th March, 2009 at 05:04:45 -

Oh, I forgot to explain that, but I assumed it was obvious: They are for testing to see if the target would be visible to the guard if it were real life. If it hits a wall it is destroyed, if it hits the player, any part, it changes the guard's state accordingly.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
16th March, 2009 at 13:12:07 -

Well i see what the point of the particles is, but why go to all that trouble, the only one who would notice that the detection is almost perfect would be you, to everyone else it'd just be another simple detection engine. I think you would only need to shoot one particle from the head of the guard to the middle of the player, and you wouldn't need a detection cone, just run a loop to check though all the guards that are on screen(use the condition "distance of guard from the edge of the frame is NOT 20 pixels" or whatever), then shoot the particle from there.

 
n/a

AuraDragon



Registered
  13/03/2009
Points
  14
17th March, 2009 at 06:27:38 -

The thing is, using a cone should make it easier to prioritize which Guard is seeing the player in the case of having multiple guards in the same general area, and also using the particles are for the case that a piece of the player is sticking out from behind an object. I'll adjust as I make the engine a bit more.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
17th March, 2009 at 13:32:50 -

Well I guess it all depends on the resolution of your game and the average amount of guards on the screen at one time. I guess I'll have to see it when you're finished, but it just seems like an awful waste of system resources to use so many objects for such a simple engine.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click