Python Forum
Thread Rating:
  • 5 Vote(s) - 2.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
t_games, Take Two
#8
(Jan-12-2019, 10:16 PM)Trinx Wrote: How did you create an AI player?

I created lots of AI players. There's a base Player class, and there is a whole hierarchy of sub-classes to it. One is the Human class which is used for the user. Another sub-class of Player is the Bot class. All of the AI players are sub-classes of the Bot class, and there are usually more than one per game. Most of the bots are heuristic, just using per-programmed rules to determine their behavior. The Connect Four bots do a full tree search, with alpha-beta pruning (there is a parent class AlphaBetaBot, so other bots can make use of the algorithm). They're kind of slow, mainly due to the board copy method. I want to look into speeding that up. The bot for Backgammon was done using genetic engineering, although I think it needs a bit more engineering and maybe another genome, but I didn't have time for that.

Since Bot and Human are both sub-classes of the same class, and use the same methods, you don't need a human. Each game has a tournament method for running contests between different bot programs. On the flip side, there is a Cyborg class, with some features of both the Bot and Humanoid class. The Cyborg can be used to play both sides of a game while you are programming it, to make sure the game works before you write AI players for it.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
t_games, Take Two - by ichabod801 - Jan-08-2019, 09:29 PM
RE: t_games, Take Two - by metulburr - Jan-09-2019, 12:42 AM
RE: t_games, Take Two - by ichabod801 - Jan-09-2019, 02:08 AM
RE: t_games, Take Two - by ichabod801 - Jan-09-2019, 02:14 AM
RE: t_games, Take Two - by Trinx - Jan-12-2019, 04:39 PM
RE: t_games, Take Two - by ichabod801 - Jan-12-2019, 05:56 PM
RE: t_games, Take Two - by Trinx - Jan-12-2019, 10:16 PM
RE: t_games, Take Two - by ichabod801 - Jan-12-2019, 11:02 PM
RE: t_games, Take Two - by Trinx - Jan-13-2019, 08:09 PM
RE: t_games, Take Two - by ichabod801 - Jan-13-2019, 09:18 PM
RE: t_games, Take Two - by Trinx - Jan-15-2019, 02:03 AM
RE: t_games, Take Two - by ichabod801 - Jan-16-2019, 03:46 AM
RE: t_games, Take Two - by Trinx - Jan-16-2019, 05:40 PM
RE: t_games, Take Two - by ichabod801 - Jan-16-2019, 05:56 PM
RE: t_games, Take Two - by ichabod801 - Jan-16-2019, 06:01 PM
RE: t_games, Take Two - by metulburr - Jan-16-2019, 06:13 PM
RE: t_games, Take Two - by Trinx - Jan-16-2019, 06:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star New t_games Release ichabod801 0 2,239 Mar-19-2019, 08:27 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020