Denis Shine's One Day Cricket Simulator v 1.1 Readme. Hi, welcome to Denis Shine's One Day Cricket Simulator. This game plays out a One Day International using teams of your choice. This game takes your favorite players and their One Day statistics and plays out a One Day Match between two teams of 11. It simulates accelerated scoring in the last 20 or so overs of an innings, as well as the increased chance of getting out during the 'slog'. There are also other features, including pitch conditions and over graphs. First, I will explain how to get into the game quickly and easily, then I will go through a few technical points, such as making your own teams and I'll also explain some of the algorithms that make the game go, in case someone out there thinks of something better than I have. QUICK START This game does not seem to run without Windows 9x, despite it being DOS-based. To run it, either double-click on the program in explorer, run a dos-box, go to the directory the game is in, then type 'cricv11' or use the run command from the start button. In order for this game to run, you need the accompanying players.dat file, which was included in the zip file you downloaded. Without it, the game will not run. If the game can read the file ok (just leave the default players.dat for now) it will tell you how many teams it read and then ask you to select one. Pick a team by typing the number next to it. It will then ask you for a second team. Repeat the process. You are allowed to play a team against itself, it works fine. The game will now ask if you want manual or automatic bowling. With manual bowling, you will be asked to play a bowler by picking the number next to his name (which is the bowlers number in the team line up). You can't bowl a bowler more than 10 overs, and can't bowl someone not designated a bowler. Just before the game starts you will be told what the pitch is like. This simply determines how fast the teams will score. If you choose automatic bowling, the Simulator will do it all for you, and all you have to do is hit enter to bowl the overs. What an immersive game, I'm gonna flog this off to EA... After the game is over, you will get a little interface asking you what you want to do. By choosing the appropriate number, you can view the 1st innings scorecard, the 2nd innings scorecard, and the FOW & Partnership info, Over Graphs, or quit. PLAYERS.DAT Lets now look at players.dat. players.dat lists teams and their players, along with some stats. Lets take Australia for an example. Australia Mark Waugh 3 39.2 76.2 33.0 79.3 6 Adam Gilchrist 4 33.9 86.8 0.0 0.0 0 .... First comes the team name. At the moment team names have to be one continuous word, ie instead of Sri Lanka I have Sri-Lanka. Yes, I'm too lazy to change one line of code. Sue me. Then comes the 11 players on the team. For each player, there are 8 entries, each separated by a space. First Name - Player's First Name Last name - Player's Last Name ** No middle names allowed, you cannot have 3 words. ie Instead of Aravinda de Silva I have put Aravinda de-Silva. Player Type - There are 4 player types. 1 - Batsman, doesn't bowl. 2 - Fast bowler, stumping cannot occur. 3 - Slow bowler, can get stumpings. ** There is no real difference between 2 & 3, just that when the computer decides how you are out, with Fast Bowlers it won't accept stumpings if they are randomly chosen by the HowOut procedure I have. 4 - WicketKeeper. I haven't done much error checking with the keeper, please put one in a team, more than one doesn't matter, it will either pick the first or last keeper (can't remember). I have no idea what will happen if there is no keeper. Most likely when caught behind occurs it will type c b Bowler. Batting Average - Batsman's average, in REAL data format so always place a decimal place, ie 27.0 NOT 27. Batting Strike Rate - Batsman's Strike Rate in runs / 100 balls, again in REAL data format. Bowling Average - This players bowling average, in REAL data format. If the player won't be bowling (batsman, wicketkeeper), you must still put a number. (I've put 0.0 for all these) Bowling Economy Rate - In runs / 100 balls, NOT runs / over. In REAL data format. When the Bowler bowls - This places the bowlers position in the bowling line up. Place bowlers in order from best to worst. Please keep this unique, and keep it sequenced, ie no gaps in the sequence, I haven't error checked this much at all yet. Also, don't play more than 7 bowlers, or the list will cut off the top of the batting card. Example of all that crap: Mark Waugh: is a slow bowler (Player Type 3), has a 39.2 batting average, 76.2 batting strike rate, a 33.0 bowling average, and a 79.3 bowling economy rate. He comes on to bowl at number 6. Get all that? No? Aww well. FREE PLUG Play Subspace! Most computer games are stupid, but Subspace is amazing! Compete with hundreds of people from around the world in this fast paced game.. and better yet, it's free! Go to www.subspacehq.com to find out about it! Go the Bulls, and Australia of course! WHERE TO CONTACT ME I am on ICQ, my # is 5598113. email me at dantos@imtoosexy.com CERTIFICATE OF DODGINESS WARNING: I am not a programmer! This simulator/game was done in Modula-2, a fairly simplistic language than I'm not very good at anyway. This program shouldn't do anything bad to your computer (it hasn't to mine), and being a run in a DOS-box Windows should have control over it, but I make no guarantees! Also, if you're sitting there saying "this program is crappy, I can do better" then go out and write the thing! LEGAL JARGON In no way shall Denis Shine be liable for any damage done to the computer this program is run on or the person that runs it. I take no responsibility for any illegal acts this program may be involved in, so if it robs your local ATM, it isn't my fault! ALGORITHMS Here are a few things I thought I would like to add. If you have a better algorithm than the one I have send it to me! Don't read this if you aren't good at maths :) This algorithm decides if the player is out. I found it very difficult to get a decent algorithm for this, and tried several before settling on this weird one. The algorithm goes like this: For each ball, this is worked out: I decided that the borderline between a "good" bowler and a "not-so-good" bowler is an average of 28. If a bowler has an average of less than 28, then for every 1 run below 28 his average is, the batsman's average is reduced by 3%. Conversely, if a bowler has an average above 28, the batsman's average is increased by 3% for each 1 run above 28. Then the algorithm decides, at that instant, how many balls the batsman is expected to last, given his modified average worked out above, his strike rate and the bowler's economy rate. The batsman's strike rate and the bowlers economy rate are averaged, then that number is divided by 100 to give a runs/ball number. The modified average is then divided by this to give a value, which I call the Expected Balls Faced (EBF). This is how many balls the batsman is expected to last, at that instant, given the bowler he is facing. I then invert this number (1/EBF) to give a small number, which is usually around 0.02 - 0.04, depending on how good the batsman and bowler is. A random number between 0 and 1 is then chosen, if the random number is below this small number, the batsman is out. I think this algorithm is fair to both the batsman and bowler. If you have a better one, email me. This is the autobowling algorithm I have. This is a little less complex than the one I just talked about.. I gave the computer a set bowling order, which I have put here: {1,2,1,2,1,2,1,2,1,2, 3,2,3,2,3,4,5,4,5,4, 5,4,5,4,5,1,5,1,5,4, 3,4,3,4,3,5,3,5,3,5, 3,4,3,4,1,2,1,2,1,2} For each over, the number in this array chooses the next bowler. ie the first over is bowled by bowler number 1, the second by number 2, third by number 1, etc. However, if a bowler takes a bit of a beating, the computer will replace him with one of the part timers. If a bowler has bowled 6 overs or more, and has taken more than 5.5 runs/over during those overs, the computer picks the next available part timer to replace him. If no part timer is available the computer is forced to use the bowler who has taken the punishment. I ripped this algorithm from the CricInfo Java game that has now disappeared. Thanks, or whatever. VERSION HISTORY v 1.2 – The algorithm determining whether someone is out was out of whack, too bowler friendly. Fixed. - Added over graphs. v 1.1 - Added pitch conditions - Changed percentages of shots played by batsmen, they now hit more singles, less fours and sixes