Has anyone created a Polyglot opening book of the first "x" random moves? It's relatively simple to do — just do a perft for "x" depth and add each position to the opening book. Just wondered if it's already been done.
Steve
Polyglot Opening Book of Random Moves?
Moderator: Ras
-
- Posts: 1273
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Polyglot Opening Book of Random Moves?
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 396
- Joined: Sat Feb 04, 2017 11:57 pm
- Location: USA
Re: Polyglot Opening Book of Random Moves?
That would created a very large book with very little depth. After the first 3 full moves there are almost 120,000,000 positions. doesn't seem it would gain you very much.
If you are developing your own engine, you could add a command to play random moves for the next X numbers of plies.
If you are developing your own engine, you could add a command to play random moves for the next X numbers of plies.
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
-
- Posts: 1273
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Polyglot Opening Book of Random Moves?
The use-case is to create a large number of games with a huge variety of positions that will be used to train a neural network.
Steve
Steve
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Polyglot Opening Book of Random Moves?
Why do this through a book? Just let the engine pick the first N moves randomly. In Fairy-Max I add a random value to the score in the root for the first N moves to create diversity. But there I limited it to 50cP, so that it would not blunder away material because of it. But if you would make it asymptotically large, you would get pure random play.
-
- Posts: 4624
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Polyglot Opening Book of Random Moves?
If all you want are labelled positions you could write a self-play with random book for any UCI engine in Python in about 20 lines of code.Steve Maughan wrote: ↑Thu Feb 09, 2023 6:35 pm The use-case is to create a large number of games with a huge variety of positions that will be used to train a neural network.
Steve
-
- Posts: 1273
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Polyglot Opening Book of Random Moves?
Hi Chris — that looks like the best option. Python Chess looks excellent.
— Steve
— Steve
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 1273
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Polyglot Opening Book of Random Moves?
Hi H.G. — that'll work for Maverick but what about the other side?hgm wrote: ↑Thu Feb 09, 2023 10:44 pm Why do this through a book? Just let the engine pick the first N moves randomly. In Fairy-Max I add a random value to the score in the root for the first N moves to create diversity. But there I limited it to 50cP, so that it would not blunder away material because of it. But if you would make it asymptotically large, you would get pure random play.
— Steve
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 253
- Joined: Mon Aug 26, 2019 4:34 pm
- Location: Clearwater, Florida USA
- Full name: JoAnn Peeler
Re: Polyglot Opening Book of Random Moves?
So, you are not doing self-play to generate your positions? If so, then random move scores in the engine seems like the way to go. If you are wanting to use another engine that you don't control the source to then I better understand your dilemma. However, I don't know enough to say whether that's necessary or not.Steve Maughan wrote: ↑Fri Feb 10, 2023 9:36 pmHi H.G. — that'll work for Maverick but what about the other side?hgm wrote: ↑Thu Feb 09, 2023 10:44 pm Why do this through a book? Just let the engine pick the first N moves randomly. In Fairy-Max I add a random value to the score in the root for the first N moves to create diversity. But there I limited it to 50cP, so that it would not blunder away material because of it. But if you would make it asymptotically large, you would get pure random play.
— Steve
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Polyglot Opening Book of Random Moves?
Well, there isn't any need to program anything yourself for this. You can just use an engine like Brutus Random to play a zillion games, and convert the resulting PGN to a pook using Polyglot.Steve Maughan wrote: ↑Fri Feb 10, 2023 9:35 pm Hi Chris — that looks like the best option. Python Chess looks excellent.
— Steve
-
- Posts: 4624
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Polyglot Opening Book of Random Moves?
Well, there isn’t any need to go downloading external stuff, working out how to get it to work, clogging up your HD with humungous PGN data and humungous book binaries for this. Just use Python, keep the whole thing under your own control (like add filters in the future if desired), generate depth programmable random moves on the fly and dump the resulting data as PGN or EPD.hgm wrote: ↑Sat Feb 11, 2023 11:01 amWell, there isn't any need to program anything yourself for this. You can just use an engine like Brutus Random to play a zillion games, and convert the resulting PGN to a pook using Polyglot.Steve Maughan wrote: ↑Fri Feb 10, 2023 9:35 pm Hi Chris — that looks like the best option. Python Chess looks excellent.
— Steve