top | item 40846524

The first 10k games at bgammon.org, an open source online backgammon service

163 points| tslocum | 1 year ago |bgammon.org | reply

64 comments

order
[+] tslocum|1 year ago|reply
Hey there, author here. Glad to answer any questions.

If you don't know how to play backgammon, check out this guide[0] and/or this video[1]. There is a lot of history[2] behind backgammon. bgammon.org is AGPL-licensed, the client[3] and server[4] source code is publicly available. The graphical client is powered by the excellent Ebitengine[5] game engine.

  0. https://bgammon.org/blog/20240201-how-to-play-backgammon/
  1. https://www.youtube.com/watch?v=KDvvKWi0ijs
  2. https://bgammon.org/blog/20240115-history-of-backgammon/
  3. https://code.rocket9labs.com/tslocum/boxcars
  4. https://code.rocket9labs.com/tslocum/bgammon
  5. https://ebitengine.org
[+] honksillet|1 year ago|reply
It might be worth while looking at lichess and take some direction from their interface, which is quite nice.
[+] porphyra|1 year ago|reply
Is there a way to resign a game? I don't want to play against a bot until I get totally demolished.

Also, if I click in the text input, a huge keyboard shows up even on desktop, obscuring much of the game. Why?

[+] bonzini|1 year ago|reply
Why does "Play now using your browser" link to the play store?
[+] huimang|1 year ago|reply
Something I've thought a lot while playing backgammon locally is "I wish there was a site like lichess, but for backgammon"... so kudos for going out and starting your own! Are there any plans for post-game analysis?

There seems to be an issue with the login/signup form, as it doesn't pull up the native keyboard for my phone, but some random keyboard.

[+] fforflo|1 year ago|reply
I got a feeling that this may be a cultural aspect there too: Backgammon is not considered "sophisticated," I think. I'm from Greece (I don't play backgammon myself, though), and backgammon (tavli) is extremely popular but widely considered "a game for the masses." It is played mostly in tavernas and old-style coffee shops, and each game has a social aspect, too. People discussing (sometimes shouting and finger-pointing "no! You should have done this or that! Ah! just get up and let me play, you're a noob!"

I can't but laugh thinking who would be the GMHikaru or GothamChess of tavli :D :D

Edit: This can be misinterpreted. I don't play tavli not because is not considered sophisticated, I just find the rules confusing for certain setups.

[+] tslocum|1 year ago|reply
Thanks. Yes, I hope to support analyzing games in the future. I experimented with interfacing with gnubg to accomplish this, and hit a brick wall, as gnubg really isn't designed for computers to use it. From what I can tell, I would need to scrape the terminal output of gnubg to do this programmatically. I haven't found any open source engines that seem easier to interface with, if anyone knows of one, please share.

The internal keyboard is shown rather than the device keyboard because on many devices, using the device keyboard does not work. It either doesn't show at all, or it is shown but key input is not registered. I hope that the game engine powering bgammon.org adds support for using device keyboards soon, and will be glad to revert to using device keyboard as soon as possible.

[+] me_me_me|1 year ago|reply
https://www.playok.com/

its english version of polish kurnik.pl (henhouse)

Its as old as polish internet, very rudimentary but always active for all kind of games

[+] euph0ria|1 year ago|reply
Great game! Some feedback from a first time ever backgammon player:

- Thank you for getting me to play for my first time!

- Once a move has been utilized, then grey out that dice

- Rename the button "OK" to "Skip turn", I was wasting many turns until I figured out it skips your turn

- Make the color of your player more visible, I didn't know if I was black or white, thought I was white for the longest time

- For desktop users, do not show the popup keyboard, super difficult to chat with other players since it hides the text I'm writing

- Once I've done my two/four moves, autoclick the "ok button" so it speeds up the gameplay

[+] closedl00p|1 year ago|reply
Hi, nice snappy interface (even after making the HN front page...) and I like the gentle highlighting of possible moves for a piece.

In two games against the bot I _think_ I had the luck to run into a corner case bug with the rules engine: in the position shown in this screenshot https://ibb.co/dQ3HsM4 I'd rolled a 4-6, but the UI would not let me move my piece on 9 four spaces to hit the opponent on 5 -- the UI only wanted to let me move that piece six spaces.

I can imagine how this bug could happen-- all my pieces except this one are in my inner table, so it looks like my piece on 9 is the only piece that can legally use the rolled six, and you're required to fully use your roll if possible... except in this particular case, once I move that piece four spots, I'd be fully in my inner table and could use the six to bear off a piece.

[sidenote: I realize I don't know the best 2024 way to host a temporary image for posting on a text-only forum like HN... but imgbb looked reasonable...]

[+] tslocum|1 year ago|reply
Thanks for reporting this and including a screenshot. I appreciate it.

I've just resolved this on the server and in the web client (now v1.3.5p1, displayed at the lower right when the game loads).

[+] dumbo-octopus|1 year ago|reply
While we're on the topic of ancient link-based sharing websites, here's a pastebin of the Typescript code I wrote years ago that I just dug up to see if it'd handle this case. It does! It uses an actually-pretty-fast backtracking implementation to check for valid moves - validating Backgammon moves is a harder problem than you'd think, especially doing so quickly enough to effectively run monte tree search with. Even with all the thought I've put into it, I still don't have a quick explanation I can give a human trying to learn that game what the valid moves are, especially in the endgame and with blocked moves.

https://pastebin.com/QeSdnQpM

And the test cases I have for it: https://pastebin.com/vmMEjSMz

[+] somat|1 year ago|reply
The opening position of backgammon always worries me, not because it is bad, but because I don't understand it. And backgammon is old enough that getting to the origin and meaning behind the position is not trivial.

My best guess is that the game started out with all the pieces off the board and you had to get them all on and around and off the far side. However this takes too long and some bright Persians who understood the game far more than me who only plays an occasional game with my father started creating and playing strategic openings. Positions with interesting interactions with the dice but now the game was much shorter and exciting. And the game we all play and enjoy today was one of the more popular openings.

A good theory, hard to prove. But why on earth do you start with five tokens already in your home???

[+] tslocum|1 year ago|reply
I think the opening position evolved out of a desire for more interesting openings and resulting middle and end games. The position does seem strange at first, but it is sort of the foundation for more sensible positions, like turning 6-1 into a fortification of two pieces on the same space. Without the opening position, you would only have at most one checker on a space with this roll. I have absolutely nothing to prove any of this, it's purely speculation, as this is something I've wondered about as well.
[+] bonzini|1 year ago|reply
Backgammon had a pretty large community at Yahoo! Games. With the demise of Yahoo! Games the only place to play online was FIBS, for which you had to download a Java client... Glad that finally someone scratched their own itch and built this, I will check it out and suggest it to my father.
[+] starmftronajoll|1 year ago|reply
I’ve played for a long time at BG Galaxy, judging by online backgammon forums (and activity on BGG itself), it’s a pretty popular place to play.

https://www.backgammongalaxy.com/

Edit: Hey tslocum, rather than downvoting anyone who mentions other sites where people can play backgammon, I’d love for you to tell us more about why you believe your site is or will become superior to the existing options. There’s room for improvement in this space, but you’re definitely not there yet.

[+] lstolcman|1 year ago|reply
Check https://www.playok.com/ - it has backgammon as well as other games. The site is using html 5 and following "keep it simple" principle; it just works
[+] CamelCaseName|1 year ago|reply
I'm on mobile, clicked "Play now" where it said "Play now using your browser" and it brought me to the play store.

Downloaded the app, and tried to sign up, but everything was flashing -- I think it keeps flipping between screen sizes

[+] mieses|1 year ago|reply
bgammon.org register and login pages do not allow copy/pasting of usernames and passwords. i'd love to play but that's kind of annoying.
[+] swebob|1 year ago|reply
Agree, terrible security not being able to fill the form using a pw manager.
[+] ulf-77723|1 year ago|reply
I love the game, created a german niche website about backgammon with steady traffic since years. Always happy to see new solutions.

How do you cover the server costs, without ads?

[+] tslocum|1 year ago|reply
I've designed the server and its embedded backgammon engine to use very few resources, so it's all able to run on a dual core VPS that I am already using for my numerous other projects. Everything needed, including Postgres, currently uses less than 256 megabytes of memory and negligible CPU.

As it grows, I intend to follow in Lichess' footsteps by offering a paid supporter badge without locking any functionality behind a paywall. Because the server is lightweight, just a few paid supporters should be able to offset the costs for many free users.

[+] mandymoorefan|1 year ago|reply
My GF plays a ton of backgammon online. This isn't related to the post. Just sharing a project / software that is related in concept.

heroes.backgammonstudio.com

Whoever runs this project does a fantastic job. It feels like they really care about the game. There's some friction to signing up and rules that force you to finish games that results in a stable player base.

[+] Vepkhvi|1 year ago|reply
I'd love to receive an invite to play! I have been desperate for a decent BG server for a long while.
[+] m101|1 year ago|reply
Can you add support for tavli?

https://www.bkgm.com/variants/Tavli.html

The first game of tavli is portes which is the most common variant of backgammon played. Tavli is played by Greeks at least (and I'm sure many more)

[+] michaelti|1 year ago|reply
Perhaps of interest: an open-source implementation of Tavli in JavaScript: https://github.com/michaelti/olympus-backgammon (disclaimer: I'm a co-author). Curious if we could share some knowledge here!

Excited to read more about the Universal Backgammon Engine Interface mentioned in the post.

[+] oldmariner|1 year ago|reply
Pretty cool, thanks!

I was casting my pieces off, guaranteed a win, but my opponent left, so it didn't count as a win for me to my disappointment.

Perhaps if someone leaves and doesn't return within 60 seconds, the game should be a win for the person remaining if the remaining person's pip count is lower.

[+] anamexis|1 year ago|reply
I think whoever abandons the game should forfeit, otherwise you get weird incentives (like to quit anytime your pip count is higher)
[+] oldmariner|1 year ago|reply
Happened a second time :-( although this time my opponent still had a chance.

Both games where my opponent left, now show as wins in my history.

Also, I like the dice addition, but on desktop, the dice images are not matching up with what is rolled and displayed in the log.

How long does an opponent have until they auto forfeit if they don't move?

[+] NooneAtAll3|1 year ago|reply
When I press "Play" button in the corner, it shows loading message and then black screen...

Is this website even worth it, if I don't like short backgammon and prefer long nardi?

[+] tslocum|1 year ago|reply
If you have JavaScript, WebAssembly and/or Canvas elements disabled, the game won't be able to run in your browser. If you take a look at your browser's console, there might be a helpful error message.

Acey-deucey and tabula games are supported in addition to backgammon.

[+] _tk_|1 year ago|reply
Congrats, this looks like an amazing project!
[+] 29athrowaway|1 year ago|reply
I never understood that game. Maybe I should watch a tutorial or something.
[+] floed|1 year ago|reply
So clean. So fast. Finally an OS client for all platforms.
[+] floedel|1 year ago|reply
So clean. So fast. Finally a client fo Android without tons of BS.
[+] floedel|1 year ago|reply
So clean. So fast. Finally an OS client for all platforms.