4 Replies - 2020 Views - Last Post: 18 February 2013 - 02:46 AM Rate Topic: -----

#1 sillygod  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 23-January 13

[problem] how to write python game AI

Posted 03 February 2013 - 05:44 AM

Recently, I plan to use python and pygame to write a renju game with AI. However, I have no idea to write AI. Could anyone give me some advice. Something like, tutorial site or some source codes,etc.
Is This A Good Question/Topic? 0
  • +

Replies To: [problem] how to write python game AI

#2 Nekroze  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 170
  • Joined: 08-May 11

Re: [problem] how to write python game AI

Posted 03 February 2013 - 07:20 AM

Just doing a quick look around for ya i found these, the first is python specific and the second may actually teach you more.

http://inventwithpyt...or-zombie-dice/

http://active.tutspl...1-path-finding/

Hope they help mate!
Was This Post Helpful? 0
  • +
  • -

#3 sillygod  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 23-January 13

Re: [problem] how to write python game AI

Posted 03 February 2013 - 07:22 PM

View PostNekroze, on 03 February 2013 - 07:20 AM, said:

Just doing a quick look around for ya i found these, the first is python specific and the second may actually teach you more.

http://inventwithpyt...or-zombie-dice/

http://active.tutspl...1-path-finding/

Hope they help mate!


Hello, Nekroze

Thank you for your reply.

After I skim them, I think they're good resource about the whole AI. However, I want to just focus on the AI of renju game.

Is there a resource about that? Or I should learn AI and then create a algorithm by myself :)

Regards,
sillygod
Was This Post Helpful? 0
  • +
  • -

#4 Nekroze  Icon User is offline

  • D.I.C Head

Reputation: 14
  • View blog
  • Posts: 170
  • Joined: 08-May 11

Re: [problem] how to write python game AI

Posted 03 February 2013 - 07:25 PM

Learning general pathfinding AI can help with a lot of things and also gets you in the right mind set then I would probably generate my own algorithm.

Once you make your own algorithm try and make another one that is better and pit them against each other to test them.
Was This Post Helpful? 0
  • +
  • -

#5 lisperati  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 16-February 13

Re: [problem] how to write python game AI

Posted 18 February 2013 - 02:46 AM

Hey sillgod,

AI is not mystical or hard, in my introductory class to AI i show the students a basic tic-tac-toe program where they play the computer. It has 3 decision making components as to the best move then if there isnt a best move it just takes a random move, ie any square at random. This gives the appearance of hard AI and every game is different.

AI is just basically what is the best move to make based on the current board, just like you would make a decision the same way but in code instead.

I find to make some really good AI code i just sit down and write the steps down on a piece of paper from the winning move backwards until i cant figure out any more good moves then I just insert a random move for all situations that are not covered. It usually works out really well and makes the game play differently every time. Also makes people feel they are playing with a relatively intelligent machine.

Regards
Lisperati
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1