The Daily Click ::. Forums ::. Klik Coding Help ::. More AI challenges
 

Post Reply  Post Oekaki 
 

Posted By Message

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
8th September, 2006 at 22:51:32 -

For the past month, I've been working on a side scrolling platform tournament shooter game. Not dissimilar to Teddies Armageddon (mady by U2) which was released fairly recently or Friendly Strike 2 (made by Calimero) and Fatal Bout (made by a FA member) to name some classics.

Now there are certain AI challenges that arise when making a game like this. Some of them I have solutions for, others I am baffled with. I'll list everything below. Take or contribute what you will/can from the following:

Movement
-----
Essentially, AI movement will be handled by nodes and paths that are scattered throughout the level. I'm not relying heavily on detectors that follow the player's collision box as much as making independent floor/wall sensors built into the actual levels.
Key presses are simulated using alterable values for AI characters so controlling or changing their movement is as easy as changing their respective alterable values. For example Alterable Value (AV) A represents the left arrow. So I make an event saying if AVA = 1 then move the character left. If AVA = 0 then stop moving the character.


Targeting
-----
This is what I'm having one helluva time with. I want to be able to support up to 6 players (up to two of which are human). I need a system for each AI controled character to identify and target an enemy. This means the AI must first sort out who is an enemy and who is not (for teambased play).
As you can imagine, the pool of enemies can vary from 1 - 5 so hard coding stuff in would be fairly inefficient and mildy retarded. I've yet to successfully discover a dynamic system.


Fighting
-----
To make AI characters shoot at their target is fairly simple. A line of sight detector is needed. However, what's slightly trickier is to make the AI character jump/dodge incoming fire. Additionally, it wouldn't be very tactical to constantly try to shorten the distance between the AI itself and the target. A dynamic system needs to be in place so that the AI has a comfortble shooting range from the target - not too close and not too far. While this sounds easy, too rigid a system will cause the AI to do stupid things become very predictable.

That's pretty much it. If anyone has made a similar type of game, please post your thoughts. Klik can certainly use another good side scrolling arena shooter and I hope this thread helps anyone else who's looking to make one.

Zi-Xiao

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
9th September, 2006 at 19:22:20 -

Wow. No contributions so far. Oh well. Anyways, I've been trying different things and I've come to find certian solutions to the problems I have above. However, these are by no means the only solutions and far from the best. So there's still lots of room for input and criticism.

Targeting
-----
I've essentially made a distance comparison between characters. I've given the computer controled AI a Alterable Value named 'Target' which ranges from 0-5 (so 0=player1 1=player2 2=player3 etc). Each 'Target' integer represents one of the other players. I then hard code a comparison between the distance between the AI and another character (player1 for example) and every other character. If the condition is true, I would set the AI's 'Target' value to match the character's (player1=0 in this case). If the condition is false, it would simply move onto the next comparison with a different character (player2). With this method, it is also easy to add in a line of code which compares the 'Team' value of the AI and the character its doing the comparison with so that the AI excludes all of its team mates from the search.

thats about all I've figured out and there's still some bugs to wrinkle out. For some reason the AI's movement loop gets inturrupted every now and then for no apparent reason. I'm currently trying to figure out if its a mmf bug or a fault in my code.

Zi-Xiao

 
n/a
   

Post Reply



 



Advertisement

Worth A Click