Source Code
The source code is available on github at http://github.com/mpatric/lurgeeFor build instructions refer to the FAQ. The strategy game framework and the associated code is Copyright © Michael Patricios. All the code is open source and released under a MIT License.
Release History
Strategy game source code archive 2.1
Released: 21 December 2007 Contents:- Strategy game framework
- Common AWT, Applet and Console classes
- Reversi console application and applet
- Connect-four console application and applet
- This release introduces iterative deepening searches and the killer heuristic for move ranking and associated changes to accommodate these. Details follow.
- The code is now Java 5 compliant.
- Renamed some classes to correctly reflect their function.
-
Introduced the
Positionmarker interface and changed theMoveinterface to just be a marker interface. -
Introduced the
GameContextclass as a single point for maintaining the game context, including required factories for generating game entities. -
Ranking of moves now does not need to be done explicitly by specialisations of the
AbstractBoardclass, but is handled by theMoveListclass provided by theGameContext. This also handles 'randomness' in the selection of equally-good moves, rather than relying on the move rankers to do this artificially through the addition of a small random amount. - Added some standardised tests for assessing relative performance.
- Improved the reversi evaluator.
-
Completely changed the connect-four evaluator, with associated changes to
Connect4Board. Now using a more quantitative approach to scoring the board rather than relying on some rather shaky rules. -
Added the
IterativeSearcherandKillerHeuristicMoveRankerclasses, which when used together allow for tree searches with fewer evaluations. Searches withIterativeSearchercan be ended after a specified number of evaluations rather than searching to a fixed depth. - Reversi and connect-four applet now use negascout with iterative deepening rather than negascout with a fixed depth.
- Multiple listeners can be added to the searcher classes rather than just one.
- Applets log some interesting information to the Java console.
- Code cleanup and refactoring.
- Audio does not work in Opera - this may be an Opera issue.
Strategy game source code archive 2.0
Released: 29 July 2007 Release notes:- This release is the result of a major refactor. Details follow.
- Added connect-four implementation, with console application and applet.
- Some changes to the strategy game framework to address issues shown up by the connect-four implementation and to tighten up the domain model - in particular, the board now has knowledge of the player to go, so the player is not passed around as an argument quite so much.
- Added further tests across the code base to tighten up regression tests.
-
Created two new packages:
net.lurgee.common.consoleandnet.lurgee.common.applet, which contain generic abstracted functionality (originally in the reversi console application and applet) for implementing console applications and applets using the strategy game framework. - Updated reversi applet GUI to add indicator of last piece played and to use new event-driven approach built into the common applet classes.
Strategy game source code archive 1.2
Released: 25 February 2007 Release notes:- This release includes some bugfixes, added functionality and some refinements. Details follow.
- Strategy game framework:
- Added
MoveRankerto delegate ranking of moves to. - Added
NegascoutSearcherto do negascout tree searches. - Refactored
NegamaxSearcherto allowNegascoutSearcherto extend it. - Reversi common module:
- Removed
ReversiConstsclass and createdColourandDirectionclasses. - Added
ReversiMoveRankerfor ranking moves - this was previously done directly inReversiBoard. - Fixed a fairly serious bug in
comparemethod inReversiBoard, where counts were not being reset, which was affecting evaluation of board positions. - Fixed a bug in
ReversiEvaluator, which was using the wrong count for short-cutting some evaluations. - Added an
equalsmethod toReversiBoard, needed by unit tests. - Added real mobility differential to
ReversiEvaluator. - Tweaked factors in
ReversiEvaluatorto make improve game play. - Reversi console application:
- Added option to select negamax or negascout searcher for each player.
- Updated
AlternativeEvaluatorwith same changes asReversiEvaluator. - Refactored and tidied up
Reversiclass. - Reversi applet:
- Changed search depths for levels 1 - 6 from (2, 4, 5, 6, 7, 8) to (2, 3, 4, 5, 6, 7).
- Changed searcher to negascout rather than negamax.
Strategy game source code archive 1.1
Released: 15 April 2006 Release notes:- Strategy game framework:
- Changed the way in which no-move situations are managed - there is now a
byeAllowedflag on the searcher, which indicates that if a user cannot move play reverts to the other player.
Strategy game source code archive 1.0
Released: 09 April 2006 Release notes:- Initial public release.