BL2 Bot Player

Discuss about Blockout II from Jean-Luc, post your feature requests etc.
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Result of your eval 1000000 blocks.
Looks very similar ???
Limit of rows 4 seems ~0.12

Code: Select all

        -D       0      +D     Hits
 0 => 0.00000 0.00000 1.00000 (4765)
 1 => 0.01654 0.29241 0.69105 (225519)
 2 => 0.31462 0.47161 0.21377 (481310)
 3 => 0.51521 0.36794 0.11685 (233865)
 4 => 0.52310 0.35868 0.11822 (65423)
 5 => 0.51979 0.36084 0.11937 (18296)
 6 => 0.50666 0.36410 0.12924 (5331)
 7 => 0.49940 0.36990 0.13070 (1668)
 8 => 0.47826 0.37996 0.14178 (529)
 9 => 0.46667 0.37949 0.15385 (195)
10 => 0.38298 0.42553 0.19149 (94)
11 => 0.45098 0.39216 0.15686 (51)
12 => 0.42308 0.46154 0.11538 (26)
13 => 1.00000 0.00000 0.00000 (6)
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

That is very strange indeed. Furthermore, the sum of the first three lines is 711594, which is higher than the new eval. So my original eval spends more time on the lower depths, yet it does worse? Strange.<br><br>Post edited by: Lieven, at: 2008/02/17 19:37
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

I\'m wondering if it is a good idea to consider low row.
Due to the edge strategy, it can choose to place a block
\"against the wall\" which will raise the depth. I know
that your eval also use this strategy, but the new
smoothness and commonEdge tuning might accentuate this.
So these params might be evaluation dependent.
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

I made a test on 10 million blocks and result are not really
convincing. Results for both eval are comparable. The only thing
I can tell is that with the original Lieven\'s eval, I had to make
3 games before reaching 10 million blocks and only 1 test with the
new eval. I think to get proper results with this method, we
should make test on at least 100 million (even 1 billion)
blocks.
PS: 10 million blocks take ~40min on a Dual Core AMD 2218.

Image
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

I uploaded a new source to sf. I simplified a bit the AI code so
it should be a bit easier to understand and to modify.
You can define the symbol DEPTH_STATS in the page
(Properties->C++->Preprocessor). It will create a file fDepth.txt
in the working directory containing the stats you ask.

I also removed the strong dependence between the line and pit
coefficients (It was also the case in your eval).
Now all parameters should be almost independent from others.
(Maybe, it still persists a dependence between the commonEdge and
smoothness coefficients). I still have to make them independant
from the pit volume/area.

Let me know if you find out some issues.
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

Ok this is quite convincing. The method doesn\'t work. I do apologise for all the time you spend on this flawed idea! Thank you so much for trying anyway.

Now you might wonder why I haven\'t tried to fit the Poisson as you suggested. The reason is that the Poisson has only 1 parameter, and the best fit of that parameter is calculated exactly via the average we are after!

It is pretty cool you seem to have endless play on 3x3x18!

I don\'t know whether this is any faster, but instead of the average you can try to count the % of games that end in less than 500 blocks.
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Ok this is quite convincing. The method doesn\'t work. I do apologise for all the time you spend on this flawed idea! Thank you so much for trying anyway.

Thank you, for your ideas :) I prefere 100 times to try something
that does not work as we expect rather than trying nothing.

Now you might wonder why I haven\'t tried to fit the Poisson as you suggested. The reason is that the Poisson has only 1 parameter, and the best fit of that parameter is calculated exactly via the average we are after!

Don\'t try this, that does not work. I didn\'t manage to fit to
a Poisson distrib. The best fit i found is a gamma distrib with
k=~1.5 and theta=~60.0 (If i remenber) but even this does not
work very well. the distrib around 0 is unknown !

don\'t know whether this is any faster, but instead of the average you can try to count the % of games that end in less than 500 blocks.

Will try this....

Thanks again for your ideas....
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

As we reach a new page on this post :s_wink: you might missed
my last message concerning the new source. If you haven\'t
read it, just go to the previous page, last message.<br><br>Post edited by: jlp_38, at: 2008/02/18 21:42
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Hi,

I tried a lit bit more the gamma fitting. I\'m still not really convinced. May a fitting by the high value can be accurate ?
But as usual there is a problem, the calculation of the lower
incomplete gamma func is slow so the fitting might take
much time and bring nothing more.... Nevertheless, It can be
interesting if the k value stay roughly constant.

Here are some results: Around 0, fitting does not work very well...

Image
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

Just a quick comment.

The tale of the distribution (not the start) definitely follows an exponential decay, as I pointed out in an earlier post.

The Poisson distribution does work, but you need to reformulate it as a problem of \"how many restarts for X number of blocks\". Also not very advantageous as only 1 parameter.. the average.

There is always Labfit

http://zeus.df.ufcg.edu.br/labfit/

which finds automatically \"the best fit\" out of 100s of functions, upto 4 parameters. The program isn\'t very user friendly, so here is a quick manaul:
1. File->import data set->select paste and past two columns..->just press ok and save as a random file
2. Curve fit -> fit function finder, this looks for the best functions automatically, choose nr of parameters, and click ok,
remember (or write down) the function numbers
3. Fit functions of the library, now choose the number you previously wrote down.

The program also allows for user defined functions


But more and more I am getting convinced the plain average is the best way to compare bots...
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Hi Lieven,

The tale of the distribution (not the start) definitely follows an exponential decay, as I pointed out in an earlier post.


The fit with the gamma distribution seems to work well (at least
for large value). I\'m not really sure that it is exactly an
exponential decay but may be I\'m wrong.

The Poisson distribution does work, but you need to reformulate it as a problem of \"how many restarts for X number of blocks\". Also not very advantageous as only 1 parameter.. the average.


OK, I think I will have a look at this tomorrow if I find
time. The only thing that make me septic is that you have to
choose the number X and if this number has to be large,
It won\'t help a lot.

But more and more I am getting convinced the plain average is the best way to compare bots...

I totally agree. The final test will be an average test in any
cases. I was just wondering if we can get quickly a reliable estimation of the average for parameters tuning. If we didn\'t
manage to find something good, I think that I will load thoroughly few CPU during few nights ;)

Anyway, thanks for the labfit info ;) I didn\'t know that program.

Image
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Cool, I\'ve reached the 1600 point ;)

3x3x6 BASIC
Avg=1618.75 Min=39(16159869) Max=11967 nbGame=5000
11min 12sec, 12044.3 cps

Improvements are still possible...<br><br>Post edited by: jlp_38, at: 2008/02/20 23:39
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Improvement of smoothness was fruitful :s_wink:

Avg=1771.13 Min=36(402895073) Max=14527 nbGame=5000
5min 10sec, 28597.3 cps
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

After last parameters tuning, I finally reached 1800. I really
believe that the limit average is around 1800. (I made
other tests). I think that now it starts to be difficult
to optimize the evaluation function. If you have new ideas,
they are welcome ;)

Code: Select all

  // Stats:  Avg=1806.48 Min=32(895887283) Max=16532 nbGame=10000
  // 3x3x6 BASIC:
  float linesNote     =  0.7f   * nbLines;       // Line (layer)
  float pitNote       =  0.25f  * pitBonus;      // Edge,corner,distance,death zone
  float smooth2Note   = -0.28f  * Smoothness2(); // Pit surface smoothness (sqr)
  float commonNote    =  7.0f   * commonEdge;    // Puzzle solver
  float nbHoleNote    = -1.1f   * GetNbHole();   // Hole
  float peakNote      = -0.81f  * Peakness();    // Pit surface \"peakness\" (peak detection)
pitNote details:
edgeCoef = 0.8
cornerCoef = 2.8

I upload the code on sf ASAP.
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

OK the last parameters fine tunning bring ~30/40 cubes.
The following scan is interesting, it shows that after
10000 games you still have a possible error of ~ +/- 50
cubes on the average.
However, the following method can be interesting to
get a best approximation of the avg. By \"parameters
detuning\" we may be able to get a really good approximation
of the avg limit. Still need some works to clarify....

I\'m going to upload the source on sf.net.

Image
Post Reply