Open canonet28 opened 4 years ago
It runs ball-by-ball, each ball has probabilities for certain things to happen, and then random numbers decide what actually happens.
Feel free to ask any questions! This all started as a project to take me past the basics of python, and then it got out of hand.
That's awesome and opens up so many possibilities. If it is ball-by-ball, down the line we could add some sort of commentary file (on top of the current scorecards, which are more of a highlight of the main events) with commentary lines on each ball bowled based on the outcome of that ball. Make use of a set of 10-15 (or more) variations of commentary lines for each event, and randomly use one for every instance of that event. I have seen that being done with a lot of soccer simulators and will make it much richer.
Yeah, that's something I've definitely thought about. A very simple commentary file would be straightforward to make, along the lines of:
0.1 SCJ Broad to DA Warner: 0 runs. 0.2 SCJ Broad to DA Warner: WICKET 0.3 SCJ Broad to SPD Smith: 1 run. ... and then a summary at the end of the over.
Honestly, the only reason I haven't done it yet is that I'm not sure who would actually want to ever read through it - reading a Test match ball-by-ball would probably be tedious. Maybe it would be fun to skim through, though, or check out what had happened at the end of a close game.
I think that doing a more complex version of a commentary file, like the one you've suggested is possible, but probably actually more difficult than it sounds. For example, you can't just write 20 different ways that a ball could end up being a four and then randomly pick one, without making all the lines relatively generic. What if you randomly pick a line about a sweep, but the bowler is a fast bowler?
It is definitely something that it would be fun to have in the sim, though.
Yeah. I hear you. Not so straightforward that, it will definitely need more logic it seems even to pick those commentary lines randomly.
Anyways, that simple commentary file you gave a sample of will be a good addition and a good place to start. This should be in addition to the scorecard we currently have, and for most, the current scorecards will be all they look at. But you never know who might be poring over those ball-by-balls of a close (or even not-so-close) Test match, and develop their own context, imagination and insight into what happened and what could have happened!! Stuff fantasies are made of!! It will be a good option to have in the simulator.
I am a big fan of this programme Jamiee999 - stumbled across it a few weeks ago and absolutely love it. I would also love the ability to see the ball by ball results - even if not attached to particularly interesting commentary.
So not much of a coding person myself, even though I have just enrolled myself in a python tutorial so that I can make more sense of cricketpy. :)
Anyway, does Cricketpy resolve the match ball-by-ball, or does that in chunks of main events?