Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 fighting game ai help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Shyfire




PostPosted: Mon Jan 09, 2006 10:19 am   Post subject: fighting game ai help

what are some elements of good fighting game ai, like i made some ai but the ai character to hounds the player, how can i make good ai please give me suggestions?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jan 09, 2006 11:05 am   Post subject: (No subject)

a good approach would be to first make your game 2 player (no AI required yet) and then play it yourself against a buddy. Try to figure out what kind of moves you're performing yourself and when/why. This information will give you an outline for an AI.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Albrecd




PostPosted: Mon Jan 09, 2006 1:25 pm   Post subject: (No subject)

All you need are some simple if statements:

if user does a low attack then computer jumps
if user ducks then computer does a low attack

but don't make it too efficient or the player will not be able to win.[/code]
[Gandalf]




PostPosted: Mon Jan 09, 2006 5:43 pm   Post subject: (No subject)

I wouldn't worry about making it "too" efficient. As long as it follows the same 'rules' as the human player, try to make it as good as possible. It will likely still require some tweaking before being challenging.
MysticVegeta




PostPosted: Mon Jan 09, 2006 6:21 pm   Post subject: (No subject)

Ah well I have some ideas. For example if the lvl of the computer is:

-> Noobie,

if (attackByPlayer) and (Rand.Int(1, 6) <= 3) then
block()
end if

-> Intermediate,

Same except change it to Rand.Int(1, 6) <= 4

-> Advanced,

Same excpet change it to Rand.Int(1, 6) <= 5

These are just some basic ideas, of course its way more complicated than that but its always fun Smile
pavol




PostPosted: Mon Jan 09, 2006 6:53 pm   Post subject: (No subject)

sort of like what MysticVegeta said. you randomize a number and then according to what the randomized number was you have the computer make a different move.
ecliptical




PostPosted: Mon Jan 09, 2006 6:58 pm   Post subject: (No subject)

Also one of the best things you can do is to check for distance between the characters otherwise it will look silly.

ie
code:

if PlayerCanHitAi=true then
...check for the types of attacks
end if


I just mention this because sometimes it is over looked and the end results look retarded
poly




PostPosted: Tue Jan 10, 2006 10:15 am   Post subject: (No subject)

I agree with what others have said, here is some of my knowledge I used for making my stick fighting game.

A few years back I made a stick fighting game in turing and I had a pretty good AI (whether the AI was added to the gamefile I uploaded on the forums). I found that to make a "good" enough AI you can't just have it where he goes strictly on attacks. So what I did was made an energy bar of 100% for both players. Every step would take away 1% of energy, while a punch took 3% and a kick took 5%.
Now you could make several instances of AI, even a Easy, Medium and Hard mode.
You could code it so in EASY mode the AI will walk towards you and with collision detection have it where he will only waste 11% of energy at a time on you. Once he has wasted that 11% of energy he then will walk around and gain back 8% of his energy before he comes and attacks you.
For MEDIUM mode you could have it where he will unleash a fury attack towards you at wasting like 35% of his energy on you (whether it hits you or not) then has to walk around and gain 25% of that back
HARD you could have it where they waste like 65% of energy on you and then only goes and gains back 40% before coming after you again.

It made sense and worked when I did it, I don't know if I did a good enough explanation for it though - I used a lot of what these guys have suggested also - you randomize the attacks with randInt etc etc
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: