Boray Gammon (Now V2.0)

Discussion, Reviews & High-scores

Moderator: Moderators

Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Thanks! Yes, it's basic compiled with austro compiler. I started to program on a real Vic-20 with that in mind, but after a while I went over to using Basedit.Net and VICE instead. The program got a bit too complex for the small screen of the Vic I think, and using VICE I could test the program in normal basic running at 600% speed and often even at 3200%. I often made small changes to the algorithm only affecting one of black or white and then run the emulator at warp speed to see if the change made it win more.

austro compiled programs seems to use the normal basic engine for variables, because you can break the program and then for example type print a$ to see that value. That's actually pretty useful during testing.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Here comes a bunch of development pictures for you:
http://museum.boray.se/#!album-10
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Boray Gammon vs one of the top gammon AIs in the world

GNU Gammon is ranked as the number two top gammon artificial intelligence in the world today (beaten by Extreme gammon, mostly in speed). GNU gammon also has the ability to analyse the game and rank the player. So how does it rank Boray Gammon? Well, judge for yourself. This is the first test game I've run with Boray Gammon V1.15:

Image

Image

Only two moves marked as "doubtful" by gnu. No bad ones. No "very bad" ones. And here is the whole game noted:

Image
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Re: Boray Gammon

Post by Schlowski »

That's a very nice and respectable ranking, I'm sure you're proud of your "baby" :)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Yeah, especially considering GNU grandmaster uses about the same amount of thinking time on a computer that is 50.000 times faster. :D
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
orion70
VICtalian
Posts: 4337
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Boray Gammon

Post by orion70 »

Sooo... size does NOT matter, as long as you use it wisely :mrgreen:
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

V1.21 is released:
Faster: The AI is about twice as fast. The average thinking time is now around 5 seconds instead of 10 seconds.
Smarter: The AI wins about 20% more points when playing against the previous version (in the long run). This version has actually won a 7 point match over me (with the score 7-5). I'm not sure if I should be proud or embarrased. ;-)
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
beamrider
Vic 20 Scientist
Posts: 1447
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Boray Gammon

Post by beamrider »

Well since you programmed the AI either way you look at it, you won...... or lost.

Sent from my Nexus 5 using Tapatalk
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Boray Gammon

Post by nippur72 »

I just learned to play backgammon, but it's still not easy to play the VIC-20 version because of the keyboard controls.

Would it be possible to make a version with a movable "cursor" and/or show the legal moves?

I'm also curious about the AI you programmed, can your share some detail? Having written a gomoku implementation, I know how much difficult is to pack an AI into VIC's memory. Is it heuristic?
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

I will keep the keyboard control. I think using a cursor just will slow you down.

I guess you can say it's heuristic. I would think all backgammon AIs are. With all randomness built into the game, no computer would be enough to calculate all possible moves of the rest of the game.

What I'm doing is to test all possible moves given by the two dice and give each of the moves a score for things that are better and worse. Well, the score is actually a score for how much the board has improved in your favor compared to before the move. So in many cases it's a negative score but still the best possible (according to the routine at least). And in addition to that I also have a few routines that takes over in different situations. You can actually see which routine (with a code name) and the score while the computer is moving (below the board). Doubles are treated as two separate moves after each other, which probably is the weakest link in my AI. But most of the time, it works well enough.

A new version will be released quite soon by the way... :D
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Boray Gammon

Post by nippur72 »

ok, so you have a manually encoded "value" function for every legal move.

The difference with the famous TDGammon is that the value function is calculated by a neural network as the result of playing a lot of matches against itself.

I wonder if it would be possible to write a cut down version of a such neural network that can fit on the VIC. Or at least optimize the parameters of the actual function so that it can play as good as possible.

TD-Gammon also plays many turns in advance, so it doesn't take the move with the best score, but the move that can lead to a best score in the future.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Interesting. I've let my program play a lot of games against itself as well (in VICE at warp speed). In the version soon to be released, I've changed 7 of the opening moves. Right now the new version is in the lead with 1294 points against 1092 for the old version. So that's an 18% improvement.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Boray Gammon

Post by nippur72 »

Is source code available? I would like to give a peek at it. I like the idea of making the best possible player that fits on a VIC-20 :-)
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Re: Boray Gammon

Post by Boray »

Well, I don't know, I'm a bit closed when it comes to source code.... Hmmm... So you're interested in making your own backgammon game?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Re: Boray Gammon

Post by nippur72 »

no, I don't want to make my own implementation of backgammon, I've learned how to play just yesterday!

But since I've heard a lot about TD-Gammon (in the field of machine learning), it raised my interested about the possibility of implementing a cut down version of it on the VIC.

But I guess there isn't just enough computing power, both memory and FLOPS.
Post Reply