Welcome to
BG Replay

BG Replay is a system for publishing backgammon games and lessons on the web. It reads .gam and GNU text-export files, and plays them in an animated display. It also has its own scripting language for creating free-format tutorials. The system works with any page layout and board design.

See BG Replay in Action

bPod design - this year's
must-have virtual gadget!

Desktop design (larger graphics).

Self-drive design -
paste your .gam or GNU file
in and see it play!

NEW - Paul's Backgammon Vaults
400+ matches on the web with BG Replay

BG Replay is now available for download

Click here to download BG Replay V1.2.2 (.zip file, 580K) - now with .mat file support.
Existing users - download this version for latest features. See the changelog for details of updates from previous versions.
If the download doesn't start, try right-clicking on the link and choosing 'Save Target As'.

When the file has downloaded, unzip it to an empty folder and open readme.htm.
This is an early-release version with notes on how to run your own game files and develop your own pages, plus templates and sample scripts to get you started.
A full development kit with authoring page and full scripting language reference will be available later this year.


What is BG Replay?
It's a fancy name I've thought up for a set of program functions that can read saved backgammon files and play them back in an animated web page, complete with commentary text and move/cube analyses. Instead of having to show a separate screenshot for each position, the page shows a single backgammon board with the pieces moving over it.

Who is it aimed at?
People who run websites, and want to publish backgammon games and tutorials on their web pages.

Are the web pages interactive?
Yes. The user can play each move individually, skip between plays, jump directly to plays and use autoplay mode to run a game automatically.

What do my site visitors need in order to view these pages?
Internet Explorer, Mozilla Firefox or Opera, or any other browser that supports the full Document Object Model. The system is written in JavaScript, so doesn't require any browser plug-ins or downloads.

What do I need to run these pages from my web host?
Just some web space. Free space provided by ISPs is fine, although if your server supports the PHP programming language (most paid-for servers do, including Windows ones) you can use the PHP versions of the pages, which make organising your site much easier (see below for more details).

So does it mean that I don't need to author each game's web page individually?
Exactly. Create your standard game page once, then feed as many different games as you like through it.

Can I use the program code with my own graphics and web page design?
Absolutely. The system is designed to be 'skinnable', so you can use your own board and piece graphics (any size), and your own page design and styles. The bPod and Desktop designs shown above are just two examples of what can be done. I'd be happy to quote for custom page design work, although it would cost, as I do this for a living.

What types of backgammon files can it read?
Currently single-game .gam (Jellyfish), multi-game .mat (match files) and BGU Backgammon's text export formats (see the self-drive version for more details).  Other formats on request, although I don't fancy tackling GNU's .sgf format much. The system also has its own script file format (see below), and can read and generate its own dialect of XML.

Does it handle matches?
Yes. You can create .bgm files (essentially lists of game files). The PHP versions of the pages treat the game files listed in the .bgm as a match, automatically generating a menu page and letting the user step between games by pressing the << and >> buttons (see the 'Tom vs Jerry' match in the sample pages).
Version 1.0.2 and later of the PHP pages also suport Jellyfish .mat files - just feed them in and the page creates the menu page automatically.

Do I need to edit the game files to make them playable in BG Replay?
No. The system will play them back exactly as saved by the backgammon program. GNU files must be saved (or renamed) with a .bgt name extension (e.g. "Game1.bgt"), but they're exactly the same as .txt ones (the .bgt files in the Tom vs Jerry match are unmodified GNU exports). The system automatically picks up player names and match scores from GNU export files.

I like the traditional, picture-per-move page design. And what about printing?
It does the traditional layout too, from the same game files (see image, right). These pages adjust their colours automatically for printing. Press the 'printer version' button in the desktop page (or click here) to see an example.

How do I get commentary text and move/cube analyses in my game files?
Create them in GNU, and they're imported automatically from GNU text export files (TIP - GNU will export an entire match as a set of individual game files, just right for this purpose). Candidate moves in analysis tables are converted into demonstration links (try one in the sample pages). Commentary text is displayed as comments. An authoring version of the BG Replay desktop page will be available soon (I've just got to make it look presentable), which will allow you to add comments and other items to an imported script.

How did you do that Rules of Backgammon tutorial?
The script was written in BG Replay's own scripting language. This lets you set up positions (using GNU ID strings) then control the dice, cube, pieces and other display items directly. You can mix 'regular' game plays and tutorial sequences in a single script. All game files are converted to internal script format before running; try putting a .gam or GNU file through the self-drive version (above) and you can see the generated script at the bottom of the page.

Why isn't the script language based on XML?
Mainly because it's tricky to include HTML code in XML files, and you need to do that in order to format the text in comments. The system does support an XML dialect though (see the Self-Drive page for an example), so you can write scripts in XML if you want to.

Why do your sample pages use PHP?
The PHP pages used on this site save effort by allowing a single copy of each page to read any game script. PHP pages also handle .bgm match files automatically. If your web server doesn't support the PHP server-side programming language, you can embed your game files in 'static' versions of the pages instead. These pages can be run from any web server (e.g. AOL members' webspace) or directly from your PC's hard disk, CD-ROM etc. Click here for an example (opens in a separate window).

Is BG Replay free?
For non-commercial use, yes. BG Replay and the bPod and desktop page designs are copyright software, but are free for use on non-commercial websites. If you want to use it on a commercial website, or distribute it with a commercial package, please contact me at . (Don't worry, I'm not looking to make a fortune, just to get a few quid back for the time I've spent on it!).

How do I get it?
From the link at the top of this page!

Backgammon is a tightly-knit world and I've never heard of you. Who are you?
My name's Paul Stephens and I'm not a very good backgammon player. I am, however, keen to learn, which is why I was trawling the web for backgammon tutorials (it's OK, I've bought a second-hand copy of Paul Magriel's book now), and discovering that none of them were animated. I decided to spend just a couple of hours seeing how hard it would be to animate a board in JavaScript, and it took off from there.

Was it really worth all that effort to design an animated backgammon page?
Of course not, but it was fun to do (I like programming) and I do think it adds something to the way backgammon can be presented on the web. My last fun JavaScript project was a jokey simulation of a satellite TV bingo channel, so I'm definitely heading upmarket with this one.

Who are the mysterious 'players from the top 200 on FIBS' in your sample game?
Unfortunately I can't remember! I downloaded the .gam script from a website and thought it was such a good example that I wrote the sample commentary round it. I forgot to bookmark the site though, and since then I've searched the web and can't find where I go it from! If it's yours, please contact me (see below) and I'll credit you, or remove it if you object to it being here.

...and now a question from me:
What do you think?

I'd be really grateful for any feedback on the system. Do you think it's a good idea (i.e. does it make the games and tutorials more interesting or accessible?). What do you think of the user interface? How well does it perform on your system (I know the graphics are very slow in Opera, but perhaps they'll improve the graphics engine!). Please send your comments (including "you must be mad to have spent all that time writing an animated backgammon board") to .