Closed JohnAD closed 6 years ago
If curious, the beta for the turn_based_game
, the nim equivalant of TwoPlayerGame
is up at:
https://github.com/JohnAD/turn_based_game
credits to this repo & library are on the readme.
Technically, this frame work is not limited to two players. But if used with the AIs, such as Negamax, it will only work with two players.
And now the negamax repo, which depends on turn_based_game is now public.
https://github.com/JohnAD/negamax
Again, credits to the repo are on the readme.
I'll be interested to hear about the speed gain (and what other possible advantages) you observe. I really like your videos btw, Its nice to see thought processes exposed like this.
There are definitely pros/cons. I'll have a video coming up next week talking more about it. But, some early numbers using the Knights game in the unittest:
With Python 2.7.12:
7.658s
With nim 0.18.0, regular development mode:
1.219s
With nim and the compiler options set to "fast" optimization:
0.129s
This is with regular Negamax. I doubt I convert the non-recursive version any time soon.
Videos are now up:
turn_based_game: https://youtu.be/u6w8vT-oBjE
negamax: https://youtu.be/op4Mcgszshk
closing so that I'm not filling the Issues queue.
@Zulko and others,
I'm converting one of my python/kivy games to nim/godot. As part of that project, I'll be using the code here as a template for a nim version of both the two-player-game class as well as the negamax algorithm (both recursive and non-recursive.)
details of new project: https://www.youtube.com/watch?v=V9MlvPCZ-jc original use: https://github.com/PurpleSquirrelGames/MancalaGameApp https://www.youtube.com/playlist?list=PL6RpFCvmb5SEW1VVM9j3e0R7G5akKGu19 (see videos 4, 5, 12 and 17)
Since it is a completely different language; making it part of "easyAI" could cause confusion IMO. But I'll absolutely give full credit to the easyAI library.
I'll probably create two packages (in nim, they are managed with
nimble
which is similar topip
):two_player_game
negamax
(with a dependency ontwo_player_game
)Any and all feedback is appreciated!