OpenTafl: old terminal graphics meet Old Norse board games

OpenTafl is an open-source engine for board games in the hnefatafl family, supporting local human-on-human play, a built-in artificial intelligence, external AI engines, and (very soon) network play. You can get the stable release or the bleeding-edge release at the OpenTafl website, and you can find the source code at Bitbucket. If you run into any issues, please report them there.

The hnefatafl board games are asymmetric abstract strategy games. The defending player, who starts in the center of the board, must get his king to a board edge space or a corner space, while the attackers, who start around the outside, must stop him. There’s a thread here about the game, and a thread about the AI competition I’m running, too.

Oooh I guess Ags1 would want to see that hahah!

Do you have Ard Ri implemented? :slight_smile:

Afraid not—I haven’t had time to put in support for tafl variants which limit the range of taflmen yet. Perhaps over the summer.

The good news is that I have released v0.3.0.0b, which has network support. If you’re interested in tafl, find a buddy and go play a game!

OpenTafl v0.3.1.0b has released, which adds spectator mode to online games and bumps the network protocol version. (The server running at my website has updated, so old v0.3.0.0b clients will have to update to the new version to play online.)

Coming soon is v0.3.2.0b, which will have support for headless AI network clients. Headless AI clients can be set to join one game against a specific player, or to create permanent games on the server, playing against any opponents who care to try. To help AI authors diagnose issues with their AIs, headless clients automatically save a record of every game they play. A long-running headless client hosting games should, over time, build up a library of useful and instructive games. (Theoretically, anyway. Not a lot of average players on the server so far.) The headless client supports any engine using the OpenTafl engine protocol; no special work is needed.

Remaining on the hit list for this version:

  • Build out test coverage for network play
  • Update documentation, provide command-line documentation for headless mode
  • Hands-on testing pass, along with a longer test cycle on the server with headless clients
  • Finish implementing a chatty-normal-silent spectrum for debug prints
  • Built-in update checking/downloading

Once v0.3.2.0b comes out, all the groundwork will be in place for the AI tournament in December, and I can move back to additional OpenTafl AI development work. v0.3.2.xb (or v0.3.3.xb, if I punt on auto-updates for a bit) will be released as the stable version in the next month or so.

v0.3.2.0b is released! This is the stable release for v0.3.x, and OpenTafl is unlikely to change much in its underlying mechanics between now and the tournament in December, so if you’re interested in a good version to code against, this would be that one.

[quote]code against, this would be that one.
[/quote]
Let me just manipulate the connection between me and you and destroy your server.
Haha :slight_smile:

Good work on everything you did. Creating a server can be lengthy work. I just yesterday made a Proxy Server, that is kindof crappy because my lack of how HTTP proxies underlyings work (learning to build one without resources), but it does transfer stuff. I also, like day or two before that, made an HTTP Server which is fully functional. It doesn’t parse the request header at all though :slight_smile: It just sends a 200.

Servers are fun. I suggest making a library.
And to never, ever use anything but the InputStream.

Hydroque, crashing the OpenTafl server is probably as simple as sending random bytes for an hour or two. :stuck_out_tongue:

Coming soon is v0.3.2.1b, which will have some OpenTafl AI performance improvements, along with a benchmark mode. (Turns out my new work laptop, with a Skylake i7, is about as peppy as my desktop’s Sandy Bridge i5 at 4 GHz, at least as far as mono-core performance is concerned.) It’s a little faster now than it was before v0.3.2.0b; v0.3.2.0b caused some serious performance issues as a result of a bugfix for server mode. Now that I have a good profiling setup, I expect some further improvements in the medium term.

The pace of releases will probably slacken somewhat over the summer—I don’t have nearly as much planned, now that network mode is finished. Possibly support for online tournaments, and support in the headless AI client therefore, but that’s a luxury feature, not a requirement. The fall will probably see some OpenTafl AI improvements, in the hope that I might be a slightly better competitor in the pool stage of the tournament.

v0.3.2.1b is out, at the usual place. Also has 19x19 tafl, and a functional terminal-only mode.

Is this pronounced “taff - ull”?

I pronounce it more like taa-ful.

v0.3.2.1b had some embarrassing JAR build bugs, so v0.3.2.2b is out now to correct those. (Oops.)

I’ve always said ‘taa-ful’, like ags1. I don’t know how Old Norse went, but I’ve heard some people suggest the original pronunciation was more like ‘taa-vul’. Personally, I’m fine with the unvoiced labiodental fricative.

v0.3.2.3b has been out for a day or two now. In the next few days, I expect to have v0.3.3.0b released, which will implement loading of saved games over the network, as well as provide additional configuration options for more competitive games, allowing hosts to turn off replay mode and spectator chat.

Following that, v0.4.x is on the horizon, to include two main features: playable variations, which will be built into saved games and will enable features like tafl puzzles, and OpenTafl AI improvements.

Steady progress! How is your AI coming on?

Nothing to report since a few versions ago—the networking stuff and UI improvements have really eaten up my time.

I have a lot of fun AI stuff planned for 0.4.x: improvements to the evaluation function should net me some better play, and I have a few heuristics left to add which should improve my alpha-beta performance. I’ll write about those more when I’m closer.

OK, now you’ve got me worried. That all sounds very formidable.

For all that it sounds impressive, it still can’t even come close to beating me, unless I really misplay badly, and I’m not all that great a tafl player.

v0.3.3.0b is now released. This one wraps up network play functionality, including playing saved games over the network and some configuration options for hosts to disallow spectators to talk to players and to disable analysis and replays for the players.

v0.4.x is moving from ‘on the horizon’ to ‘coming soon’.

There will be at least one more release in the v0.3.x series before I move on, to correct two issues:

  1. On large boards (15x15 and 19x19 especially), having the rank and file labels on the top and left alone makes for very difficult reading in the bottom right corner. To fix this, I’m now rendering the rank/file labels on all sides of the board, and the ‘info’ command now shows the coordinates for all moves a piece can make.
  2. When loading a saved game over the network, the time-remaining information from any previous game loads is lost when the game is re-saved. I’ll have to change the network protocol version again, but it should be a fairly easy fix. (I just have to send the info along with the move list.)

In other news, I made what may turn out to be an AI improvement, but I haven’t had OpenTafl play enough games against itself to know for sure yet. While I’m off at church this morning, I’m going to have it run 100 or so and see what happens.

My AI has soaked up more time than I expected. It’s playing ok, but I don’t think it’s anywhere near human level yet. At least it’s at the point where all I have left to do is the fine tuning, so it’ll definitely be playing in December :slight_smile: