AI [deleted]

Started by adm244, Fri 09/07/2010 06:37:49

Previous topic - Next topic

adm244

*deleted*, because that was stupid

evenwolf

#1
I tried to translate but I give up.  It's impossible to translate this.  

Yes, I understand you want advice on making AI for AGS.  That's all I can figure out.   Please try again, perhaps with another website or program.


(Я не могу перевести ваши слова. Да, я понимаю что вы хочет консультацию о AI в ваших играх. Я не могу понять чего вы сказали. Пожалуйста пробуйте снова с другим вебсайтом или программируйте.)
"I drink a thousand shipwrecks.'"

SSH

I'm sorry Dave, I'm afraid AGS can't do that...
12

evenwolf

#3
Hahah SSH.  

I think you can create the "illusion" of AI dialog.  But only one or two branches of random variables could be explored with any realistic outcome.  

For instance, you could create random strings representing an emotion the NPC feels.   And you can create dynamic reactions to those random strings.   But after that you're fucked.   The variables become exponential.

Of course you're probably talking about another kind of AI.

adm:  use "search".  I'm sure there's tons of discussions on this.
"I drink a thousand shipwrecks.'"

abstauber

I've only implemented a very basic AI to my platform engine, something like:

if guy is in view, shoot - if edge is in front of feet, turn around.


So I won't be any help, but this site has some good hints and algorithms:

http://roguebasin.roguelikedevelopment.org/index.php?title=Articles#AI


adm244


Gord10

My AGS Fight Game includes a simple example of AI, you might want to check it out.

I believe that anything that you can do with C++ and standart i/o library for AI can be done in AGS, as well.

We could be much more helpful if you had given us an example state of your game, but I assume that you want the characters to make decisions according to the variables. It isn't so hard, you can set 'behaviours' like angriness, and what changes the behaviours are the conditions in repeatedly_execute (or anything like it). You can even formulate each emotions of the character; using game variables in a mathematical expression.

Games are art!
My horror game, Self

tzachs

I have some AI in my soccer game I'm working own, you can get the tech demo here.

Basically, my advice is charting decision trees on paper before you even start to code. In a soccer game, for example, you can do something like:

                                      Do I have the ball?

     Yes: Should I pass, dribble or shoot?                             No: Am I on defence or offense?

Pass: To whom?  Dribble: Right/Left/Up/Down? Shoot: high/low/left/right                           etc etc

Then, for each branch, you can give some more details. For instance, if I'm closer to opponent goal I'm more likely to shoot. Choose your priorities for the decisions based on the variables, if I'm close to goal I'll set as priorities: First shoot, if not dribble, if not pass. Then set probabilities: shooting- 40%, Dribbling- 35%, Passing- 25% (just an example), and then use random to decide.

I hope I'm making any sense here...




Technocrat

Since I'm building a turn based strategy, AI is kind of necessary - otherwise, there'd be a whole army sitting around like lemons. Mine runs through its turns in stages. After each line, if the answer is no, move on to the next line (except for the first ones, since they invalidate all other considerations)

Movement:
- do I have movement points/fuel? No? Then shut up and sit down.
- am I blocked in with nowhere to go? Yes? Stupid traffic jams.
- am I next to an enemy who I'm mortally afraid of? Yes? RUN LIKE HELL
- am I next to an enemy who outnumbers me drastically? ALSO RUN LIKE HELL
- is there an enemy nearby who's in desperate need of some blowing up? Yes? Get yer ass over there, then!
- is there a city that needs looting liberating nearby?
- does a city need defending from that evil human?
- none of the above? Well nuts to you, I'll just move towards the enemy HQ.

Attack:
- do I have ammo? No? Well go away then, this is a war.
- am I artillery, and is anyone in my bombardment range? Yes? HA HA HA THAT'LL TEACH YOU
- am I an IFV, and does anyone need resupplying? HELLO THERE HAVE SOME DELICIOUS PETROL
- am I next to someone I have an advantage over?
- am I next to someone I outnumber? CRUSH THEM ALL
- who do I have the terrain advantage over? FIND HIGHER GROUND

Production:
- what can I afford to have a spending spree on?
- have I run out of units to build?
- do I have at least three infantry units on the ground? No? Well GET OUT THERE YOU LAZY GITS
- is my unit cap full, or have I run out of reinforcements while money remains? Blow the spare cash on a nuke, then!

SMF spam blocked by CleanTalk