Wednesday, June 17, 2009

Introducing Semibreve

semibreve

I wish I could have done this much, much sooner, but unfortunately I just didn’t have time. On Monday I started a full-time internship for the summer and it’s been eating up pretty much all of the time I usually have for Tabletop. So for that I apologize. Hopefully I’ll get a few real updates soon, and if not there’s always the weekend.

But anyway, to the point: last weekend I started working on a project that I’m pretty excited about. It’s been fun, and I hope that I’ll get a chance to finish it soon, especially if there is very much interest in it. It’s a program I’ve written, a fairly simple one, that I think fans of abstract strategy games will enjoy. (This is kind of long. If you want to cut to the chase, there’s a screenshot at the bottom that sums up a lot of what I have to say.)

Semibreve

In a nutshell, it's a game annotation program. Yes, it's been done before, but I don't like any of the current programs. I wrote the program that I wanted to use, and hope that you might feel the same.

Basically, I think that annotated games are a great way to learn new things, but that they just aren't very approachable, especially for beginners. Sure, Chess experts have no problem playing famous games out on their chessboard, but try getting a beginner to do that to learn the basics of strategy -- it is unlikely that they would be interested. Perhaps if someone came along and wrote a program that could play every move out for them with full annotations for each move people would be more willing to give strategy a chance.

Perhaps?

Now, I'm not the first person to think of this, obviously. But I think I have a...better implementation than those who have come before me. Although I realize it sounds a bit like a sales pitch, I present to you the reasons why I stand behind this program:

  • The file format is completely human readable
  • Almost all abstract strategy games can be represented by it (yes, Chess and Go and Hex)
  • Annotations include text comments and markings on the board
  • Completely customizable display of the board

That first one is my main selling point. The "files" that the game uses to store these records look pretty much like, well, normal game annotations might. For example, here are the entire contents of a file that represents an annotated game of Tic-Tac-Toe:

Game: Tic-Tac-Toe

---

0: Setup

This is a sample game made to show off the syntax.

1:

drop a 2-2

The classic opening, guaranteeing black at least a tie if he's careful.

2:

drop b 2-1

An unusual response. More typical would be a corner. Let's see if black can extort it.

3:

drop a 3-3

Nope. Had he played adjacent to the white stone, he could have forced victory. Let's see how this plays out.

4:

drop b 1-1

mark 3-1 r

Forced move to block the diagonal three in a row, while simultaneously creating a threat to black.

5:

drop a 3-2

Black thinks he has clenched victory, but he missed white's top row threat!

6:

drop b 3-1

mark 1-1 g

mark 2-1 g

mark 3-1 g

White seals the deal and pulls out a win.

That's literally all there is -- no tags or ugliness or info to the program. As you can see, it looks a lot like, well, how you might write it out yourself. Each turn consists of a list of commands specifying what to do -- in this case always "drop," but other commands include "take," "move," and "pass." The drop indicates what is dropped ('a' or 'b') and where it's dropped. Moves look like "move 2-3 to 1-1" or just "move 2-3 1-1" (in the final version, coordinates like “a1” or “c5” will be supported). The syntax is very simple.

After that there is a list of marks (if you choose to include it). Here you can see that a red mark was placed in turn 4 to represent the white threat, and three green marks to represent the three in a row in turn 6. Then come the annotations -- also optional. And then the next turn.

Anyway, once you write the list of commands, you can load it up into the program and you can step through each turn, viewing a rendered image of the board, complete with all the marks drawn correctly. Simple, no?

Source Editing

The main thing that I wanted to do with this program is make it easy for everyone to use -- not only to write your own games, but to view them as well. And what's easier than downloading a file containing the code and then loading it into the program? How about copying and pasting the code in directly?

Which brings me to the source editor. Built into the program is an extremely simple editor that allows you to compose a file and then directly load it into the display program, or to copy code from a web page or text editor and load it straight in. It has a built in syntax checker that will tell you if your file is valid and allow you to load it directly from there. So you could (if you had the program) just copy the text above for the Tic-Tac-Toe game and paste it into your little source box, hit sync, and you'd be in business.

To Do

What can't it do? It does have limitations -- it cannot represent 3D games (like Pylos or Druid), games using dice, cards, dominoes, or other weird pieces, or games using stacks or piles (like Focus or Mancala), or games that use weird and unique boards (I mean really weird...Ludo weird. Xiangqi is completely fine). I don't think that any of these are major problems, though, and if there is any real desire to see support for any of these it wouldn't be a huge change to make (I'm starting small, though).

Most of what remains to be done is fairly simple. I’m updating the graphics (they will be much better in the final release), making things more configurable, and making the source files even more flexible. Look for Semibreve...some time. I have so little time now as it is that progress will be slowing down, but I certainly hope to finish at some point.

If you have any suggestions for features you would like to see or ideas to make the program better, please don’t hesitate to let me know! Contact information is at the bottom of the site, and I welcome all feedback.

screenshot  A very short, simple example of an unfinished Go game. Click for full size.