AI Introduction

I'm completly Lost!

Page 1 of 1

4 Replies - 2810 Views - Last Post: 27 January 2006 - 10:01 PM Rate Topic: -----

#1 dman8568  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 03-January 06

AI Introduction

Posted 21 January 2006 - 03:47 PM

Hi, I've made a few games where it is Human vs. Human.

What I would like to do is develop some AI for a simple game, Lets say Tic-Tac-Toe.

The problem is I haven't a clue where to start.

Could anyone be kind enough, and toss me a light on how AI is accomplished?


Many Thanks,
Dman8568

This post has been edited by dman8568: 21 January 2006 - 03:50 PM

Is This A Good Question/Topic? 0
  • +

Replies To: AI Introduction

#2 Videege  Icon User is offline

  • rÍvant.toujours
  • member icon

Reputation: 6
  • View blog
  • Posts: 1,413
  • Joined: 25-March 03

Re: AI Introduction

Posted 21 January 2006 - 04:27 PM

well, for board games, a minimax tree is usually the way to go (w/ tic tac toe, you can design an algorithm that always guarantees a win/tie for the comp).

Check it out Here.

If you don't want the computer to be that smart (i.e. dif. levels of difficulty), an easy way (at least for T.T.T) is to generate a probability variable (random number from 0-100) and use it to randomize the chance that the computer either makes the best move possible (from the minimax tree) or just some random move.

i.e

//assuming you've alrighty got a random number in int prob;
//also this is c++ and aiDifficulty is just an enumeration

if (aiDifficulty == AI_HARD)
{
         if (prob > 20) //80% chance of making best move on hard mode
         {
              doBestMove(); //or whatever
               return;
          }
}
else if (aiDifficulty == AI_NORM)
{
      if (prob > 50) //50% chance of making best move on normal mode
     {
           doBestMove();
           return;
      }
}
doRandomMove(); //if we didn't get to do bestMove();
return;



hope this helps a bit, feel free to ask questions
Was This Post Helpful? 0
  • +
  • -

#3 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Re: AI Introduction

Post icon  Posted 21 January 2006 - 07:28 PM

If you ever need some AI lessons for action games, ask me.
I'll be glad to help.
Was This Post Helpful? 0
  • +
  • -

#4 dec1pher  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 27-January 06

Re: AI Introduction

Posted 27 January 2006 - 03:28 PM

you can also try http://gamedev.net 's ai section. There's so much good tutorials about ai programming. And as a semi-pro game developer i must say that ai is not a one-person job. you must work on it with a group of people and these people must know mathematics well and they must be capable to create fast and short algorithms...
Was This Post Helpful? 0
  • +
  • -

#5 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

Re: AI Introduction

Post icon  Posted 27 January 2006 - 10:01 PM

dec1pher, on 27 Jan, 2006 - 04:25 PM, said:

you can also try http://gamedev.net 's ai section. There's so much good tutorials about ai programming. And as a semi-pro game developer i must say that ai is not a one-person job. you must work on it with a group of people and these people must know mathematics well and they must be capable to create fast and short algorithms...

Or you could have one inhuman psychotic programmer to do the AI job.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1