AI changes on Windows

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
jieverson
Posts: 17
Joined: February 26th, 2013, 8:27 pm

AI changes on Windows

Post by jieverson »

Have anyone worked with Wesnorth on Windows?
I am having problems to try AI modifications.

First: I am using this example of how to execute the game from the terminal:
http://forums.wesnoth.org/viewtopic.php?f=10&t=38344

I am trying to execute the following line on terminal:

Code: Select all

wesnoth -m --controller 1:ai --controller 2:ai --parm 1:fog:no --parm 2:fog:no --parm 1:gold:100 --parm 2:gold:100 --parm 1:village_gold:2 --parm 2:village_gold:2 --ai-config 1:jieverson.cfg --ai-config 2:jieverson.cfg --side 1:Northerners --side 2:Rebels --nogui
If I remove the "--nogui" it seems to work allright, but with the "--nogui" it is not showing on terminal who have winned the game.
I know that on Windows the data is writed on the file "stdout.txt" and not on terminal. But, it just write on the file if I run the terminal as administrator.

Second: Another problem is that I have changed the AI for my custom AI: "jieverson.cfg", but it is not working.
My custom file is at "C:\Users\Jiéverson\Documents\My Games\Wesnoth1.11\data\add-ons\AI-demos\ais\jieverson.cfg"

The file is current just a copy and paste of the "ai_grunt-rush-Freelands-S1", but it don't seems to work.
The result is always "winner: 1 (using ai_default_rca)" or "winner: 2 (using ai_default_rca)".

I tried using the Fred ai:

Code: Select all

wesnoth -m --controller 1:ai --controller 2:ai --parm 1:fog:no --parm 2:fog:no --parm 1:gold:100 --parm 2:gold:150 --parm 1:village_gold:2 --parm 2:village_gold:2 --ai-config 1:~add-ons/AI-demos/ais/ai_grunt-rush-Freelands-S1.cfg --side 1:Northerners --side 2:Rebels --nogui
But, the result still say that the winner have used the "ai_default_rca".
User avatar
Iris
Site Administrator
Posts: 6719
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: AI changes on Windows

Post by Iris »

jieverson wrote:I know that on Windows the data is writed on the file "stdout.txt" and not on terminal. But, it just write on the file if I run the terminal as administrator.
There is a whole topic dedicated to this particular point in Technical Support.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14.x and 1.15.4+).
Anonymissimus
Inactive Developer
Posts: 2460
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: AI changes on Windows

Post by Anonymissimus »

jieverson wrote:Have anyone worked with Wesnorth on Windows?
Basically: no. Almost all development takes place on *nix machines, which generally means that the whole project doesn't work too well on other systems, including, but not limited to, the main executable, wesnothd, python tools, perl tools etc.
I also never used wesnoth from command line (not on windows or at all), so I would expect bugs. Best you can do is copy the exact command from mattsc (who worked most with it lately and reported a number of bugs, but all on MacOS, most of them system independent however) and hope that it works.
Needing to be administrator is an acceptable restriction however.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Iris
Site Administrator
Posts: 6719
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: AI changes on Windows

Post by Iris »

Anonymissimus wrote:Needing to be administrator is an acceptable restriction however.
I hope you meant ‘unacceptable’.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14.x and 1.15.4+).
User avatar
jieverson
Posts: 17
Joined: February 26th, 2013, 8:27 pm

Re: AI changes on Windows

Post by jieverson »

shadowmaster wrote:
Anonymissimus wrote:Needing to be administrator is an acceptable restriction however.
I hope you meant ‘unacceptable’.
Yes! It's unacceptable. I am a windows user (I am a .NET developer and a hardcore gamer when I am not working, so windows is the only option).
But thanks to you guys, I have solved the problem.

I just found "stderr.txt" on my Virtual Store (C:\Users\<My User>\AppData\Local\VirtualStore\Program Files (x86)\Battle of Wesnoth), and then have deleted it.
After deleting the file, the original (on c:\Program Files (x86)\Battle of Wesnoth) start to be updated.

Another detail was that, to execute a custon AI (like mine, Ron or Fred) I had to copy the folder "AI-demos" from "My Documents\My Games\Wesnoth\data\add-ons" to "C:\Users\<My User>\AppData\Local\VirtualStore\Program Files (x86)\Battle of Wesnoth\userdata\data\add-ons".

I realized the Fred Rush is biiiiiig slow. So, I will do my experiments based on Ron Rush.

Thanks to all.... if I have more problems or do another discovery, I will contact u all :eng:
mattsc
Developer
Posts: 1166
Joined: October 13th, 2010, 6:14 pm
Location: Hidden on the hex behind Fred

Re: AI changes on Windows

Post by mattsc »

jieverson wrote:I realized the Fred Rush is biiiiiig slow. So, I will do my experiments based on Ron Rush.
Yes, Fred is not in a good shape at the moment. If you look at my recent commits, they are all geared toward speeding things up. Of course, one of the reasons why I want to speed things up is so that I can add more evaluations, meaning Fred will always be slower than Ron - but hopefully not this much slower.

I'm glad to hear that you got your problems solved.
User avatar
jieverson
Posts: 17
Joined: February 26th, 2013, 8:27 pm

Re: AI changes on Windows

Post by jieverson »

Maybe should pin my solution to this topic:
http://forums.wesnoth.org/viewtopic.php?f=4&t=23894
User avatar
Iris
Site Administrator
Posts: 6719
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: AI changes on Windows

Post by Iris »

jieverson wrote:Another detail was that, to execute a custon AI (like mine, Ron or Fred) I had to copy the folder "AI-demos" from "My Documents\My Games\Wesnoth\data\add-ons" to "C:\Users\<My User>\AppData\Local\VirtualStore\Program Files (x86)\Battle of Wesnoth\userdata\data\add-ons".
I don’t use Windows, but if my memory serves the problem you are encountering here is that you are not passing a few additional command line parameters to make sure Wesnoth uses ...\My Documents\My Games\Wesnoth as the user preferences/data directory instead of the built-in fallback of <wherever Wesnoth.exe is located>\userdata. You may be able to determine what those parameters are by looking at the properties of the Start Menu or desktop shortcut originally created by the Wesnoth installer — then you could create a .cmd/.bat file for easier command line invocation in the future.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14.x and 1.15.4+).
User avatar
jieverson
Posts: 17
Joined: February 26th, 2013, 8:27 pm

Re: AI changes on Windows

Post by jieverson »

Nice, I will try it at night!
User avatar
jieverson
Posts: 17
Joined: February 26th, 2013, 8:27 pm

Re: AI changes on Windows

Post by jieverson »

shadowmaster wrote:
jieverson wrote:Another detail was that, to execute a custon AI (like mine, Ron or Fred) I had to copy the folder "AI-demos" from "My Documents\My Games\Wesnoth\data\add-ons" to "C:\Users\<My User>\AppData\Local\VirtualStore\Program Files (x86)\Battle of Wesnoth\userdata\data\add-ons".
I don’t use Windows, but if my memory serves the problem you are encountering here is that you are not passing a few additional command line parameters to make sure Wesnoth uses ...\My Documents\My Games\Wesnoth as the user preferences/data directory instead of the built-in fallback of <wherever Wesnoth.exe is located>\userdata. You may be able to determine what those parameters are by looking at the properties of the Start Menu or desktop shortcut originally created by the Wesnoth installer — then you could create a .cmd/.bat file for easier command line invocation in the future.
Ty shadowmaster! It have worked nice =]

The param is "--config-dir Wesnoth1.11"

Are there a way to execute the game 500 times to compare the different AIs?
User avatar
Alarantalara
Art Contributor
Posts: 784
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: AI changes on Windows

Post by Alarantalara »

Check out the files in utils/ai_test (included in source distribution but not in all (any?) binary packages).
Alternatively, SeattleDad created a modification of the above to deal with the commandline bugs in 1.10. You can find it in the AI-demos add-on under ml_utils.
Post Reply