nneonneo / 2048-ai

AI for the 2048 game
MIT License
1.09k stars 279 forks source link

4D 2048 AI? #4

Closed f000bar closed 10 years ago

f000bar commented 10 years ago

This is amazing, thanks! Do you have any interest in modifying it/making a version that could do the 4D version? http://huonw.github.io/2048-4D/? I'd try it myself, but my coding abilities are extremely limited.

nneonneo commented 10 years ago

Well, it may be a fun little challenge to cut your teeth on! Basically, you have to modify the code to support the eight different moves, and update the heuristics appropriately so they work for the 4D case (though I imagine an AI with only the free-space heuristic will still work pretty well for the 4D game).

It sounds daunting, but it will certainly improve your coding skills to try!

f000bar commented 10 years ago

Sure, but there are also a lot of other issues, like the bit manipulation stuff, and getting the python script it to read the board from the page. I might give it a try, but can't get to it for a bit, and figured you'd have a much easier time of it if you had the inclination - not to mention the ability to make a better heuristic.

f000bar commented 10 years ago

I'm guessing this is a 'no', then? :(

nneonneo commented 10 years ago

I don't think I will be able to get to this anytime soon. On Apr 3, 2014 2:55 PM, "f000bar" notifications@github.com wrote:

I'm guessing this is a 'no', then? :(

— Reply to this email directly or view it on GitHubhttps://github.com/nneonneo/2048-ai/issues/4#issuecomment-39490488 .

nneonneo commented 9 years ago

FYI: I added support for the 4D game in a branch, if you're still interested.

veleritas commented 6 years ago

I've got a working 4D solver here.

I'm still working on optimizing the heuristics, but so far in internal tests the best results I have managed to achieve are as follows:

Performance stats for 200 games: Got to 2^11 (2048) 200 times (100.00%) Got to 2^12 (4096) 200 times (100.00%) Got to 2^13 (8192) 190 times (95.00%) Got to 2^14 (16384) 124 times (62.00%) Got to 2^15 (32768) 7 times (3.50%)

DMarke99 commented 3 years ago

I have also developed a solver for 2048-4D here

Performance observed over 100 games: Tile Proportion of games
tile achieved
2048 100%
4096 98%
8192 98%
16384 96%
32768 87%
65536 15%

Min Score: 36924, Median Score: 845132.0, Max Score: 2212500

Coefficient of the heuristics and model parameters were tuned by hand so there is still room for improvement in this despite its high performance.