BL2 Bot Player

Discuss about Blockout II from Jean-Luc, post your feature requests etc.
Post Reply
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

One comment: The plot above is not a fit, in the sense that I did not optimise the parameter cc. The cc was calculated using excel. The fit would be better for higher number of tests and a higher value instead of 25000.<br><br>Post edited by: Lieven, at: 2008/02/09 10:53
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

Ok, Cleaned up the excel sheet, attached. Sorry for spamming the forum. Feel free to merge these three posts [file name=poisson-ac480908ff0c37c4b866f37cd79030f0.7z size=64352]http://www.blockout.net/components/com_ ... 79030f0.7z[/file]
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Hi,

Thank you very much for the model :) I\'m going to have a look
at this stuff more in depth. I\'ll try to code this in C++ which
should be a bit faster.

Ok, Cleaned up the excel sheet, attached. Sorry for spamming the forum. Feel free to merge these three posts

Where is there some spam ? All your interventions are of a very
good quality ;)

a part les vérifier toutes pour chaque block et de les stocker
je ne vois pas de méthode globale
c\'est complexe comme problème !
Sur les 41, combien de pièces ont 24 orientations différentes ?


OK Thanks for your answer, I was just wondering if it exists
a simple method which allows, when you know the number of
planar symmetry, to deduce the number of transform (with det=1)
that conserve the shape and the orientation of the block.

I think that all chiral blocks has the 24 orientations so
it is already much. I think that for Flat Fun the algo can
be greatly boosted, but for OOC (even 3DMania?) I don\'t know
if we can greatly improve the stuff. (definitely a speed
up ratio lower than 2).<br><br>Post edited by: jlp_38, at: 2008/02/09 13:21
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Unfortunately i don\'t have excel at home :blush:
I\'m downloading it. ~8h00 of download remaining :(

Lieven: Could you explain me a bit better how do you
fit the Gaussian curve to the experimental data ? Do you
use it to estimate the value of cc ? What is the error
on cc after n tries ?

Anyway, I\'m still investigating on the symmetry problem.
Not much on this (for polycube) on the web...
May be the algo can be boosted up more than i thought.
I\'m wondering if it exits a polycube (up to nbCude=5)
that don\'t have symmetry.
All seem to have a least one planar symmetry or a
central symmetry, so the \"transform group order\" of each
block should be >=2. Am i wrong ?
So with the 41 polycubes, i think that 12 orientation
should be enough but it\'s just a supposition...

http://en.wikipedia.org/wiki/Octahedral_symmetry
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

I made a brute force algo to check invariant transform.
If my code is correct (I\'m not sure), here is the result:
(So my first supposition seems to be wrong)

Image => 1 orientations
Image => 3 orientations
Image => 3 orientations
Image => 3 orientations
Image => 3 orientations
Image => 12 orientations
Image => 3 orientations
Image => 12 orientations
Image => 12 orientations
Image => 24 orientations
Image => 12 orientations
Image => 12 orientations
Image => 24 orientations
Image => 12 orientations
Image => 12 orientations
Image => 24 orientations
Image => 24 orientations
Image => 12 orientations
Image => 24 orientations
Image => 24 orientations
Image => 3 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 12 orientations
Image => 12 orientations
Image => 12 orientations
Image => 12 orientations
Image => 12 orientations
Image => 12 orientations
Image => 8 orientations
Image => 12 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations
Image => 24 orientations<br><br>Post edited by: jlp_38, at: 2008/02/09 20:17
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

If the above are correct, here is the speed up ratio
we can expect for all mode:
Flat => 2.74286
Basic => 1.82609
Extended => 1.53991<br><br>Post edited by: jlp_38, at: 2008/02/09 22:28
Lieven
Posts: 55
Joined: Sun Aug 05, 2007 6:31 am

Re:BL2 Bot Player

Post by Lieven »

I will post here the details, so there is no reason to install excel.

From my first post on this: The cc number is simply the number of average restarts, total number of runs/total of restarts. in the example cc=20000/854=23.41. Therefore, this can be straightforwardly calculated.

So there is absolutely no fitting going on! The fact that the plotted curve matches the experimental curve so well, is good evidence that the model works.

Total restarts, N=854
sqrt(N)=29.2232

Then 68 confidence interval is in N+/-sqrt(N)
or in between 824.7767216 and 883.2232784 total restarts

Converting this back in the average number of restarts we get a cc value in between 22.6443307 and 24.248987.

or thus an average number of blocks between
25000/22.644=1030.970902 and 25000/24.248987=1104.029098

Other confidence intervals might be harder to calculate. Haven\'t look deep into it.

Hope I didn\'t make any mistakes here, it is late :)
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Thanks, now I understand better :)
I was just curious to see the distribution. I plotted it
without \"histogram binning\". Strange distribution near 0 ?
Did you get similar results ?

Avg=1076.08 Min=20 Max=13438 nbGame=100000

Image<br><br>Post edited by: jlp_38, at: 2008/02/10 01:47
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Hi,

I\'m going to work a bit on the optimization.
I\'ll code the TransformCube() and fround() function
in SSE and add the symmetry optimization.
I plan to get a factor ~2 on OOC.

Image

I\'ll post the code ASAP on sf.net
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

I was wondering if the strange distribution around zero
was linked the number of couple (x,y) solution to 3*x + 4*y = n.
Only 3 or 4cube block in 3DMania. However the red curve should
be corrected as there is only 1 \'3cube\' block and 6 \'4cube\' blocks.

Image<br><br>Post edited by: jlp_38, at: 2008/02/10 19:42
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

OK, I uploaded the new code to sf. I added the symmetry
optimization. I didn\'t have a look at the AI playing
but it should be a bit nicer than before (Nicest
rotation).
The AITester is ~2.3 times faster in 3x3x6 BASIC,so a little
bit more than expected :)
(I also made small memory access optimizations)

I added a file BotPlayerAI.cpp where i concentrated all concerning
the evaluations and a file BlockOrientation.h.

Let me know if you get problems.
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Some notes, I remarked a bug. The demo cheats a bit ;)
One collision was not detected at the top of tip
and in some cases the demo can win few blocks.
I didn\'t make long test, but the avg seems to be affected
of ~ -5% in 3x3x6 BASIC.

Sorry for that :S

If you want to re-enable the bug, you can make the
following change:
BotPlayer.cpp:376
validMove = IsValidPos();
by
validMove = TRUE;<br><br>Post edited by: jlp_38, at: 2008/02/10 23:57
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Hi,

I might found out a new OOC secret ;)

[ 81] Cube=26802 Avg=23211.1
[ 82] Cube=4372 Avg=22984.2
[ 83] Cube=1374 Avg=22726.9
[ 84] Cube=5888 Avg=22528.8
[ 85] Cube=141915 Avg=23917
[ 86] Cube=38428 Avg=24083.8
[ 87] Cube=6309 Avg=23881.8
[ 88] Cube=8227 Avg=23705.9
[ 89] Cube=8125 Avg=23532.8
[ 90] Cube=20897 Avg=23503.8
[ 91] Cube=19851 Avg=23464.1
[ 92] Cube=17382 Avg=23398.7
[ 93] Cube=25976 Avg=23426.1
[ 94] Cube=9773 Avg=23282.4
[ 95] Cube=10432 Avg=23148.6
[ 96] Cube=33837 Avg=23258.8
[ 97] Cube=8405 Avg=23107.2
[ 98] Cube=3135 Avg=22905.5
[ 99] Cube=4212 Avg=22718.5
[100] Cube=44773 Avg=22936.9
jlp_38
Posts: 264
Joined: Tue Jun 26, 2007 9:09 am

Re:BL2 Bot Player

Post by jlp_38 »

Avg=20672.9 Min=346 Max=141915 nbGame=1000
114min 34sec, 3007.56 cps

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

Re:BL2 Bot Player

Post by Lieven »

Simply impressive!

How does it do on 3x3x6 and 3x3x18? I am curious what the maximum nr of blocks you get out of say 1000 runs. Will be interesting to compare this to the best human scores, around 400 and around 900 blocks respectively.
Post Reply