Star Chess: The Next Generation

At long last I’ve finished updating Star Chess to Java and JavaFX. This little space empire builder was the founding project of the Kynosarges website. The original Fortran 90 version (yes, really) was the first page I published back in 1999. The first total rewrite in plain C for Windows followed in 2001. Then the project languished while I moved on to other things.

The arrival of JavaFX was the perfect opportunity to give Star Chess another facelift. The first screenshot shows how the game looks now, with its new JavaFX interface and lots of custom assets – NASA photographs and embedded fonts for text and icons. The second screenshot shows how the game looked in 2001. Admittedly, the binary package is now also about ten times the size…

Star Chess 2014

Star Chess 2014

Star Chess 2001

Star Chess 2001

Porting the core algorithms was straightforward, but I had to completely restructure the user interface. The C version was written directly on the Win32 API, with no GUI framework of any sort, so I merrily mixed interface and engine code all over the place. There was no thread affinity, so my Windows message handlers just decided ad hoc which thread might have called them. And of course there were no classes or objects in plain C, either. In retrospect it’s quite amazing the program ever worked at all!

This time the interface is completely isolated from the game engine, ensured by a separation into two different NetBeans projects. The “core” project housing the engine and computer player algorithms conforms to the new Compact1 profile in Java 8, so it should work on the most minimal Java platforms. This project does include an equally minimal UI, namely a console runner I use for testing. The next screenshot shows off its beautiful ASCII art…

Star Chess Console

Console Runner

The original motivation for writing Star Chess was to experiment with chess-like turn prediction algorithms in an empire building game. These algorithms are essentially unchanged from the original release, except that the source code is much more readable. I updated the separately available computer player documentation (PDF) which compares the complexity of chess to empire builders, and examines strategies to reduce that complexity and extend the turn prediction horizon of computer players.

The binary and source packages are available on the Star Chess home page as usual. See the ReadMe file for more information, and let me know if anything doesn’t work as expected. Once again, Windows users should note that the Client VM which Oracle inflicts on them by default is slow and obsolete. Star Chess turn prediction gets a 50% speed boost from the Server VM, and so provides another fine sample case for my article on Java Client VM Performance.

2 thoughts on “Star Chess: The Next Generation

  1. Pingback: JavaFX links of the week, May 19 // JavaFX News, Demos and Insight // FX Experience

  2. Pingback: Java desktop links of the week, May 19 « Jonathan Giles

Leave a Reply