Simulate AI games with Python

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Post Reply
segfaulthunter
Posts: 17
Joined: March 25th, 2008, 8:58 pm

Simulate AI games with Python

Post by segfaulthunter »

Is there any way to let two AIs play against eachother and get the result using Python, as the AI is also coded using Python?
I would use this to test whether maps are balanced by letting the AI play a lot of matches and then comparing the results.

Any ideas?
AI
Inactive Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Simulate AI games with Python

Post by AI »

Wesnoth has support for this, see the commandline options:
--nogui
--multiplayer
--scenario=<map>
--controller<number>=ai
--side<number>=<faction>

you can also use --algorithm to specify which ai to use.
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Re: Simulate AI games with Python

Post by allefant »

The attached python script is out of some thread about Python AIs some time ago, and might be a bit easier to use than directly using the above options.
Attachments
aitest.txt
(5.93 KiB) Downloaded 185 times
segfaulthunter
Posts: 17
Joined: March 25th, 2008, 8:58 pm

Re: Simulate AI games with Python

Post by segfaulthunter »

Thank you really much. I'll work on implementing this :)
Post Reply