Cool game though. I am still puzzled by how the probabilities are arrived at. Random?
Probabilities are mostly randomized during board generation but skewed in a way to make gameplay feel a bit better. There's a cap on the likelihood of the neutral event, and a bias towards the good event rather than a bad one.
Is this actually simulating a d20 with physics?
Also, in your listing of your ai beating the random, how are you counting drawn games?
If there are 65% and 50% to complete a row in one direction, and a 35% and 20% in another direction, you don't really need AI to tell you which one would be more advantageous to go after?
var neutralChances = Random.Range(1, MaxNeutralChances + 1);
square.GoodChances = Random.Range(MinGoodChances, 20 - neutralChances);
square.BadChances = 20 - (square.GoodChances + neutralChances);
MaxNeutralChances and MinGoodChances are both set to 6 in the release build. Note that one chance is equal to one face of the die, so 5%. Also, this overload of Random.Range() has an inclusive min value but an exclusive max value.I guess I didn't include ties in that little blurb I wrote up, but the real results of my 10k trials were around 5:1:11.5 (lose:tie:win) for the AI vs random actor.
Would love to see your AI when it's done! Please shoot me an email if you want. My email is in my profile / in the site footer.
Myself, I am trying to create lightweight 3D code to sit on top of Canvas and HTML5. That may be why I was sensitive to the "overkill", ha ha.
To be specific, you could probably even leave the roll time as-is, to give you that suspense, but the time it takes to move the die to the center, flash it, and flash the result, is too long and gets irritating.
1x is right at first, but 2x is really fast.
Or to turn this into a different game: the d20 stops fast by default, but extra click to cheat and keep it rolling if you feel that it's about to stop on an unfavorable face.