Menace Instructions

The Adit MENACE simulation

The Adit Menace machine simulation is not written to a full commercial specification. It is probably quite easy to break should you set out to do so. We would appreciate details of any genuine bugs or suggestions for further experimentation consistent with the purpose of the simulation.

Initialisation

The first time you start the Menace simulation you will need to run the “Initialise” option from the File menu. This will calculate the 304 symmetrically unique playing positions facing the Menace machine in the first four moves of a noughts and crosses (Tic Tac Toe) game.

It is a good idea to save this position using the “Save Menace File” File menu option. Use a name to indicate that this is an untrained set of game positions – you may want to re-load it to save running the Initialisation again.

You can use the Save option later to save a trained machine or to save machines in different states.

You can then use the Mode menu option to switch the mode to “Training Mode” and then take the “Automated” option from the Play menu. You will then have a screen like the one below:

Automated Training

You can switch the level of play from the automated opponent to get different types of games and incidentally different sorts of behaviors from the Menace machine. I would leave the “Game Progress” option set to leave the playing board visible as this adds little overhead to a modern PC. If you want to watch the progress of individual games you can set the wait time between moves and games – each move is numbered so you can follow the order of play.

Press the Play button and let the first few games run. I would reduce the number of games if you have pauses between moves although the “Play” button becomes a “Stop” button to halt a game sequence after the next game has completed. One hundred games take very little time to complete without pauses.

The Menace machine always goes first and uses crosses. The Automated player (or an interactive player) is always noughts.

The progress of the Menace machine is indicated by the counters displaying the Wins, Draws and Losses beside the playing board.

The learning progress of the MENACE machine varies with the skill of the opponent. If the opponent is effectively random then the machine takes a fair share of the games right from the start but a large number of games are required before the machine becomes an acceptable player. If the machine plays against stiffer opposition it loses badly to start off with but quickly develops a playing style that matches it’s opponent’s skills.

By default, negative feedback is turned off. This was initially because the large number of games used to train the Menace machine meant that some playing positions ran out of options. The downside of not using negative feedback is that the machine can still opt for “faulty” play as the option to take bad moves still exists – even with a low probability of being selected. The upside of not applying negative feedback is that the machine can be re-taught to play in a different style – it retains the option to make different moves and ultimately to be rewarded/reinforced for success using them.

You can try turning negative feedback back on using the first option on the Mods menu (it toggles).

You can also try my option to cull playing options that would probably have been eliminated from a playing position during training – use the second option on the Mods menu. This should fix a Menace machine in a certain behavior in ordinary play and ensure that odd “errors” were not going to be deliberately made. This should only be tried after a training sequence has resulted in a satisfactory level of play.

Interactive Play

Once you have a trained machine (or even before) you can play against it interactively. You can set the Mode to Play mode or continue (or take command of) the Menace machine’s training regime.

Use the Play menu to switch to an interactive game. To start a game all you have to do is click the “New Game” button. The Menace machine will then make the first move and await your response. the game should then run until a draw is obvious or there is a winner. The game playing counters a re-set so that you can track the progress of a sequence of games.

The software does not disable interactive moves while the Menace machine is deciding upon a move. Menace moves are nearly instant on a well specified PC but it is possible that they might be slowed by other processes or by the particular circumstances of a given PC. Interactive players are therefore asked to show the Menace machine the same courtesy they would another human player and always wait their turn.

The Visual Basic Code

The Menace machine itself “lives” within the MenaceF1 form. The NCAPlayer class contains the automated player and the NCARef class acts as a passive “referee”that judges the state of the game and decides the winner where appropriate. These two classes share some common process and they could be made to interact with one another but as the referee class has been used elsewhere things have been kept very simple.

The 304 playing boards are calculated by the CalcBoards() Sub that recursively calls itself. The AddBoard() routine decides if a given playing position is unique and should thus be saved as one of the 304.  The possible symmetrical transformations are stored in the TransForms() array by the Form_Load() Sub.

Most of the Subs and Functions have some sort of note at the top to tell you what they are supposed to do.

The only clumsy area (you might have a different opinion about more of it) is in the matching of active game positions to the 304 stored game positions. Probably the stored game positions (together with the weighted game options) should have been transformed rather than the playing position. This would have simplified the game playing code a tad

[ Home] [About Us] [Systems] [Software Review]

Google
  Web www.adit.co.uk