AI (turn based game)

Started by
13 comments, last by Agemaniac 20 years ago
Yes, you are right. but im worried about balancing each equation. How can i put a score in a move and in another one if there are so many things that can change each score. Thus, perhaps, i ll give a wrong score to one of them and make the wrong choice.
Advertisement
I vote for fuzzy logic.
unkn.Enigma1625
Okay I'm not a very experenced person so you can just disregard this if you want but... I read somewhere about how Civ's (Sid Meter's) AI got made it was something like this.

1) Make a loop.
2) Run the game (AI doesn't do anything)
3) Decide AI needs to build a base first
4) Program build base code
5) Run the game (AI doesn't gather resources to build)
6) Program gather resources

And so on..

This is really the best method I know of. Your AI "learns" from it's mistakes by you "teaching" it what it's mistakes are and how to avoid the mistakes.

Say like

if(Health < GoodAmount)
UseItem(HealingStuff); //Healingstuff could be an item list

I'm not very skilled yet but I hope it helps.
-GoldMage

[edited by - GoldMage on March 19, 2004 9:58:09 PM]
For a recent AI project, I made a system where the AI chooses which moves to perform in a duel. Something similar to how I chose defensive moves could work in turnbased FF like rpg.

First create a set of binary conditions that can be applied to all actions.

Such as:
sufficent mana
enemy resistence to fire

For each condition you have a simple function that takes a binary array, each slot in the array corrisponds to an action the AI can perform. Then traverse that list and filter the remaining true values based on the condition the function represents.

so:
void sufficentMana(bool* actions){  for(int i=0;i<character->getNumberOfActions();i++)  {     if(actions[i]==true)     {      if(character->getAction(i)->getManaCost()>charcter->getMana())        actions[i]=false;     }   }}

After this filtering proccess you end up with a list of possible actions. You can then apply a weighting function to them, choose at random or simply choose the first possible action in the list.

-----------------------------------------------------
Writer, Programer, Cook, I'm a Jack of all Trades
Current Design project
Chaos Factor Design Document

[edited by - TechnoGoth on March 20, 2004 6:41:24 AM]
Yes, TechNoGoth...im doing exactly what you have said. My problem is in aplying weight in each action. There are action that i can easily put the weight using parameters like:
damage, heal, etc.
but if im using spells like:

Protection against physical attack;
Increase MANA each turn by 3 for 4 turns;
Decrease MANA each turn by 3 for 3 turns;
Remove all negative bufs from the person;
Proibe use of magic;
etc... its dificult to weight each of them

any sugestion?

This topic is closed to new replies.

Advertisement