Zulko / easyAI

Python artificial intelligence framework for games
http://zulko.github.io/easyAI/
Other
639 stars 126 forks source link

announcement: fork being made for a nim language version #36

Closed JohnAD closed 6 years ago

JohnAD commented 6 years ago

@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 to pip):

Any and all feedback is appreciated!

JohnAD commented 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.

JohnAD commented 6 years ago

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.

Zulko commented 6 years ago

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.

JohnAD commented 6 years ago

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.

JohnAD commented 6 years ago

Videos are now up:

turn_based_game: https://youtu.be/u6w8vT-oBjE

negamax: https://youtu.be/op4Mcgszshk

JohnAD commented 6 years ago

closing so that I'm not filling the Issues queue.