suragnair / alpha-zero-general

A clean implementation based on AlphaZero for any game in any framework + tutorial + Othello/Gobang/TicTacToe/Connect4 and more
MIT License
3.82k stars 1.02k forks source link

Adoption for single player game #247

Open vsahil opened 3 years ago

vsahil commented 3 years ago

Any suggestions for changing the code such that we can adopt it for single player game in which the rules are available and the goal is to get the highest score? For example, snake eating egg game and growing to the largest length possible.

JohnPPP commented 3 years ago

Working on this as well and would like to see if I'm going on the right track.

Changing Coach, Pit and Arena. Making necessary adjustments on "Game" and "Logic". I'm keeping as much as I can, such has getsymetrical just returning the board.

On Arena and Pit, making the average score of each set of games. The best one carries over on checkpoint.

iSams123 commented 3 years ago

Hello I'm trying to adapt the code for the single-player game like 2048 but it seems that I got RecursionError often and if I set sys.sys.setrecursionlimit(...). The program may crash if the episodeStep is too large

davidedelvento commented 7 months ago

Has anybody succeeded with this?

puyuan1996 commented 5 months ago

Hello I'm trying to adapt the code for the single-player game like 2048 but it seems that I got RecursionError often and if I set sys.sys.setrecursionlimit(...). The program may crash if the episodeStep is too large

Hello, thank you to the contributors for their outstanding work on this repository. Regarding the issue you've raised, you might be interested in the project "LightZero: A Unified Benchmark for Monte Carlo Tree Search in General Sequential Decision Scenarios". This repository not only supports the AlphaZero algorithm but also extends support to MuZero and a series of related algorithms and environments (including 2048), which might meet your requirements. Best wishes.