An interface for implementing python AI in DareFightingICE
First, install pyftg
with pip.
pip install pyftg
Initiate Gateway
for connecting to DareFightingICE platform.
from pyftg.utils.gateway import get_async_gateway
gateway = get_async_gateway(port=50051)
Construct an agent and register it to gateway and then run the game by using following code.
agent1 = KickAI()
agent2 = DisplayInfo()
gateway.register_ai("KickAI", agent1)
gateway.register_ai("DisplayInfo", agent2)
await gateway.run_game(["ZEN", "ZEN"], ["KickAI", "DisplayInfo"], game_num)
After all the process are done, please also close the gateway.
await gateway.close()
Please refer to the examples provided in the examples
directory for more information.