Export game in sgf format

Forum rules
Please DO NOT POST BUGS on this forum. Please report (and vote) bugs on : https://boardgamearena.com/#!bugs
Charlie Châteauneuf
Posts: 11
Joined: 11 February 2025, 20:11

Re: Export game in sgf format

Post by Charlie Châteauneuf »

Hi folks,
In my opinion, it only makes sense to download a game record if you want to replay it in order to analyze it and learn from your own mistakes. I am aware that this does not make sense for all games. Whether it makes no sense for 99.9% of the games offered on BGA, I cannot judge. However, I do know that it makes sense for more than 20% of all games that can be saved in sgf format.
Thanks for the discussion!
C.C.
User avatar
BertSierra
Posts: 5
Joined: 01 July 2025, 12:10

Re: Export game in sgf format

Post by BertSierra »

Paddles wrote: 22 November 2025, 04:02 I don't think anyone is actively developing the game/fixing bugs. There hasn't been a bug report closed in around 3 years.
I’ve volunteered to join the “QA” team to fix bugs, but haven’t received the credentials yet to make use of BGA Studio to study & fix code issues. If and when I gain access (hopefully soon), I’ll be focusing on things that bug me the most. First off, perhaps most easily fixed, if you have one man left on, say, your 3-point and you roll 3-1, the system forces you to move 1, and then 3, to obey the rule that if you can use both dice, you must. But this bearing off situation is a bit different; it’s more natural just to take the 3 and be done. I filled out a bug report, and since this is likely the lowest hanging fruit, my #1 issue.

Less likely for me to tackle are all the myriad network/server issues forcing constant refreshing that doesn’t occur as badly in any other BGA game. Even worse, more recently, sometimes when you refresh, the server will replay your last 2-3 games start to finish with animation, taking potentially up to three to five minutes and forcing you into overtime. I have no idea why that occurs, and I doubt I could figure out why that happens by studying the code after just a few hours ,days, or weeks.

SGF is such a handy export format to use with backgammon analyzers (I use Gnu Backgammon as it’s 100% free, but slow). It’s really handy not just to spot your major or minor blunders, but also to spot those of your opponents so you can “learn their game”, what mistakes they tend to make that you might exploit when you encounter them again down the line.

I only play 5-point matches with the doubling cube, so analyzing cube blunders, including doubling opportunities missed, is very important to improving your game. I’m moderately strong, but could definitely improve. And the bugs are so rampant that a good part of my day is shot either dealing with constant refreshing delays, and now that I’m transcribing my games, taking the steps to replay each game and create an SGF transcript in Gnu Backgammon.

Don’t even get me started on the myriad major bugs I’ve seen with replay of backgammon games. So, for example, showing one player’s roll and then the opponent’s move, leaving out one move and one roll that you have to figure out despite the info missing. I’ve got five new replay bugs I need to file this week.

If I end up being the only person trying to fix the code, that’ll be sad, but so be it. I’m not going to drive myself nuts and make it a fulltime unpaid job, but as I want to develop my own premium games, it’s worth the time to help get up the learning curve by examining an existing game and patching/improving it.
User avatar
BertSierra
Posts: 5
Joined: 01 July 2025, 12:10

Re: Export game in sgf format

Post by BertSierra »

euklid314 wrote: 05 October 2025, 18:11 Start a game with the option "Export the game in *.mat format". Not possible in Arena mode I am afraid...
When you have finished the game (or even during the game) you can go into the user preferences (top right - Click SETUP in the area where you find your user name) and you can choose "MAT export".
Yep. These instructions are totally correct.

A couple of intricacies:
1) Not only should you turn on “Export to MAT format” (green box on left) before setting up a table, you also need to set inflexibility as well (turn green switch on right off). For a time, I couldn’t figure out why I wasn’t seeing the MAT export option under SETUP, but apparently I was flexible about the setting while opponents were not. Being inflexible may mean it’ll take longer to find an opponent since they will need to have fiddle with the default settings, either being flexible on the “Export to MAT format” option, or enabling it.

2) The “MAT export” option top right under the SETUP tool seems to only be available immediately after a game or match when the browser window reads “End of match” (or possibly “End of game” — dunno as I never play 1-pointers; 5-points w/cube only for me!).

3) So this means of the two matches I just played, I only have access to the MAT file for the second file. Which looks okay and I might as well paste it in here if it’s not too long. The table # is in the metadata at the top of the file, and though I don’t have any backgammon software that can handle MAT files, I’ll see if ChatGPT 5 will convert it to SGF that GnuBG can handle.

MY THOUGHTS ON THIS:

1) Although the MAT files are small, it would add load if this export (or SGF export for that matter) was occurring behind the scenes on every game. Good point there. But then, since the replay mechanism can extract all of the rolls and moves (sometimes in a highly buggy manner, as I mentioned elsewhere and in bug reports to follow), it strikes me that if only 1% or less of users need MAT file (or SGF file) exports, this is certainly an option that could be made available on every game, and built as needed from the SQL logs by any user.

2) Is there a privacy issue to consider here? Is there a reason why a player would NOT want a game to be exported to MAT/SGF format? The one thing I can think of is that a game in progress should likely not have any export capability, as then a player might cheat, taking their three minutes per turn to download the game info, feed it to an analyzer, and come up with their move either realtime or turn-based if the software could analyze a position within a minutes or so (most good AI can’t do that!).

3) So perhaps since ALL games can be replayed visually, and hand-transcribed to analyzers after the game for analysis as I have begun doing in recent matches, a reasonably policy would be to disallow MAT (or SGF) export during the game, and only completed games can be downloaded and analyzed.

4) One possible exception to the policy is if players enter into a turn-based or realtime game with the “infinite” time setting (a “just for fun” game with no impact on ELO). My son and I have been doing that to play turn-based games played in two sessions per week, and it works quite well. I’m teaching him the proper moves to beat me, so it’s best that ELO is disabled for that type of teaching experience.

What say you all? Once I get my credentials to tinker with backgammon and start knocking off bug tickets over time, this might be a revamp to consider. Again: My emphasis will be to initially focus on fixing things that affect me, for the most part. And then I’ll get to the lower hanging fruit as time permits. First step is to be granted access, and I hope I’m not ruffling any feathers by openly posting my thoughts “out of school” as I haven’t been let in the school doors quite yet.

Food for thought. The MAT export capability should be super clear and easy to use, and it is far from that right now, taking me a full month to get my first MAT export, and then only of the second match played so I’ll have to hand-transcribe the first match by hand into Gnu Backgammon via an SGF file.

And all of this should just work. No weird issues around the time folks double. 100% compatibility with analyzers should be the goal.
User avatar
BertSierra
Posts: 5
Joined: 01 July 2025, 12:10

Re: Export game in sgf format

Post by BertSierra »

I forgot to include the MAT export I obtained. Let me know if anyone has any issues with transferring this into third-party backgammon software, or converting it into working SGF files. As I mentioned, I have no software that can handle MAT files, so I’ll be interested to see if there are any problems, and if there are, you can always reference this forum entry and base a bug report on it that I’ll eventually look at.

_____________BEGIN MAT FILE________________
; [Site "boardgamearena.com"]
; [Match table "773378521"]
; [EventDate "2025.12.12"]
; [Player 1 "C o L o C"]
; [Player 2 "BertSierra"]

5 point match

Game 1
C o L o C : 0 BertSierra : 0
1) 41: 13/9 24/23
2) 63: 24/18 18/15 64: 13/9 13/7
3) 32: 15/13 24/21 42: 8/4 6/4
4) 52: 25/20 20/18 33: 25/22 13/10 10/7 13/10
5) 42: 25/23 6/2 66:
6) 52: 23/18 13/11 64: 25/21
7) 43: 6/2 18/15 11: 25/24 25/24 22/21 6/5
8) 43: 15/11 13/10 54: 24/20 20/15
9) 31: 25/24 13/10 53: 25/20 8/5
10) 21: 13/11 11/10 53: 8/3 6/3
11) 43: 13/10 10/6 33: 21/18 21/18 9/6 9/6
12) 41: 13/9 9/8 11: 3/2 2/1 3/2 2/1
13) 32: 25/23 8/5 43: 25/21 24/21
14) 44: 5/1 10/6 6/2 10/6 66:
15) 21: 2/1 8/6 54: 25/20 20/16
16) 11: 6/5 6/5 6/5 23/22 52: 16/11 6/4
17) 55: 8/3 8/3 22/17 17/12 61: 11/5 4/3
18) 64: 12/6 6/2 52: 6/1 5/3
19) 61: 11/5 2/1 33: 18/15 15/12 18/15 15/12
20) Doubles => 2 Drops
Wins 1 point

Game 2
C o L o C : 0 BertSierra : 0
1) 42: 8/4 6/4
2) 32: 13/11 13/10 64: 24/18 18/14
3) 51: 25/20 10/9 43: 14/10 13/10
4) 53: 8/3 6/3 32: 13/10 10/8
5) 54: 24/20 13/8 54: 24/20 20/15
6) 31: 13/10 10/9 31: 25/24 13/10
7) 52: 13/8 24/22 41: 8/4 24/23
8) 43: 9/5 8/5 22: 23/21 6/4 4/2 4/2
9) 31: 6/3 9/8 62: 21/15 15/13
10) 21: 6/4 8/7 41: 13/9 9/8
11) 42: 8/4 8/6 41: 8/4 2/1
12) 54: 7/2 6/2 66: 8/2 13/7 7/1 8/2
13) 31: 8/5 3/2 54: 13/8 8/4
14) 53: 20/17 17/12 Doubles => 2
15) Takes 31: 6/3 4/3
16) 64: 43: 10/6 6/3
17) 32: 31: 10/7 7/6
18) 52: 25/20 12/10 66: 10/4 6/0 6/0 6/0
19) 64: 20/14 20/16 51: 4/0 1/0
20) 54: 16/12 14/9 52: 4/0 2/0
21) 53: 10/5 9/6 65: 4/0 4/0
22) 32: 12/9 3/1 63: 3/0 3/0
23) 33:
Wins 2 point

Game 3
C o L o C : 0 BertSierra : 0
1) 31: 8/5 6/5
2) 52: 13/11 13/8 42: 8/4 6/4
3) 31: 8/5 6/5 21: 8/6 6/5
4) 21: 13/11 6/5 51: 13/8 5/4
5) 41: 11/7 8/7 43: 13/9 8/5
6) 64: 13/7 13/9 44: 13/9 9/5 13/9 13/9
7) 63: 9/3 6/3 62: 9/3 5/3
8) 52: 11/6 5/3 62: 9/3 5/3
9) Doubles => 2 Drops
Wins 1 point

Game 4
C o L o C : 0 BertSierra : 0
1) 63: 24/18 18/15
2) 62: 24/18 24/22 55: 13/8 8/3 13/8 8/3
3) 61: 25/24 24/18 54: 24/20 20/15
4) 31: 8/5 6/5 Doubles => 2
5) Takes 65: 13/8 8/2
6) 52: 13/8 6/4 32: 6/3 3/1
7) 65: 13/7 8/3 32: 6/3 3/1
8) 33: 7/4 6/3 8/5 5/2 41: 6/2 6/5
9) 52: 13/8 8/6 62: 8/2 5/3
10) 42: 6/2 8/6 61: 8/2 2/1
11) Doubles => 4 Takes
12) 62: 13/7 13/11 21: 15/14 8/6
13) 62: 63: 15/9 9/6
14) 32: 53: 14/9 9/6
15) 21: 32: 6/3 3/1
16) 54: 25/21 6/1 62: 13/11 11/5
17) 52: 6/1 6/4 62: 13/11 11/5
18) 63: 18/12 18/15 22: 6/4 6/4 6/4 4/2
19) 53: 63: 5/0 5/2
20) 41: 42: 4/0 4/2
21) 21: 51: 3/0 1/0
22) 64:
Wins 8 point and the match
_____________END MAT FILE______________
User avatar
Paddles
Posts: 81
Joined: 25 March 2012, 12:04

Re: Export game in sgf format

Post by Paddles »

BertSierra wrote: 12 December 2025, 01:32 As I mentioned, I have no software that can handle MAT files,
GNU Backgammon opens MAT files, at least on Windows but I would have assumed on any other platform as well.

I normally save the file from BGA as a text file (so that I can correct the round 2-n match scores):
Image
User avatar
movingtheriver
Posts: 13
Joined: 28 January 2023, 16:45

Re: Export game in sgf format

Post by movingtheriver »

Cheating should not be a reason for disallowing export to .mat. In every analysis tool I use, you can easily, quickly recreate any position for analysis with just a few clicks. You don't need a .mat file to cheat.
Post Reply

Return to “Backgammon”