com.barrybecker4.game.twoplayer.go.package.html Maven / Gradle / Ivy
A Go playing application
This package implements the game of Go using the game framework.
If you have comments or questions send mail to [email protected]
Go is a game with simple rules, but can take a lifetime to
master.
Stones
are placed on the board one at a time and cannot be moved. There
are
only
4 simple rules are:
- When a group of stones is completely surrounded they are
captured. Each
capture counts as 1 point at the end.
- Every empty space completely surrounded by a group of stones
of
one
color
counts as a point.
- The board cannot look like it did at any time in the past
(rule
of ko).
- When the 2 players have passed in succession, the game is
over.
If you are not familiar with the rules of go or the following
terms,
see
Mathematical Go by Berlekamp and Wolfe (appendix B).
Terms: liberty, atari, snapback, ko, seki, string, group,
dame
eye, false eye, big
eye, dead stone, independently alive group,
territory, bent 4,
moyo, nobi, ikken tobi, nikken tobi, kogeima
I will try to adhere to Modern Chinese rules.
Here are the unique aspects of Chinese rules that differ
from
other common rulesets:
1) any suicide move is considered illegal
2) When you pass, your opponent gets a point.
(not implemented yet)
For computer go, this is useful
because
it forces
decision/completion of groups to
help
determine life and death and a proper score.
3) the game terminates when the 2 players pass
consecutively
4) score = komi (5.5) + stones on board of player +
player
territory (note: captures not counted)
The computer keeps track of hierarchies of stones. The
pecking
order is:
stones - individual spaces. They can be empty
or
occupied.
strings - tightly connected collections of
stones
(nobi connections only)
groups - connected collections of strings
(nikken
tobi, and kogeima)
armies - loosely connected collections of
groups
(still to do).
Here is a somewhat out of date dependency diagram of the classes
and subpackages:
Things still to do
Estimated days to implement are in ()'s after each item. I
have about 8 hours a weekend. This lists only grows. As I complete
one
task, I typically
add 2 more.
If the list grows no more, it will take me a year until I'm
finished at my current rate.
In reality, I'll probably never finish. That's ok, I'm not
sure I want to. I enjoy doing it.
High Priority Features
- Implement accurate scoring (allow for different types of rule
systems). Score what
it can, and allow for player dispute for score (2)
- If the computer or player resigns, the playerWon vars
should be set and the strength of the win should be large. (1)
- Add test cases for every little method of every class. Use
clover
to verify. (10)
- Parallelize minimax
(http://www.cs.vu.nl/~aske/mtdf.html#abmem)
- Parallelize UCT search (should be easier than concurrent
minimax)
- Parallelize move evaluation. (low priority)
- First 2 plys should look at global moves and do more local
evaluation for deeper levels. (1)
- Consider groups involved in capturing race (semi-eye) (1)
- Recognize seki. No points for either player. (2)
- Only pass if player cannot improve score by playing. Do not
fill
liberties. Fill dames. (1)
- Fix multi-player. Existing open source framework? get simple
case
working.
- Add resignation button.
(1)
- Remember moves that were once deemed important. (2)
- Use runner up caching (moves that were good
in the past are likely to be still good).
- Remember good moves that have
not yet been played. On a big board, they will probably remain
good
moves. These good moves should be at the head of a list when
possible
moves are being generated. (2)
- Do automatic weight optimization so it can learn
to play better (4)
- If the computer or player resigns, the playerWon vars should
be
set and the strength of the win should be large.
- Improve performance with profiling (1)
Medium Priority Features
- We could avoid a lot of subclasses if we just specify game
specific classes in the plugin xml and then create the classes
using
reflection in the base class. (1)
- Need to replace sgf (from jigo) files with standard jar.
This may require submitting changes to open source project. (2)
- Same with image processing lib from jhlabs. (2)
- Support for komi (0.5, 5.5 or 6.5).
- Add randomness to computer moves (have option
to disable since sometimes its undesirable) (1)
- Adhere to Chinese rules, add other rulesets as
options. (4)
- Consider monkey jump connections.
- Bill seems to think that I should remove setSize and reset
from
the GameBoard api and just use the constructor.
- Alpha-beta and queiscent setter/getter
methods could be properties of the SearchStrategy instead of the
game
controller.
- Use InputVerifier to validate text type ins.
- Disable << >> buttons as appropriate
- Have female voice repeat all text if sound
on.
(1)
- Run the search in a different thread so
we can quit while animating, and so we can update the game tree
while
animating. Visualize how pruning works. Animate the
game tree rendering. Use VCR like controls to control animation
(2)
- Use kiseido (or GoGui) for front end? (3)
- Try compiling to a native executable with GCJ to improve
performance on windows.
- Defaults for options should come from config/preferences
file rather than hardcode (1) (see jdk1.4 preferences)
- Handle time limits and options. Byo-yomi, etc (2)
- have it play automatically on Kiseido/IGS without intervention
(like many faces of go does) (8)
- Investigate VASSAL framework. Moyoman. Freya Game engine.
- Allow undo/redo of moves in a computer vs. computer game.
- Quick keys (kbd shortcuts).
- Determine end of game. Allow computer to resign.
Bugs
- Reporting that the wrong player has won.
- Don't play in territory at end of game.
- Back up and play black, back up again and play white.
- Profiler timing java.lang.AssertionError: The sum of the child
times(23411) cannot be greater than the parent time (23296)
- pause/continue not working in tree dialog.
- Computer should pass when appropriate. (pretty much working
now)
Packaging issues
- Upgrade to junit 4
- ant deploy could use significant cleanup.
- images on index web page should link directly to applets
(or webstart).
- auto generate images for index page.
- make this text a web page and add a link to it.
- add high level descriptions of class interactions to package
level javadoc (i.e. the architecture) (1).
- cleanup all java doc (2)
- remove all circular dependencies (use pasta from optimalJ) (1)
- put game defaults in a config file rather than having as
constants in controller classes.
- make opensource (3)
- make this a web page
- add html documentation describing architecture
(3)
- write a book about it. Targeting teens year
olds. (50)
Bugs and Verification
- After reloading an SGF file its the wrong player's
turn. (fixed?)
- At end of game, computer plays in its own eyes instead of
passing.
- Confirm can play suicidal move when if captures enemy
stones (1)
- Correct handling of snapbacks (1)
- Sound/speech not working (in applet only? missing libs?)
- When the computer plays in your eye, the eye goes away. It
should
not.