Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:44 24 Oct 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMbg PC3 - a complete backgammon program in MMBasic

Author Message
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 723
Posted: 09:28pm 19 Oct 2026
Copy link to clipboard 
Print this post



https://youtu.be/x2N5_EjmmYE

Hello to all PC3 owners!

I'd like to introduce MMbg PC3 - a complete backgammon program for the Pico Computer 3.

Features
- match play 1 to 15 points with doubling cube and Crawford rule
- uses the neural nets of GNU Backgammon: the "big" engine plays at about gnubg "Expert" level (0-ply) and wins ~47 % of 5-point matches against gnubg "World class" (2-ply), measured over 1236 matches
- written completely in MMBasic - no CSUB needed
- HDMI graphics (MODE 3) with smooth animation, plus an ASCII board on the serial terminal
- keyboard or USB mouse, multi-level undo, auto save and resume
- .mat export and GNUbg IDs for analysis in gnubg, optional sound
- for tinkerers: gnubg on a PC as opponent over WLAN, overnight test runs

Requirements
PC3 with firmware PicoMitePC3 V7.00.00 RC2 or later.

Installation
Unzip the ZIP onto the SD card, then:
CHDIR "B:/mmbg"
LOAD "mmbg_pc3.bas", C
RUN

The manual (English and German PDF) is included.

The version for the PicoCalc (PiCa) will follow ...

Have fun playing and testing! Please report all bugs here.

Matthias

MMbg_PC3.zip
 
Volhout

Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 6195
Posted: 05:07am 20 Oct 2026
Copy link to clipboard 
Print this post

Wauw

Cant wait to Try it out.

Volhout
Edited 2026-10-20 15:07 by Volhout
PicomiteVGA PETSCII ROBOTS
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 07:20am 20 Oct 2026
Copy link to clipboard 
Print this post

That's great,
I'm looking forward to the PicoCalc version.
Does it also require MMbasic V7?
If so, I'll have to update.
 
javavi

Guru

Joined: 01/10/2023
Location: Ukraine
Posts: 621
Posted: 05:45pm 21 Oct 2026
Copy link to clipboard 
Print this post

Great,
I really liked your game. I lost five times in a row. It must have a really good built-in opponent, or maybe I'm just a bad player, probably because I've always played the Eastern version of backgammon. :))

By the way, is it possible to make a game using the rules of Eastern backgammon?

Thanks.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 723
Posted: 07:47pm 21 Oct 2026
Copy link to clipboard 
Print this post

Hi Javavi,

Thanks a lot for your kind feedback! I'm really glad to hear you enjoyed playing the game (even if the AI gave you a tough time! :)).

To answer your question about adding Eastern backgammon rules: to be honest, I'm not familiar with all the specific details and variations of Eastern backgammon.

More importantly, the game's strong AI is based on the gnubg neural network, which was trained strictly on the standard Western rules. Teaching an AI to play Eastern backgammon would require building and training a whole new neural network from scratch for those specific rules.

That isn't something I am planning to pursue for this project right now. However, the code is open for anyone who would like to adapt it or implement those rules themselves!

Matthias
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 11:58am 23 Oct 2026
Copy link to clipboard 
Print this post

I have the Pico Computer 2B FW V7.0.00b3 with 6MB PSRAM and 16MB Flash.
MMBG starts wit ERROR "Not enough memory".
Is there anything I can do about it?
I changed to V7.00.00RC3 but same Error
Edited 2026-10-23 22:23 by PilotPirx
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12051
Posted: 12:27pm 23 Oct 2026
Copy link to clipboard 
Print this post

Matthias

Great work

PilotPirx

You don't stay what variant of the firmware - HDMIUSB?. Also try updating to the latest version.
Edited 2026-10-23 22:28 by matherp
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 723
Posted: 12:45pm 23 Oct 2026
Copy link to clipboard 
Print this post

  PilotPirx said  I have the Pico Computer 2B FW V7.0.00b3 with 6MB PSRAM and 16MB Flash.
MMBG starts wit ERROR "Not enough memory".
Is there anything I can do about it?
I changed to V7.00.00RC3 but same Error


Thanks for trying MMbg! The current version is made for the Pico Computer 3 only (PicoMitePC3 firmware, 256 KB program memory, PSRAM). The PC2 has less RAM, so MMbg runs out of memory there.

At the moment I'm working on the PicoCalc version, which has to get by with much less memory. Once that is done, a version for the PC2 should be possible too - but please be patient, it can't be done quickly.

Matthias
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 12:59pm 23 Oct 2026
Copy link to clipboard 
Print this post

matherp

Yes, PicoMiteHDMIUSBV7.00.00RC3
Is it possible to get more program memory?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12051
Posted: 01:38pm 23 Oct 2026
Copy link to clipboard 
Print this post

Just tested works perfectly with RC3. Did you load the program with
LOAD "mmbg_pc3.bas", C
as in Matthias' post and in the program header? The ,C is critical
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 02:50pm 23 Oct 2026
Copy link to clipboard 
Print this post

matherp

One step further!
Now i get the Error "[247] String too long" after loading neural nets (gnubg)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12051
Posted: 03:05pm 23 Oct 2026
Copy link to clipboard 
Print this post

I think that is because you are running from the A: drive. It is a bug in the program. Run from the B: drive. If you follow Matthias' directions exactly it definitely works
Edited 2026-10-24 01:05 by matherp
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 03:06pm 23 Oct 2026
Copy link to clipboard 
Print this post

I run from the b: drive (sd-card).
It seems to work when I comment out that line.
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 03:16pm 23 Oct 2026
Copy link to clipboard 
Print this post

OK, i found it.
The program seems to use absolute paths. I had moved the directory one level down.
Now it works. Thanks!!!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 12051
Posted: 03:19pm 23 Oct 2026
Copy link to clipboard 
Print this post

are you running from a subdirectory or direct from B:/mmbg?
 
PilotPirx

Senior Member

Joined: 03/11/2020
Location: Germany
Posts: 164
Posted: 07:33pm 23 Oct 2026
Copy link to clipboard 
Print this post

At first i was running from a subdirectory b:/games/mmbg which doesn't work.
Direct from b:/mmbg and loading with ,C work fine now.
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 723
Posted: 07:35pm 23 Oct 2026
Copy link to clipboard 
Print this post

  PilotPirx said  ...
The program seems to use absolute paths.
...

I am aware of the problem and it is on my agenda.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026