Page 1 of 1

AI

Posted: Fri Sep 07, 2007 10:19 am
by KanedaFr
Well, if there is something I really unable to understand it's AI

I can find an approach, I already read thousands of articles on it and still, I don't understand.

Thanks to Fonzie, I find a way to code an (fake) AI for a race game.
I already analysed a fight game when CPU fighter use a mix of time left/blood left/previous attack/distance/random to know what to do.
There is a lot of ressource about shooting game (not a lot of AI).

but about others....?

In fact, only one kind of games minds me : SLG
Even I don't play them a lot (they need times), I like games like SForce, AWars, GadgetTrial, Senryaku Musume or others tactics and I hope to make one ...
If making a P1 vs P2 isn't that hard, I really don't know how to make a Player VS CPU :(
I only see one approach : at start, any CPU 'heroe' looks for their goal (based on their HP/MP for ex) and properties (defend boss, kill main character, heal allies). If a death occurs or a main heroe is in difficulty, we redefine these goals.

Some hints or links guys ? ;)

Posted: Fri Sep 07, 2007 10:46 am
by TmEE co.(TM)
Sooner or later I run into the same problem... but in a shooter, I guess "search and destroy" will be the most efficient... and maybe "if player too strong then retreat"...

Your idea is good too...

Re: AI

Posted: Fri Sep 07, 2007 11:16 am
by Shiru
KanedaFr wrote:...
I only see one approach : at start, any CPU 'heroe' looks for their goal (based on their HP/MP for ex) and properties (defend boss, kill main character, heal allies). If a death occurs or a main heroe is in difficulty, we redefine these goals.
I don't know any of games, which you mentioned, but seems you speak about TRPG genre (something like FF Tactics, Front Mission, etc). So, your idea is generally right - AI characters must have goals, usually 'kill enemy main character'. In other part, it's like chess/checkers/gomoku/etc games. AI checks all possible moves (even maybe for some moves forward), except ones that mismatching for goals, and in order of assumed effeciency. Then most effective move must be selected and performed. That is hardest part of algorithm, you must find some criteries and formula to calculate moves efficiency. Depending from algorithm, that also can include or not include AI characters interaction (team AI). Checking for all moves usually takes time, you can see it in many TRPG games when many characters in battle (so, many moves is possible).

Posted: Fri Sep 07, 2007 11:36 am
by KanedaFr
hmm...you're right, it's an interesting and more 'challenging' way...
I check what is the best (cost less, ...) way to move for every npc every turn.
Now, with this, you can make an invicible CPU ;)
I think a 'stupidy' property for each npc can handle this...like 'this is the best move but since you're stupid, choose between this 3 good solutions'

interesting....
I just found (it's always like that, it's when I ask others people that I find a way to the answer) this link: the 4 first articles are very interesting


oh, and yes, it's TRPG! they had so many names! It's why it's hard to find one on PC, they are often in RPG (so many to test) or Simulation (with C&C and The Sims(!) )
I don't talk about finding them in non-asian language!

Posted: Fri Sep 07, 2007 11:40 am
by Fonzie
Ya :)
I'm more or less coding the fight part of a rpg :D So I have to face the problem too ;)

For example, I have several enemies minds like "bastard", "frustrated", "scared", "hero"... Depending of those settings, the formula between "run away", "attack", "defend" slightly edits + there is always the help of random numbers ;)

And the enemy can always "cheat" by knowing your HP level and the attack you're going to do ;P héhé :) Keep this in mind, especially for the "bastard" mind ;)

Posted: Fri Sep 07, 2007 8:01 pm
by Chilly Willy
There's really no such thing as "Artificial Intelligence" in computers. It takes too many resources to even begin to simulate properly. So what you wind up with is more like instincts, pre-programmed reactions to certain stimuli, or often called "AS - Artificial Stupidity" by programmers.

You might want to look up the A* algorithm (pronounced A-star). It was long used by PC board routing software, but has since been applied to many aspects of games, from choosing paths for computer characters, to determining which actions are "best" based on the current state of the game.

Posted: Fri Sep 07, 2007 10:27 pm
by Shiru
Chilly Willy wrote:..called "AS - Artificial Stupidity" by programmers.
Don't know about other world, but here there is sort of game programmers joke - 'I in AI means not Intelligence, but Idiocy'.

Posted: Sat Sep 08, 2007 3:22 am
by Chilly Willy
Shiru wrote:
Chilly Willy wrote:..called "AS - Artificial Stupidity" by programmers.
Don't know about other world, but here there is sort of game programmers joke - 'I in AI means not Intelligence, but Idiocy'.
Yes, quite true, and a good play on the actual initials. :lol:

Here's the wikipedia entry for the A* algorithm. It's probably a good place to start with that particular subject.

http://en.wikipedia.org/wiki/A%2A_search_algorithm

Posted: Sat Sep 08, 2007 4:47 pm
by KanedaFr
yeah, I knew about A* .
Quite useful for a tactic game when a NPC's goal is to reach and kill a guy.
I was more after what kind of action use, how to attribute them to NPC, etc... with as little as needed of intelligence.
it's pretty easy to make a game when you can't win (0 error, perfert tactic and cheating) but a lot harder to make a game 'playable' and hard enought to give the player pleasure to play and restart if he loose.

Posted: Sat Sep 08, 2007 6:29 pm
by Chilly Willy
At the bottom of the wiki page is a link back to the category page, which has a bunch of different AI algorithms. You might check if anything there is useful.

Posted: Mon Sep 10, 2007 8:29 am
by KanedaFr
I found interesting topic in AI Wisdom...

very very interesting!

Posted: Mon Sep 10, 2007 1:51 pm
by TmEE co.(TM)
VERY VERY VERY VERY interesting !!!!

Posted: Wed Sep 12, 2007 10:56 am
by KanedaFr
other links I found

http://www.gameai.com/influ.thread.html
http://www.gameai.com/strat.thread.html
they are old so interesting because they don't assume you already know the basis.


http://www.gamasutra.com/view/feature/1 ... s_for_.php
this one have some weeks !!!
funny...