Zulko / easyAI

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

A proposal for two-teams game #37

Open laxertu opened 5 years ago

laxertu commented 5 years ago

Hi all,

I'm working on a kind of RPG games framework based on easyAI, here: https://github.com/laxertu/rpg-engine

so I've adapted TwoPlayersGame class to suit with my requirements. Here is the result :-)

maybe you're interested in include something like that in your repo. As I'm a totally newbie in AI, any suggestion woud be really apreciated

thanks a lot

JohnAD commented 5 years ago

I've only done a cursory view. Probably the first step is documentation. What does TwoTeamsGame do? You might want to include a simple example in the documentation. You could use the same example in the testing code. @Zulko what do you think?

laxertu commented 5 years ago

Hi John, thank you so much for your feedback

ok, I'll include some .rst doc file in my repo.

The idea is to override TwoPlayersGame switch_player method in order to allow games between two teams, default implementation is described here: https://github.com/laxertu/easyAI/blob/470961648d146ef94b375abdd4c71ea32dc6e09c/easyAI/TwoTeamsGame.py#L111

I really don't know if it may be useful for your project :-) but just in case..

JohnAD commented 5 years ago

It's a novel use of the Negamax algorithm. As long as the next player is always predictable from the game state, I would think it would always work.

The challenge is what to use as a simple example. It needs to be simple enough to follow easily in code; yet not so simple that it doesn't demonstrate it's usefulness.

BTW, let me know if you have trouble with compiling the doc directory documentation. ... looking at my notes ... it uses the sphinx toolset. Hints are in the Makefile. I'm not normally a user of sphinx, so I had quite a bit of struggle with it. The compiled html is saved in the repo and is what http://zulko.github.io/easyAI/ uses.