Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262...

17
The Snooker Simulation Peter Grogono 5 April 2013 Contents 1 Introduction 1 2 Installation 1 3 Playing Snooker 1 3.1 Settings ..................... 1 3.2 Controls ..................... 3 3.3 Starting a frame ................. 3 3.4 Positioning the cue-ball in the dee ....... 4 3.5 Viewing the position .............. 4 3.6 Aiming ...................... 4 3.7 Shooting ..................... 5 3.8 Ending a frame ................. 6 3.9 Ending the game ................ 6 3.10 Snookered by a foul ............... 6 4 Reference 6 4.1 The Settings Window .............. 6 4.1.1 Players .................. 6 4.1.2 Both players ............... 7 4.1.3 Lighting ................. 7 4.1.4 Options ................. 8 4.1.5 Parameter Adjustment ......... 8 4.2 States ....................... 9 4.3 Controls Window ................ 9 4.3.1 Buttons ................. 9 4.3.2 Cue speed ................ 9 4.3.3 Spin ................... 9 4.3.4 Messages ................ 10 4.3.5 Instructions ............... 11 4.4 Keyboard .................... 11 4.5 Mouse ...................... 12 5 Additional Features and Limitations 12 5.1 Autoplayer profiles ............... 12 5.2 Break shots ................... 13 5.3 Sound effects .................. 14 5.4 Textures ..................... 15 5.5 Limitations .................... 15

Transcript of Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262...

Page 1: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation

Peter Grogono

5 April 2013

Contents

1 Introduction 1

2 Installation 1

3 Playing Snooker 13.1 Settings . . . . . . . . . . . . . . . . . . . . . 13.2 Controls . . . . . . . . . . . . . . . . . . . . . 33.3 Starting a frame . . . . . . . . . . . . . . . . . 33.4 Positioning the cue-ball in the dee . . . . . . . 43.5 Viewing the position . . . . . . . . . . . . . . 43.6 Aiming . . . . . . . . . . . . . . . . . . . . . . 43.7 Shooting . . . . . . . . . . . . . . . . . . . . . 53.8 Ending a frame . . . . . . . . . . . . . . . . . 63.9 Ending the game . . . . . . . . . . . . . . . . 63.10 Snookered by a foul . . . . . . . . . . . . . . . 6

4 Reference 64.1 The Settings Window . . . . . . . . . . . . . . 6

4.1.1 Players . . . . . . . . . . . . . . . . . . 64.1.2 Both players . . . . . . . . . . . . . . . 74.1.3 Lighting . . . . . . . . . . . . . . . . . 74.1.4 Options . . . . . . . . . . . . . . . . . 84.1.5 Parameter Adjustment . . . . . . . . . 8

4.2 States . . . . . . . . . . . . . . . . . . . . . . . 94.3 Controls Window . . . . . . . . . . . . . . . . 9

4.3.1 Buttons . . . . . . . . . . . . . . . . . 94.3.2 Cue speed . . . . . . . . . . . . . . . . 94.3.3 Spin . . . . . . . . . . . . . . . . . . . 94.3.4 Messages . . . . . . . . . . . . . . . . 104.3.5 Instructions . . . . . . . . . . . . . . . 11

4.4 Keyboard . . . . . . . . . . . . . . . . . . . . 114.5 Mouse . . . . . . . . . . . . . . . . . . . . . . 12

5 Additional Features and Limitations 125.1 Autoplayer profiles . . . . . . . . . . . . . . . 125.2 Break shots . . . . . . . . . . . . . . . . . . . 135.3 Sound effects . . . . . . . . . . . . . . . . . . 145.4 Textures . . . . . . . . . . . . . . . . . . . . . 155.5 Limitations . . . . . . . . . . . . . . . . . . . . 15

Page 2: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 1

1 Introduction

The Snooker Simulation (TSS) runs under Microsoft WindowsTM Windows XP or later. It is a 3Dgraphics program that requires a fast processor, a good graphics card, and a large monitor to providethe best effects.

TSS conforms to the rules of professional snooker as far as possible. You are expected to know atleast most of the rules, too: this manual does not describe them. The most important rule that is notimplemented is the "miss rule". If a player fouls in professional snooker, the referee may request theplayer to try the shot again. The referee’s judgment is crucial (and sometimes controversial); TSS doesnot attempt to simulate it.

If you are reading this manual from the screen, note that blue text denotes a hyperlink that you canuse to navigate within the document. Cross-references are shown like this: [§1].

Acknowledgments

A number of snooker players have offered feedback on earlier versions of TSS, including Felix Atagong,Stanley Cannon, David Hoskins, Florian Pforr, Mario Pon’s, Matt Spychalski, and Dmitry Yakunin. Iam especially grateful to Geof Isherwood, who has provided detailed criticism, nice textures, and thepleasure of a weekly game of snooker.

2 Installation

You can obtain TSS by downloading the zip archive tss.zip. Extract files from the archive using aprogram such as WinZip1 or WinRAR2. Figure 1 lists and explains the files in the archive. The archivemay not be exactly as shown here, but it should be similar.

Create a folder called Snooker or something similar and extract all of the files to it. If you want to startthe program from the desktop, right click on snooker.exe and select Send to / Desktop. You canchange the icon to tss.ico if you like.

3 Playing Snooker

This section explains how to play the game in a narrative style. The next section [§4] describes thevarious options and possibilities in reference form.

3.1 Settings

When TSS starts up, it displays the Settings Window shown in Figure 2. We describe the optionsprovided by this window in detail later [§4.1]; here we explain only the selections you need to getstarted.

1http://www.winzip.com2http://www.rarlab.com

Page 3: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 2

Size File name Size File name3,262 tss.ico 393,270 tableTexture.bmp

112,435 manual.pdf 196,662 clothTexture.bmp1,597,510 snooker.exe 98,358 cueTexture.bmp

220 settings.dat 1,396 cuehard.wav966 players.txt 1,932 cuesoft.wav

1,045 breakshots.txt 21,836 pocket.wav162,816 fmod.dll 6,076 impact.wav237,568 glut32.dll

Figure 1: The files needed to play TSS. tss.ico is an icon that you can use for a shortcut to TSS.manual.pdf is the manual that you are reading. snooker.exe is the game itself. settings.dat con-tains your own configuration of the game. The other files are support files: txt files store informationabout autoplayers [§5.1]; wav files have sound effects [§5.3]; bmp files have textures for graphic realism[§5.4]; and dll files are dynamic libraries.

Figure 2: The Settings Window. Player 1 is autoplayer Careful Kate and Player 2 is being assisted byautoplayer Hardy Potts.

TSS allows you to simulate playing snooker using the mouse and keyboard. It also has an ArtificialIntelligence engine that controls automated snooker players, which we refer to as autoplayers. Youcan choose to let one or both autoplayers play the game, or you can obtain various levels of assistancefrom them.

The settings window has two subwindows, Player 1 and Player 2, which enable you to specify theplayers’ names and characteristics. Choosing Automatic from the options creates an autoplayer. Theother options provide various levels of assistance:

Page 4: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 3

Manual: No assistance — you’re on your own.

Track cue ball: Displays path of cue ball to first impact.

Track object ball: Displays paths of cue ball and first ball struck.

Track all balls: Displays paths of all balls.

Assisted: Sets direction, spin, and force of cue for the shot.

In Assisted mode, the quality of help given depends on the autoplayer chosen from the Helpermenu. Autoplayers are ranked, with the best at the top of the drop-down list.

3.2 Controls

When you are happy with the Settings, move your attention to the Controls Window at the bottom ofthe screen, which should look something like Figure 3. At the left end of the Controls Window, thereare eight labelled buttons. Green buttons are active: clicking on it will do something. Red buttons areinactive: clicking on them has no effect. For each button, there is a corresponding keystroke that hasthe same effect.

Figure 3: The Controls Window

The row of numbers at the top of the Controls Window indicates the force of the shot or, moreprecisely, the speed of the cue when it strikes the cue-ball. The white circle with green inlay at theright of the Controls Window is used to control spin. The remaining area of the Controls Windowdisplays information about the state of the game and provides instructions for human players.

3.3 Starting a frame

To start a frame, either click on the button labelled Start Frame or press the ’s’ key.

From now on, we will abbreviate instructions such as these like this: "press Start Frame or ’s’".

What happens next depends on the mode of Player 1.

If the mode is Automatic, the player breaks off.

If the mode is Assisted, the helper positions the cue-ball in the dee and waits for you to aim.

In all other cases, you have to position the cue-ball in the dee, as described next.

Breaking alternates between players. Player 1 starts frames 1, 3, 5, . . . and Player 2 starts frames2, 4, 6, . . ..

Page 5: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 4

3.4 Positioning the cue-ball in the dee

TSS lets you position the cue-ball in the dee using either the mouse or the arrow keys (←, →, ↑, ↓).When you are happy with the position, press the ENTER key.

You can move the cue-ball to impossible positions. For example, if you are moving it from one sideof the dee to the other, you may move it through the brown. However, if you press ENTER when thecue-ball is an impossible position, TSS moves it to a feasible position and then allows you to continuemoving it.

When you have successfully positioned the cue-ball and pressed ENTER, TSS will put you into "view-ing" mode, described next.

3.5 Viewing the position

Before you are ready to play your shot, TSS provides various ways of viewing the table.

Keys F2–F12 provide different static views of the table.

Keys 1–6 provide views from the pockets, enabling you to see whether a ball has a clear path tothe pocket.

If you click on a ball, that ball becomes the "centre of attention": moving the mouse from rightto left rotates the view around that ball. This option provides another way of finding out whethera ball is pottable.

To move from viewing to aiming, press Aim or ’a’. This step is reversible: while aiming, you canreturn to viewing by pressing View or ENTER.

3.6 Aiming

Press Aim or ’a’ to aim. In aiming mode, TSS displays a cue positioned for a shot. Before playingthe shot, you have to adjust the direction, spin, and force to obtain the effect you want.

Direction

To set the direction with the mouse, hold the left button down. Left-right movements alter thedirection of the shot. Up-down movements control the viewpoint: moving the mouse up bringsyour eye lower and closer to the cue-ball.There is a precise relation between the horizontal position of the mouse and the direction ofthe cue. This has the unfortunate effect of causing the view to jump if you release the mousebutton, move the mouse, and press the button again. With practice, you will learn not to movethe mouse while aiming except when holding the button down.

To set the direction from the keyboard, press ’z’, ’x’, ’c’, ’v’, ’b’, or ’n’. Figure 4 shows theeffect, ranging from ’z’, which gives a large leftward movement, through smaller movements,to ’n’, which gives a large rightward movement.During aiming, the viewpoint is always that of the player, looking down the cue towards thecue-ball. However, players often stand up to get a general view of the table and then crouch

Page 6: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 5

down to play the shot. This movement is simulated by the ’.’ (dot, period) key, which switchesbetween standing and crouched positions, as shown in Figure 5.

zx c v

bn

Figure 4: Using the keyboard to aim.

Figure 5: Press ’.’ (dot) to switch between high (left) and low (right) aiming positions.

Spin To set spin with the mouse, move the mouse onto the cue-ball image at the right side of theControls Window and click the left button. The black spot on the cue-ball shows where the cue willstrike it.

To set spin with the keyboard, press the arrow keys (←, →, ↑, ↓). The impact point will move incue-ball image.

The impact point cannot be moved outside the green area because the effect would probably be amis-cue, which TSS does not simulate. If the impact point is on the red-line, the cue-ball will rollinitially, rather than slide. In other words, this line indicates the "natural roll" cueing position.

Force To set the force of the shot with the mouse, click on the line of numbers at the top of theControls Window. TSS will display the precise force as a red line. The units are centimetres persecond, with the highest allowed cue speed being 500 cm/s.

To set the force of the shot from the keyboard, press ’+’ to increase the force and ’-’ to decrease it.The red line in the Controls Window will change accordingly.

When you have finished aiming and are ready to play, press Shoot or ’ ’ (space bar).

3.7 Shooting

Press Shoot or ’ ’ (space bar) to shoot. Once you have played the shot, the computer takes overuntil all balls have come to rest. During the shot (that is, while the balls are in motion), you canchange the viewpoint by pressing keys F2–F12 or 1–6.

Page 7: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 6

At the end of the shot, the program leaves you viewing the next shot. If a ball has been legally potted,the same player continues with the next shot. Otherwise, control is passed to the other player.

3.8 Ending a frame

There are two ways to end a frame.

If you press End frame or ’e’, the frame ends and the player with the highest score wins theframe.

If you press Resign or ’r’, the frame ends and the player who did not resign wins the frame.

Autoplayers resign when wining the frame becomes very unlikely. However, some autoplayers aregive up more easily than others.

3.9 Ending the game

To end the game completely, press one of Quit , ’q’, or ESC. The program shuts down immediately,allowing you to respond quickly when the boss walks into your office.

3.10 Snookered by a foul

If one player fouls and leaves the other player snookered, the player coming to the table may elect topass, requiring the first player to play from the snookered position. If this happens, the Pass buttonwill turn green. Press Pass or ’p’ to return control to the player who fouled.

TSS determines whether the incoming player is snookered by applying the rules of snooker as well as itcan. An object ball is snookered if there is any part of it that cannot be struck directly by the cue-ball.The position is a snooker if all balls that can be legally struck are snookered.

4 Reference

4.1 The Settings Window

The Settings Window is normally used before playing to set various modes. It is not usually neededafter you have started a game, although the controls are in fact active at all times. Figure 2 shows theSettings Window and the next few sections describe the controls that it provides.

4.1.1 Players

There are two players. You can use the default player names (Ace and Shark) or you can change thenames by typing new names into the name boxes.

Each player has one of six modes:

Manual: the player receives no assistance from the program.

Page 8: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 7

Track cue ball: the program shows the path that the cue ball will take when the shot is played.

Track object ball: the program shows the path that the object ball will take when the shot isplayed.

Track all balls: the program shows the path that all of the balls will take when the shot is played.

Assisted: the program will choose a shot and display it. You can still alter the shot before playingit.

Automatic: the program will choose and play the shot; you have no control over it.

A Helper is associated with assisted and automatic modes. The helper is chosen from a predefinedlist of players controlled by the computer (“autoplayers”) whose level of skill varies. The list is orderedfrom best to worst autoplayer and is updated after each game in which both players are autoplayers.

For all modes of playing except automatic, you have full control of the view of the table. For auto-players, however, TSS chooses the view. The options, given in the panel Autoplayer view are asfollows:

Black end: the entire table is seen with the black spot in the foreground. (This is like the viewfrequently used in television broadcasts.)

Player: the table is seen from the player’s viewpoint.

Facing: the table is seen from the viewpoint of someone directly facing the player.

Automatic: the program chooses a viewpoint related to the shot.

The selected view is used for the start of each shot; you can change it at any time by pressing a key(see Figure 7 on page 11).

4.1.2 Both players

This section provides various options that apply to both players.

Show plan: if the player is assisted or automatic, the program displays the helper’s intention.For example: “pot red with position for black”.

Show report: if the player is assisted or automatic, the program displays the result of theshot and the score or penalty. For example: “missed (−4)”.

Show reserve: if the player is assisted or automatic, the program displays the player’s "re-serve" [§4.3.4].

Play continuously: TSS starts new frames immediately, without waiting for any action fromyou. If you turn this option off, TSS will continue playing until the end of the current frame, andthen stop.

Randomize players: if TSS is playing continuously, new players are chosen randomly at thestart of each frame.

4.1.3 Lighting

This section provides controls for lights and shadows.

Page 9: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 8

Light 1: There are two lights over the table, roughly positioned over the pink and brown spots.This control turns the first light on or off.

Light 2: Turns the other light on or off.

Shadows: If selected, each ball casts shadows on the table. If the lights are off, there are noshadows.

4.1.4 Options

This section allows you to store break shots (see [§5.2]) and to make other adjustments.

If the named option is enabled (that is, has a tick mark), the effect is as below.

Show aim point: the point of impact of the cue on the cue-ball is shown as a black dot.

Feather cue: the cue will move back and forth a few times before striking the cue-ball, simu-lating the "feathering" motion used by most players.

Sound: sound effects will be generated.

Open log file: a summary of each frame will be recorded in a log file. Log files have nameslike zz.20130306.093457.txt. The zz ensures that log files are listed at the end of the folder(assuming alphabetical ordering). The numeric fields give the date (6 March 2013) and time(09:34:57 a.m.) at which the frame started.

Save settings at exit: when one of Quit , ’q’, or ESC is pressed, TSS writes a copy of thecurrent settings to a file called settings.dat. This file is read when TSS is next started. Somesettings are not saved. For example, Play continuously is always saved in disabled state sothat TSS does not start playing without giving you a chance to set it up.

4.1.5 Parameter Adjustment

The Parameter Adjustment allows you to modify some of the internal parameters of TSS. The param-eters have been chosen for realistic simulation, and making large changes may have drastic effects.For example, if friction parameters are significantly reduced, the balls will go on rolling for a very longtime. Each parameter has a limited range to ensure that the results of changing it are not too serious.

To change a parameter:

Enter a new value in the number box.

Click on the small vertical arrows beside the number box.

Move the mouse cursor onto the arrow area, press the left button, and move the mouse up anddown.

Click on Reset to restore the default value of the parameter.

The significance of the parameters are as follows:

Time increment: The time increment used for integration when computing ball velocities andpositions: typically 0.001 seconds.

Sliding friction: The friction between a ball and the table when the ball is sliding.

Rolling friction: The friction between a ball and the table when the ball is rolling. Thisvalue is typically an order of magnitude or so less than the sliding friction.

Page 10: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 9

Spinning friction: The friction that slows down a ball that is spinning about a vertical axis.

Ball-ball friction: The friction between colliding balls. Some of the rotation of one ball istransferred to the other, an effect exploited by skilled players.

Ball-rail friction: The friction between a ball and the cushion ("rail"). The most importanteffect of this friction is to impart side-spin to a ball that hits the cushion obliquely: this spinaffects the angle of the next ball-cushion collision.

4.2 States

TSS has various states, such as POSITIONING (the cue-ball in the dee), VIEWING, AIMING, and PLAYING

(when the balls are in motion). The state is generally indicated by the "help line" at the bottom centreof the Controls Window. For example, in the VIEWING state, this message says "Viewing: aim whenready".

The effect of a control depends on which state TSS is in when the control is used. Good softwaredesign practice deprecates states but the complexity of playing snooker with only a mouse and akeyboard makes it difficult to avoid them.

In the explanations below, we indicate which state (or states) TSS must be in for the control to have theeffect described. The explanations may seem complicated but, hopefully, using the controls is fairlyintuitive in practice.

4.3 Controls Window

This section describes the effects you can obtain when the mouse cursor is inside the Controls Win-dow.

4.3.1 Buttons

The buttons are at the left end of the Controls Window. A button is either green (enabled) or red(disabled). Clicking on a disabled button has no effect. Figure 6 summarizes the function of eachbutton and its enabling condition.

4.3.2 Cue speed

The numbers at the top of the Controls Window indicate cue speed in centimetres per second. WhenAIMING, you can click on this scale to set the cue speed (or force) of the shot.

4.3.3 Spin

The disk at the right of the Controls Window indicates the spin for the next shot. When AIMING, youcan click within the green inset area to set top, bottom, and side spin. Clicking outside the green areais not allowed because of the high possibility of miscuing.

Page 11: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 10

Button Effect Valid

Start frame Rack balls and start a new frame. No frame in progress.

End frame End frame, winner has highest score. Any time.

Pass Pass after being snookered by a foul. Snookered by a foul.

Resign End frame, other player wins. Any time.

View Study position before playing shot. No balls moving.

Aim Set direction, spin, and force parameters. No balls moving.

Shoot Simulate the chosen shot, after aiming. Aiming complete.

Quit Close the program. Any time.

Figure 6: Functions of the buttons at left of the Controls Window. The right column gives the condi-tions in which the button is enabled.

4.3.4 Messages

Messages in the Controls Window describe the state of play. There is one message for each player, andthe striker’s message is high-lighted (displayed in yellow instead of grey). Assume that this message ishighlighted:

Gentle Joe 2 15 24 (87) This shot: pot black with position for red. Last shot: potted red.

This means that Gentle Joe:

is playing,

has won two frames so far,

has 15 points, not including the current break,

has scored 24 points during this break,

has a "reserve" (see below) of 87 points,

is potting the black and hoping for a position on a red, and

potted a red previously to this shot.

In a professional match, Gentle Joe’s score would be displayed as 39 (= 15 + 24). TSS splits the scoreinto two parts: the points previously obtained, and the points obtained during the current break. Thismakes it easy to see how big the current break is.

The number in brackets is the player’s reserve, defined as the margin by which the current playerwould win assuming perfect play (red/black/red/black/ · · · /colours). At the beginning of a frame,each player has a reserve of 147. A player whose reserve is negative must force the other player tofoul in order to win.

For example, suppose there is one red on the table, Bill is playing and has 30 points, and Anne has67 points. Bill can make at most 1 + 7 + 27 = 35 points, giving a total of 65 points. Bill’s reserve is65− 67 = −2 points, indicating that Bill must successfully snooker Anne at least once in order to win.

Page 12: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 11

4.3.5 Instructions

Instructions appear at the bottom centre of the Controls Window. The instruction depends on the stateof the game, and summarizes the state of play and the possible actions.

4.4 Keyboard

Figure 7 summarizes the effects of keystrokes. The F key arrangement may seem strange, but note thatpressing F2, F3, F4, F5, F6, F7, F8, and F9 in sequence corresponds to walking around the table.

General:Start frame sEnd frame eQuit q or ESC

Aim aPass pResign rAim after placing cue ball in dee ENTER

Shoot SPACE

Aiming:Toggle viewpoint (high/low) .Rotate left large zRotate left medium xRotate left small vRotate right small cRotate right medium bRotate right large nIncrease cue speed (shot force) +Decrease cue speed (shot force) −Set spin arrow keys

Miscellaneous:Show player ranks mGet help for current shot hToggle controls window wFull screen mode F

General views:

Baulk end F2Black end F6

Overhead F10Green side:

Baulk area F3Blue F4Reds F5

Yellow side:Baulk area F9Blue F8Reds F7

From green side pockets:Baulk 1Centre 2Black 3

From yellow side pockets:Baulk 6Centre 5Black 4

Figure 7: Summary of key usage

There are a few other keys that you may find useful:

Page 13: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 12

‘m’ displays a list of the autoplayers with their ranks.

‘w’ hides the controls window or, if it is already hidden, restores it. Hiding the controlswindow provides a better view if you are watching automatic players.

‘q’ (or ESC) terminates the program. The DOS Window continues to be displayed withthe message Press any key to continue. Pressing a key terminates the program.

‘F’ sets the display to full screen mode. Unfortunately, this is not reversible: after selectingfull screen mode, you are stuck with it until you terminate the program.

4.5 Mouse

Mouse operations have an effect in some states and are ignored in other states. The states and corre-sponding mouse effects are summarized here:

PLACING (cue ball in dee): move the cue-ball in the dee.

VIEWING: click on a ball to fix it in the middle of the view; hold the left button down and movethe mouse to revolve the table around the chosen ball.

AIMING: hold the left button down and move the mouse to adjust the aim. Left/right movementschange the cue direction; up/down movements change the viewpoint. In assisted modes, thepath of the balls is computed when the button is released.

5 Additional Features and Limitations

5.1 Autoplayer profiles

The performance of each autoplayer is determined by a profile, which is simply a list of numbers.Players with weak profiles, such as Duffer Dave, play like beginners, potting more than two ballsconsecutively only on rare occasions. Players with strong profiles, such as Gentle Joe, are capable ofcentury breaks (and, very occasionally, 147 breaks).

The profiles are defined in a text file that you can edit by: adding new players, deleting players youdon’t like; or modifying profiles. Be careful to respect the format of the file (described below) whenediting, because TSS does not perform any checking.

The name of the file is players.txt and Figure 8 shows an example. Each line of the profile descriptorconsists of:

The name of the autoplayer, consisting of letters (upper or lower case) and blanks.

Ten numbers, separated by blanks. Each number must be one of 0, 1, 2, . . . , 10. These numbersdescribe the playing characteristics of the autoplayer.

The rank of the player. This number is initially 1000. It increases when the player wins a frameand decreases when the player loses a frame.

The highest break that the player has ever achieved.

The first ten numbers are never altered by the program. You can think of them as answers to thequestionnaire shown in Figure 9.

Page 14: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 13

1 Grandma Erica 10 5 7 2 2 4 4 5 7 2 1185 1352 Gentle Joe 10 4 10 10 10 10 0 10 10 10 1166 1333 Gofer Black 7 7 9 7 9 7 10 5 7 8 1148 904 Eccentric Ed 10 10 10 10 10 10 1 1 1 1 1148 755 Grandma Carrie 9 4 3 10 5 5 1 5 10 3 1145 1066 Gill Witch 9 5 6 7 10 1 9 5 3 9 1080 1227 Hardy Potts 10 10 5 10 10 10 10 10 5 10 1064 1418 Careful Kate 8 7 10 10 10 10 5 3 9 10 1041 1159 Sharky Pete 7 10 2 8 10 8 1 2 7 10 941 54

10 Artful Ann 5 4 7 8 5 2 3 10 8 7 923 3911 Grandma Lucy 6 6 5 6 10 0 2 5 9 10 911 5712 Cautious Charlie 3 1 9 10 10 10 5 9 9 10 787 1613 Willy Wacker 3 9 9 2 2 2 2 10 0 4 778 2214 Duffer Dave 1 2 3 1 1 1 0 3 5 3 634 8

Figure 8: Sample file: players.txt

1. I am an accurate potter.

2. I am good at long pots.

3. I prefer straight pots to cuts.

4. I prepare each shot very carefully.

5. I am good at positional play.

6. I am good at defensive play.

7. I go for balls with high scoring value.

8. I break up clusters of balls whenever possible.

9. I prefer gentle shots to strong shots.

10. I give up only when I have no chance of winning.

Figure 9: Questionnaire for autoplayers: estimate the accuracy of each of the following statements,using a number from 0 (very inaccurate) to 10 (very accurate).

The last two numbers are changed by TSS at the end of each frame. If you create a new player, suitablevalues are 1000 for the initial ranking and 0 for the initial highest break. Giving a player a high rank,such as 1500, does not create a better player: the rank will gradually drift towards the appropriatelevel for a player with the given skills.

5.2 Break shots

The autoplayers choose most shots using simple artificial intelligence. They could figure out an initialbreak shot to start a game, using the general strategy for finding "safe" shots (since it is clear thatnothing can be potted). However, most snooker players treat the break shot as a special case (and mayeven practice breaking off) and TSS does the same.

The file breakshots.txt defines the break shots that are used by autoplayers. Each line of the file

Page 15: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 14

describes one shot, as follows:

The first two numbers give the position of the cue ball relative to the centre of the table (bluespot). If the first number is -105 (centimetres), the cue ball is on the baulk line. The secondnumber gives the distance from the centre line of the table, also in centimetres.

The next number gives the direction of the shot, in radians. 0 is straight up the table.

The next two numbers give the top spin and side spin, respectively. Top spin 0.4 corresponds tonatural roll.

The next five numbers describe player characteristics.

When an autoplayer starts a game, TSS chooses a break shot with matching characteristics. The choiceis randomized so that autoplayers do not play the same break shot each time. Moreover, a break shotdoes not have exactly the same effect each time it is played, because of small random variations in thepositions of the reds in the pack.

You can add break shots to the file breakshots.txt. The process is rather tedious because it is notused often enough to deserve a fancy user interface. Here is the procedure for adding new breakshots:

Start TSS and set both players to Full tracking mode.

Press Start frame or ’s’.

Position the cue ball in the dee and press RETURN.

Press Aim or ’a’.

Set the speed, direction, and spin controls for the desired break shot.

Select the Settings window.

Enter five numbers in the box labelled Profile. Each number should have a value from 0 to 10.These numbers correspond to the following characteristics in Figure 8:

1 I am an accurate potter.2 I am good at long pots.4 I prepare each shot very carefully.5 I am good at positional play.9 I prefer gentle shots to strong shots.

Press Store break shot in the Settings Window.

TSS will display a message below the Store break shot button indicating whether the newbreak shot is accepted. If it is, the message is ‘OK’ and a new line is added to breakshots.txt.

You can delete break shots from breakshots.txt using an ordinary text editor, such as NotePad. Besure to delete one or more complete lines, not parts of lines.

5.3 Sound effects

The sound effects that TSS uses are very simple. Sounds are described by four WAV3 files, as shownhere. (Note that, for obscure historical reasons, the file names are not entirely appropriate.)

cuesoft.wav: ball hitting a cushion.3http://en.wikipedia.org/wiki/WAV

Page 16: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 15

-105 -16.1995 0.00504921 189.969 0.4 0.35 9 8 8 9 5-105 -16.1995 -6.24903 247.812 0.4 0.35 9 9 9 9 5-116 -23.2337 0.0523599 250 0.2 0.577778 9 5 9 9 8-113 -19.2875 0.0174533 250 0.577778 0.377778 9 8 9 9 4-126 -14.9679 0 305.312 0.355556 0.155556 5 5 9 9 0-110 21.3001 -0.136659 250 -0.0888889 0.177778 8 5 7 7 0-109 -23.1626 0.0314159 246 0.666667 0.0222222 9 9 7 8 9-115 6.91239 0 222 0.4 0 5 8 3 9 9-132 -10.9124 -0.00523599 438.188 -0.577778 0.266667 9 3 4 9 0-109 22.5839 -0.0420624 298 0.6 -0.25 3 7 8 9 3-105 -22.9082 0.020944 472.25 0.644444 -0.2 2 2 4 2 0-128 0.870449 -0.385718 486 0.4 -0.05 6 6 2 9 2-109 21.9604 -0.0261799 208 0.622222 -0.333333 7 5 9 9 9

Figure 10: Example of a break shot file (breakshots.txt).

cuehard.wav: cue hitting a ball.

impact.wav: ball hitting another ball.

pocket.wav: ball falling into a pocket.

TSS modifies the volume of a sound according to the strength of the shot. You can replace these fileswith your own recordings if you wish to improve the sound effects.

5.4 Textures

TSS expects to find two Windows BMP files: tableTexture.bmp and cueTexture.bmp. These filesdefine the surface patterns for the wood parts of the table and the cue respectively. You can changethe textures by replacing these files. TSS will accept a texture if the file is a Windows .bmp file;4 andthe width and height of the image are both powers of two.

For example, a BMP file wih 512× 128 (= 29× 27) pixels is acceptable, but one with 500× 125 pixelsis not. You can use a graphics utility such as IrfanView5 to resize a texture map.

The file textures.zip contains several suitable textures and can be downloaded from the TSS web-site.6

5.5 Limitations

TSS assumes that all shots are played with a horizontal cue. It does not prevent the cue from passingthrough balls (other than the cue-ball) and the sides of the table. Also, massé shots cannot be played.

These restrictions could be removed piece by piece. However, it seems preferable to aim for a majorupdate that would:

4http://en.wikipedia.org/wiki/BMP_file_format5http://www.irfanview.com/6http://users.encs.concordia.ca/~grogono/Snooker/snooker.html

Page 17: Contentsgrogono/Snooker/manual.pdf · The Snooker Simulation 2 Size File name Size File name 3,262 tss.ico 393,270 tableTexture.bmp 112,435 manual.pdf 196,662 clothTexture.bmp 1,597,510

The Snooker Simulation 16

allow the butt end of the cue to be raised, allowing swerve shots, jump shots,7 massé shots, andshots with the cue-ball close to the cushion or another ball;

disallow shots that require the cue to pass through the cushion or another ball;

extend the graphics to display a raised cue and show "flying balls";

extend the controls to manipulate a raised cue;

extend the dynamics to model balls that fly, collide in mid-air, hit cushions at various heights,and fly off the table.

7Jump shots are allowed in snooker, provided they are not used to avoid a snooker by jumping over a snookering ball.