bruteforce.py AI does nothing under 1.3.9

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

bruteforce.py AI does nothing under 1.3.9

Post by Quitch »

Installed the Windows version of 1.3.9 and setup a game which included the AI bruteforce.py, but it sat there without doing anything. Having been away from Wesnoth for a while I'm not sure if this is because it only works with certain factions, or doesn't work with this release.
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

It doesn't work with Windows releases as Python is not properly packaged with them. I think if you install python 2.5 from http://www.python.org on your system it will work.
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

Much appreciated :)

Is there a document which details what each AI is for or does? Sample I'm guessing is a base to work from, though since it's listed as a selectable AI does it have anything going for it? Bruteforce is some chess AI without looking ahead, but the other one... not so sure.
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

Installed Python 2.5.1 but only the default AI seems to work. Sample and dfool do nothing, while bruteforce charges its leader across the map without recruiting.
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Seems something else also is wrong then. If you want you can file a bug report on gna.org, so it will be fixed eventually. I'll look at it now but not sure I'll have time to reproduce/locate the problem and fix it.
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Hm, seems to work here in linux. Can you paste the contents of the stderr.txt file from a run of the game where you tried to play with bruteforce.py?
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

Battle for Wesnoth v1.3.9
Started on Mon Oct 22 00:13:44 2007

Checking video mode: 1600x1200x32...
setting mode to 1600x1200x32
WARNING: setlocale() failed for ''.
set locale to ''
found valid cache at 'D:/Games/Wesnoth/userdata/cache/cache-v1.3.9-46d9d060818b8d936533b64060cb527ed2e8935d' using it
loadscreen: filesystem counter = 228
loadscreen: binarywml counter = 14398
loadscreen: setconfig counter = 240
loadscreen: parser counter = 232
time elapsed: 8746 ms
Loading tips of day
found valid cache at 'D:/Games/Wesnoth/userdata/cache/cache-v1.3.9-5ee461d1087120135f5b527ebab05b6247cbaf97' using it
error display: could not open image ''
'import site' failed; use -v for traceback
Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

escape pressed..showing quit
Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]

is in game -- showing quit message
found valid cache at 'D:/Games/Wesnoth/userdata/cache/cache-v1.3.9-46d9d060818b8d936533b64060cb527ed2e8935d' using it
quitting game...
exiting with code 0
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

Python version: 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]
Try removing the extremely outdated python.dll shipping with Wesnoth, so it will pick up the 2.5 one.
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

It generates an error complaining that the .dll is missing.

However, Python doesn't appear to have inserted anything in my PATH to point programs to the Python folder, so unless it installs DLLs into the Windows system folders...
User avatar
allefant
Units Database Administrator
Posts: 516
Joined: May 6th, 2005, 3:04 pm

Post by allefant »

I see. I don't know then. My expectation was if you "install" Python 2.5, it somehow is found by all Python programs, but that may be wrong.

The ideal solution of course would be to recompile Wesnoth against Python 2.5 and distribute not only the .dll but also the required support files - but I don't think we currently have anyone who knows how to do that.
dagoi-koi
Posts: 15
Joined: October 30th, 2007, 4:55 am

Post by dagoi-koi »

Solution: After installing python, take the python25.dll from the python directory. Rename it python23.dll and replace the python23.dll in Wesnoth directory. Then bruteforce.py will work.

You may want to backup the original dll if you have problems.
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

Excellent, that does seem to have solved the problem. dmfool_ai doesn't seem to do anything... it just doesn't work with 1.3.9, or it isn't supposed to do anything? Seems odd to have it there.

What's the difference between a .py AI and one without .py?
VS
Translator
Posts: 187
Joined: November 27th, 2005, 10:07 am

Post by VS »

Some AIs (default, dfool (?)) are hardwired into the game itself, while the .py ones are scripted in Python and can be added ... well, independently on the other stuff. Like you add eras and campaigns (by downloading), you can add your own AI (if you write it first, of course).
Quitch
Posts: 69
Joined: January 10th, 2006, 2:32 pm

Post by Quitch »

There did seem to be a nasty memory leak going on. I pitted all five AIs in a FFA and soon Wesnoth was using over 1.5GB RAM.
Post Reply