============================================================================= MDJBACKGAMMON ============================================================================= "Oh no, not another Backgammon program..." Yes! I had for a long time missed a proper backgammon game for the computer, one that was playing well, did not demand too much from the graphics, easier to control than just by using the mouse, and that did not cost a fortune! I found a few on the Internet, but I was not satisfied with the graphical appearance of any of them, 3D can look good, but it is not all that useful to get an overview of a complicated position. I was not satisfied with the control of them neither. Primarily mouse controlled! And the playing. I am not an advanced backgammon player myself, so I could maybe do with a mediocre program, but it is quite obvious, that programs based on neural networks are the strongest, and the programs on the market using neural networks are usually quite expensive, perhaps because not everybody can figure out how to program such a thing. When I was at university studying computer science, I took some basic classes in neural networking, and I had for a long time been wanting to use it for something, and backgammon seems more or less ideal for an implementation using a neural network. I found on the Internet an article about IBM's solution to this exact task, and they could tell, how their program had become probably the best in the world, how it (almost) played even up with the best humans in the world, and how it pointed out minor mistakes in text book analysis of certain positions. The program had simply stuck to its oppinion about moving like this, not that, and had been able to support it with roll-outs, meaning a statistical analysis over thousands of games, played from that position, showing that one strategy in fact gave a better outcome than another. The researcher at IBM, the author of the article, also described in some detail some of the principles of the training used by the program. Those interested can find the article at , and I can also recommend . I had already figured out for myself some ideas for building a neural network, and even though the major piece of news in the research from IBM sounded immediately tempting, I did not use that principle in my own program right away. However, I have now been able to compare the two methods, and the TD method ("Time Difference" invented by IBM) has proven to be slightly better, so now this method is applied to the training of my program as well. Still, my own ideas are predominant throughout the program, and if it some day can create a name for itself that is mentioned along with the other "great" programs, I will be very satisfied. The neural network implementing the evaluation function, is still not fully trained in this version of MDJBackGammon. As the training progresses I will release newer version, that will also contain more and more functions. And now for the boring part: I reserve all the rights to the program MDJBackGammon (c) 1997-2000. The program is not to be copied or used in any way without my permission. The license for the program you buy gives you the right to install the program on YOUR PC's for YOUR own use. The file containing the license information, MDJLICEN.BIN, may NOT be copied to other PC's or users, be sold, leased, rented or given away, and the file may not be altered neither. If this happens, I reserve the right to in future versions to introduce a block against the license in question, thus destroying it's validity. Furthermore I will consider legal procedures. The license does not allow you to let MDJBackGammon participate in tournaments neither, with or without prices, without my permission. Your license allows you to use this and future versions of the program, without further payment than the costs of distributing upgrades. However on major changes in the program, I reserve the right to ask an upgrade price. I can not be held responsible for the program's usability for any given task on any given equipment. The program is bought "as is" and cannot be returned. (Instructions on how to order the program can be found in the bottom of this file.) Having said all that, I would like to point out, that in reality, I am of course very interested in making the program as usable as it is possible. If you find any errors og shortcomings, or if you simply have some ideas for improvements or changes, I would very much like to hear from you. I will of course correct any errors as fast as possible, and generally do what I can to make sure, that nobody regrets having bought my program. That is the reason I have made a free demo version of the program, showing the basics of the program, though not offering the more advanced functions, and which does not guarantee that you can play every game to the end. This demo version is freely distributable together with this readme.txt file. Installation ============ Content on the diskette: MDJBG.EXE MDJBackGammon MDJLICEN.BIN The license file, containing your name and license number MDJBGDMO.EXE The demo version of the program README.TXT This file The program is a single executable file, mdjbg.exe, and a file containing the license information, mdjlicen.bin. Put these in some directory, and make a shortcut to mdjbg.exe in Windows. The program is running under Windows 95/98, NT and Windows 2000. There will possibly be an installation program as well at some point. Furthermore, there is a file, mdjbgdmo.exe, which is the demo version of the program. This file can be freely distributed to friends and colleagues, who might be interested in buying the program, but first would like to see, how the program is looking. The demo version is limited in the sense that it does not always play the game to the end, the double cube can only be used once in every game, you can not manually set up a position, you can not save and load positions, the limit in the rollout function is 2, not 10000, and the log file with the played games is not created. Regarding strength at playing, it is not limited compared to the full version. Manual ====== This section briefly describes the way the program is working. I hope that everybody will find the program both simple and easy to understand. The Screen: The program has one single window with a set of elements: - The Board, having a bar in the middle. The board is marked with numbers and letters on the spikes, showing the corresponding keys. - The Double Cube, at the right in the middle (1) or at the top or bottom (2,4,8,...,512) depending on who owns the cube. The possible numbers exceed the limit of a "real" cube, but there should not be any doubts regarding this. For practical reasons the highest possible value is 512. - The Boxes, at the right, the cases where the pieces are stacked, when taken off. Here the pieces are "standing up". - PIP Values, showing for each player how many eyes of the dice the player still needs to finish. - "Turn Indicator", a little red or white dot at the right side of the board, showing who's turn it is. - Match information, on the right, when you have selected to play a match. - The Information Line at the bottom is showing information about the status of the game in progress. There are five menus, each with several menu points: File Load Position Used to fetch a position saved earlier Save Position Used to save a position under loaded name Save Position As Used to save a position under a new name Load Match Fetches a saved match Save Match Save the match position including the current board Save Match As Save the match position under a new name Exit Terminates the program Match No Match Normal play, no summing of results Continued Match "Never ending match", the result is summed and saved Reset Continued Match If you want to start from 0 Normal Match Start playing a match to some limit Edit Match Edit score and characteristics of the match playing Game New Game Starts a new game Abort Game Aborts the current game Offer Double Chosen to offer a double Move Back Move latest moved piece back (within same move) 1) Undo Move Go back one move 1) Redo Move Go forward one move 2) Undo Dice Remove the thrown dice from the board Move Now Force the program to move immediately 3) Roll Out Analyse a position using a number of roll outs Setup Setup Board Enter setup mode to construct a position Continue Game Continue game from current position Shift Turn Move the turn between the players Turn Board Swap side and colors Start Position Place the pieces in the starting position Clear Board Remove all pieces from the board to the boxes Level Submenu, where you can select skill level Options General settings 4) Help Possible Moves Shows a list of possible moves for this throw 5) About Shows general information about the program 1) It is only possible to undo a move before the dice are thrown or immediately after the dice are thrown before any pieces are moved. When a move is withdrawn, the dice are NOT removed. The game can thus be continued from the same roll, but with a new move. Undo Dice will remove the dice as well. If you are currently moving your pieces, you can regret your pieces moved using Move Back (the same as pressing Del, see later). 2) A move can only be redone immediately after a move has been undone. When the move is redone, the dice are NOT thrown for the following move. 3) The program can, depending on the type of PC, but also depending on the roll and position take more or less time to decide what to move. If you "loose your patience", the program can be forced to immediately move the best move found so far by the program. Note that this almost definitely will affect the playing skills of the program. 4) Among general settings it is possible to decide whether: - The dice will be thrown randomly or "manually". If manually, the player will for each throw be asked for the values of the dice, but with a random suggestion. - The homelands should be right or left. - The double cube should be used or not. - The "Just Win" strategy should be applied (see section on Equities). - The played games should be written to a file, "bg.log", or not. The Dialog to decide the settings also give the opportunity to save the settings (in mdjbg.ini in the Windows directory), and to get back to earlier settings again. If the file mdjbg.ini is deleted, the program will use its own defaults, as is the case the first time the program is being used. 5) The list is composed of a sequence number, an equity value in parenthesis (average number of points expected to be scored from this move as evaluated by the Advanced level), and finaly the move itself. The list is free of redundant moves, meaning that two "different" moves having the same net effect will NOT both be in the list. Should you find an example, where two moves in the list are indeed "identical" or a move is missing from the list, I would REALLY like to know about such an example! The Play: Skill level is selected using the submenu Level in the Setup menu. Note that Expert level will drastically increase the time used by the computer to think, while the Advanced level moves fast. When a game is starting using New Game, the pieces are set automatically and the player must now press Enter (or click using mouse on the center of the green board) to throw the dice, one on each side, and the biggest die decides who starts. You are always white, the computer is always red. When the computer is at turn, there will be a little red dot at the right of the board, and its move will be shown by the pieces flashing a few times when moving. If you are impatient and press Enter or click with the mouse to roll the dice, choose a menu point or simply press space, the program will immediately move the pieces to their destinations thus ending the computers move. When it is your turn, there will be a little white dot at the right of the board. The dice are rolled again by pressing Enter or clicking the dice. A piece is moved by clicking it or by pressing the letter for the spike. The piece will be marked (framed black) and can now be moved by clicking another spike or pressing the corresponding letter. When the move is finished, press Enter again or click the dice, and the turn will shift to the computer. If you regret having marked a piece, you can "demark" it by selecting the same spike/piece again. Note, that your bar is 'Z', and you carry off with 'A'. Here the mouse is working too. There are some facilities to make it easy to move: DEL: Pressing Del will take back your current move piece by piece, until the starting position for the move is obtained. This can be done before you have pressed Enter to end the move. BACKSPACE: Takes back the entire move. This also has to be done before pressing Enter to end the move. 1,2,3,4,5,6: If you have a piece on the bar, you can liberate it fast by pressing the value of the die used to liberate, for instance '4' instead of 'Z'+'V'. Likewise you can carry off a piece pressing the number of the spike the piece is coming from, for instance '3' instead of 'D'+'A'. 1,2,3 (during setup of a position): If you are setting up a position, a click on the double cube will double its value, a click on the position for the cube for the other player will move it to the other side, and a click on the initial position for the cube will move it to the center and set it to 1. The same can be done with the keys 1,2 and 3: 1 will move the cube to the center and set it to 1, 2 will double its value, and 3 will change ownership of the cube. SPACE: When a piece is marked to be moved, and there is no doubt, where it will move (for instance if you have already move for the other die, or if only one die is possible), then Space will finish the move. This is in particular useful for double rolls, because there are then never doubt about where the piece is moving. TAB: When a piece is marked to move, Tab will move the piece by as many dice as possible, if inambiguous. (See 2-/3-/4-double move.) 9: If you are setting up a position, there are two bars to choose from, so here '9' is the enemy bar. 0: If you are setting up a position, there are two boxes to choose from, so here '0' is the enemy box. 2-/3-/4-double move: If you wish to move the same piece 2, 3 or 4 times in the same roll, it is enough to mark the piece, and then select its final destination. Note however, that (for different dice) there can be doubt about the route chosen. If both routes have the same effect, one of them is simply used, but if one or both of the routes capture an enemy piece on the way, this feature is NOT possible. You are then forced to perform the move normally, that is in two turns. Note that with the above, it is possible to: - carry off a piece on 'E' using 'E'-'A' or simply '4', even if you have rolled 3,1. If the piece for instance is the last, it can be carried off like this, even if you have rolled 6,2 for instance. (Note: This winning situation is by the way the ONLY situation in Backgammon, where it is allowed to move by only one die, even though it is possible to move by both dice!) - with for instance 6,4 you can liberate a piece with 'Z'-'P', or with for instance 4,2 you can liberate a piece with '6' (both under the assumption that both spikes are free, and that there are no more pieces on the bar.) - If the last piece outside the homeland is moving into the homeland and is carried off in the same move, it is still possible to do it in one move. In the extreme example rolling 6,6, a piece can be moved 'Y'-'A'. Generally, moves liberating or carrying off, can without limits be combined with other moves if it is the same piece moving. Note also that numbers are always tied to the spike the piece is on, and thus not necessarily the eyes of the dice. The program will never allow you to move something illegal! In case the program is allowing something illegal, not allowing something legal, or it will not "help" using Space when there is no doubt, I would VERY much like to know about it. Note the exact position and the roll, and let me have a look at it. Suggestions for improvements and other shortcuts are also very welcome together with criticism and complaints about the user interface. Regarding the playing skills, I refer to the fact, that it is still in training. Hopefully the program will continue to improve its playing skills. Game Log ======== In the directory where the program is started, there will be written a file, bg.log, containing all the played games written in a notation that to my knowledge follows the international rules for notation. In case you find any errors in the program, I would like to have a copy of this file, since it can help me reconstruct the error. Note that bg.log is never deleted by the program, you will have to do that yourself, when it becomes too large. The file is only written if selected in the "Options" dialogue. Match ===== If you choose Continued in the menu Match, the program will sum the results and show the score on the right. The score will be remembered from time to time the program is started, and the match will thus continue indefinitely. You just need to select Continued each time, since No Match is default. Note that the program can sum up to 10000 only, after that the number will reset to 0 and continue from there. Reset Continued Match in the Match menu will reset the entire score. You can also choose Normal Match, in which case the program will ask you to specify the limit you wish to play to. After that, you simply play as usual, and you can again follow the score on the right side of the board. If you wish to stop the match, you will have to manually save it, if you want to be able to continue later on, where you stopped. Roll Out ======== By choosing Roll Out in the Game menu, you will be presented with a dialog where you can specify the number of roll outs to perform from the current position. The limit of roll outs is 10000. Furthermore, you can specify whether the dice used for the first move are to be thrown for every roll out, specified by you once and for all before roll out begins, or, if dice are already thrown, the dice on the board are to be used. While roll out takes place, another dialog will show the progress, and offer the possibility of aborting the roll out, or end it where it is, presenting the result based on the roll outs finished at that point. When presenting the roll out results, the percentage of each possible result is shown, and the average points the human player can expect to gain. Roll outs does not take use of the double cube. When doing rollouts, the program is playing at the "Advanced" level. Equities ======== The concept "equity" is widely used in backgammon, and it is in short the average outcome of a move or a position without the use of the double cube. A short explanation of the inner working of a neural network based backgammon program is; calculate the equities of each of the possible moves, and choose the move having the greatest equity! The doubling cube is handled even simpler: Before throwing the dice, calculate the equity of the position, and if it is within certain boundaries offer a double and likewise for take/drop decisions. With the "Possible Moves" function it is possible to "cheat" a little by having the computer help calculate the equities. MDJBackGammon is using the level "Advanced" to calculate the equities in the list, not "Expert" because it would take too long to generate the list. So you can experience that the expert level chooses a move different from the one having the greatest equity in the list, simply because it is basing its decision on more calculations than the advanced level. That is the difference between advanced and expert. An important note about the equities: An equity is calculated as a weighted average of the six different outcomes of a game. In a match situation, the actual outcome can be larger than what the player needs to win the match, meaning that the value of winning is less than usual. For instance, with 3 points to go and the cube at 2, a gammon is not worth 4 (2) points, but only 3 (1.5) points, or with 1 point to go and the cube at 4, winning is not worth 4 (1) points, but only 1 (0.25) point. In such cases, the weighted average done by the program is weighted according to these corrected values, meaning that a move can have a different equity in a match than in normal play or infinite match ("money game"). It is thus also possible to see, that the program moves differently in the same situation, depending on the context of the game. So to evaluate equities in general, be sure to be in single game mode, not match mode. Because the values in the list are those generated by the neural network, the values may appear to be inaccurate for simple positions. For instance, in a position where you are sure to win, but gammon is not possible, the equity is clearly 1.000, but since the neural network does not incorporate an exact game tree analysis, the equity may appear as 0.995 or another value close to 1.000. For freak positions, never appearing in real life, the value can vary even more from the truth. In the Options dialog box, there is an option called "Just try to win". When this option is selected the weighted average is done without taking into consideration the possibilities for gammon and backgammon, the program simply chooses the move having the greatest chance of winning, though another may in fact have a higher equity due to a higher gammon or backgammon possibility. Of course, this way of playing does not make any sense in matches, and if the option is set, the strategy applies to single games only (what I like to call a who-is-gonna-do-the-dishes-game). In general, the program usually plays the same move in the same position for all the different game environments, but sometimes it WILL play differently, due to all these factors having an impact on the calculation of equities. So don't be surprised if you encounter such an example - it is just the program doing it's best at adapting to the situation at hand, match or money game - and don't expect it to do the dishes voluntarily! Future enhancements =================== I have a lot of ideas for improvements of the program, and they will be implemented step by step and released together with better trained versions of the program. These releases will primarily be free for registered users. Some of the ideas I have are (some are more important than others): - The possibility of choosing the colors - The possibility of getting a printout on the screen of the game in progress or part of the game - The program "commenting" on your moves - The possibility of "typing in" a game and have the program analyse it - Translation of the program to various languages - A manual written as a Windows help file I hope that the program is useful, even though all these ideas are not reality yet. Have a nice game! Morten Due Jorgensen Skyttevej 5 DK-3450 Allerod +45 48 14 55 18 e-mail: miraculix(a)mobilixnet(.)dk www: http://www.miraculix.mobilixnet.dk My e-mail address is written like that to fool the spammers' harvesting robots, I hope you can still figure it out. Ordering of MDJBackGammon ========================= The program costs US$45 or the equivalent in your local currency. The money should be sent to me (address above) in cash (from outside Denmark, so far only cash is accepted). If you wish to guard yourself from loosing the money in the mail (it IS very unlikely), you can send the payment recommended. Remember to write the entire name, for which the license should be generated as well as the address where to send it to. I will then send you a disk with the latest version of the program together with your license file. When buying the program, you accept to respect the copyrights on the program as well as the rules for use of the program described earlier in this file. REMEMBER to take good care of the disk with the license file! If it gets lost or stolen, please let me know right away, and I will introduce a block against the license in future versions and send you a new one. This will only costs US$3. The same price goes for sending new versions. When you order, please let me know whether you would be interested in a version in a language other than english. Depending on the interest shown, I might prioritise the point. Future versions can be downloaded from the Internet at the above address together with general information.