Re: gtali computer play enhancements



On Sat, 27 Jan 2007, Geoff Buchan wrote:
I've been tinkering with some enhancements for computer play for gtali. So
far I've implemented two things:
1. A command line argument, -c or --computer-test, which accepts an integer,
and the program then runs that many games played only by the computer, and
without the GUI. It outputs the score of each game to stdout, and then an
overall average.
2. A different algorithm for determining what the computer will roll. Rather
than relying on the "value" calculated in the present program, my new
algorithm does a Monte Carlo simulation of each possible dice roll
combination, and it then takes the combination that would result in the
highest average score after 1000 rolls for each possible combination.

This does appear to improve computer play a fair amount. I estimate the
average score for the computer goes up about 20 points in regular mode, and
25 points in colors mode, with the new algorithm, but the new algorithm is
more CPU intensive: running 100 "games" takes about a minute on my
single-CPU 1.2 GHz laptop, whereas 100 "games" with the old algorithm takes
about a second.

It seems to me the best thing would likely be simply to improve computer
play "quietly" - that is without changing the UI at all, but if we wanted
to, we could either:
1. Simply retain the old computer play algorithm
2. Create a preference to allow users to decide between the older or newer
play, and potentially also to control the number of trials in the Monte
Carlo simulation (more trials is slower, but up to a point should improve
play somewhat).

What do you think would make the most sense ? I'd be happy to enter an
enhancement request and patch for any of these possibilities. If you think
someone else might be interested in this topic, please forward this message
to him/her.

Hi! It would be interesting to try the new algorithm you propose for gtali. Please submit it to bugzilla. Then the patch can be applied to SVN during the 2.19.x development cycle.

 - Andreas



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]