Welcome to the EasyGo home page



Home
Rules
Download
Organization of code
Coding your own player
Resources
Author

Getting started

Coding one's own player is pretty straightforward : You have to make your own class - say MyPlayer.java, and this class should implement the interface Player. See the source of RandomPlayer and NaivePlayer class for more details.

You will see that the function getMove(Board b) in your player. All the information about the current status of the game will be stored in the instance of the Board class passed to this function. You can use the generatePossibleMoves() of Board class to get all the possible valid moves.

Programming intelligent players

At first sight, programming intelligent players in the game may seem to be a difficult task. However, once you are thoroughly familier with the source code, it won't be that difficult. Here are a few tips to program your intelligent player
  • Using simple heuristic functions: Have a look at the NaivePlayer class. It used a simple heuristic function to choose the next move. You can try tweaking with the parameters used in the heruristic function. A few points are easy to observe :
    1. Making a move in the center of the board is better than making a move near the edges or the corner.
    2. If an opponent makes a move near the edge/corner, it is easier to capture that piece.
    3. A move should not be made at a place where the "mobility" of the piece is reduced - i.e. the number of free adjacent positions is less for that piece.
    These are a few simple rules that can be used in the heuristic function. There can be many more parameters which can be used to make a good heuristic function.

  • Using tree search: This is the most common method used in Game parogramming, and almost all expert computer game playing programs use this technique. The most widely used method is of MinMax search. Check out the resources page for links on Game programming.

    The problem with Go (and EasyGo as well) is the high branching factor - that is, the number of possible moves at any given instance. Because of this, searching the whole tree is not possible - some pruning technique inevitably needs to be employed. I leave it for you to figure out how to achieve this - atleast you should have something to do on your part !








SourceForge.net Logo