Where to learn A.I?

Started by
4 comments, last by markblue777 18 years, 7 months ago
Hi all this is my first post so please forgive me for any mistakes of any sort. Well really i just want to learn A.I. i am wanting to make a 2D fighting game and i know i have to use some sort of A.I but i just do not know where to start learning. I know my best option is Neural Networks and i have been searching for a while and from what i see i cannot find any good links to good information so if you can help could could you please post ( please note it can be books as well because i do not mind buying books as long as they are good and other people recommend then) thanks from Mark
Advertisement
Hi Mark,

I would suggest that, if you are interested in AI in general, you might want to consider starting with a Finite State Machine (FSM). These are pretty simple but useful devices that are frequently used in games.

Wikipedia is often a good source of information...


-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

Why do you think your best option is neural networks? IME, neural networks and genetic algorithms are two of the most overused ideas in AI. They can be excellent in the proper situations, but people use them everywhere because they like the idea of simulating nature (with NNs do not and GA only do marginally).

I think a good book would be "AI Game Programming Wisdom", but you can also get a ton of ideas on William van der Sterren's site GCF AI. You'll have to adapt it to your purpose because most information is about RTS and FPS tactics, but fighting games have tactis too (they just offer different choices).
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
ok extrarius. what sort of A.I do you fill would be best suited for a fighting game. I am completly new to A.I so i do not fully know the full nature of the different A.I's abilities and i do not know what the various A.I's i can choose from.
so please tell me a little more
from
Mark
The best AI for a fighting game would probably be (start with the best) pattern matching, a state machine, or an expert system.

In the first type (pattern match), you basically just keep track of what your opponent does and use that information to counter their moves. For example, lets say 1 is high punch and 2 is low kick. If your opponeny does 1112 then 1112 then 1112, you can predict that next time you see three high punches, you do a move to counter a low kick because that's what is coming next. The easy way to do this is to just record all the moves they do in a huge array and see if the last few moves they did is in there somewhere and if it is, then you know what to block for next because they're doing the same thing over and over. This can make a fun and challenging opponent because it is dynamic - if you repeat yourself, it will notice and take advantage of that. If you give it a short 'memory'(meaning it only tracks a few of your previous moves and not 100 or 1000), it will be quite dynamic and always adapating while still allowing a player to have favorite combos they do every once in a while.

The second type (state machine) is where you keep a kind of 'train of thouht' going in your AI. You'll have a variable called State that keeps track of what the AI wants to do, and then each frame you'll do something towards that goal. For example, if State is 'AggressiveAttack' you would need to check how close you are to the enemy. If you're really close, pick a close-ranged attack and use it. If you're far away, you need to move closer or do a special move that gets you closer. If state is 'Defense', then the bot might try to get further away when close and might block a lot whenever it is in close range and do small attacks to push the enemy back. The State variable changes whenever something big in the game changes, such as going from Defense to RangedAttack when it sees the enemy trying to get close quickly or going to Defense when it is getting hit a lot. This isn't as dynamic, but it still mimics the way human players think when playing the game, and it can still provide a challening and fun opponent.

The third type (expert system) is a little easier to implement: you just have to know how to play the game. Then, you just do a bunch of 'if' statements such as If(Oppoenent.LastMove == HighPunch) then BlockHigh();
You're just coding in all the possible situations into your game along with the appropriate response. This can take some time, and it won't be flexible or dynamic at all because it just responds to situations. You could make some chance it would do a wrong move, but it still probably won't be as fun to play against as the two other types I mentioned.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
cool thanks for the description from what i just read there i do like the idea of the pattern match, that sounds fun and as a gamer that is what i would like to fight against because it can adapt to good players and not so good players so i may give that some research is the AI method called "pattern matching" and also do you know anywhere that has good referencee's to it or some code so i can see how it is done
thanks in advance from
Mark
P.S thanks to you all who have helped me

This topic is closed to new replies.

Advertisement