Page 1 of 1

Weird AI behavior while mapbuilding

Posted: Thu Nov 07, 2013 5:17 am
by Dox4242
I'll try to make this a short story....

I started with a random 512x256 world, replaced the terrain data with jpg2ascii data, and smoothed out the coastline abnormalities (every land tile is grassland). In this state, with mis-matched rivers and resources, the AIs played fine on the map, expanding and doing what they're supposed to do. Later, I blanked the rivers and resources (I'm using a text editor to do all this) which seems to cause most of the AIs only build 2 cities, then switch to coinage, while a handful are in normal expansion mode.

I attached a save file for your inspection.

I'm also curious why Austrians spawned in New Zealand, when I have New Zealand defined in the scenario, but not Austria.

Re: Weird AI behavior while mapbuilding

Posted: Thu Nov 07, 2013 6:50 am
by Dox4242
Continued observation shows expansion...poor guys are just shield starved.

Re: Weird AI behavior while mapbuilding

Posted: Sat Nov 09, 2013 11:00 am
by JTN
Dox4242 wrote:Continued observation shows expansion...poor guys are just shield starved.
I'll assume this mystery is adequately resolved...
Dox4242 wrote:I'm also curious why Austrians spawned in New Zealand, when I have New Zealand defined in the scenario, but not Austria.
Where you have

Code: Select all

503,194,FALSE,"newzealand"
you should spell it

Code: Select all

503,194,FALSE,"new zealand"
(to match the "name" in data/nation/newzealand.ruleset, not the filename, [section name], or flag name). I assume you wrote these start positions in a text editor.

You can see that the game hasn't registered your preference by entering Edit Mode, middle-clicking, and looking at the start position -- it thinks it's valid for all nations. If you start the server with "-d 3" (verbose logging) you can see a complaint too:

Code: Select all

3: [T000 - 2013/11/09 10:48:55] in sg_load_map_startpos() [savegame2.c::2488]: Missing nation "newzealand".
(although it's hidden among lots of other stuff, I wonder if we should make this more obvious?)

Why it's always choosing Austrians, I'm not sure (it did for me too). Probably they turn out to be the best match to all the other nations forced to be in the game by having start positions, by the algorithm the game uses to choose a well-matched set of nations.

Re: Weird AI behavior while mapbuilding

Posted: Sat Nov 09, 2013 1:06 pm
by louis94
Hello,
(although it's hidden among lots of other stuff, I wonder if we should make this more obvious?)
Under Linux, you could write

Code: Select all

fcser -d 3 | grep "newzealand"
but the prompt would then be unusable.

Louis

Re: Weird AI behavior while mapbuilding

Posted: Sun Nov 10, 2013 5:56 am
by Dox4242
Thanks for the help! Putting the space in "newzealand" did the trick...and now I'm curious: You mentioned other error output. I'd like to run the server in verbose mode, but I'm running Freeciv under Windows. I'm not sure how to make it work. My top-of-head solution would be to run Freeciv-server from a command line console, then run the GTK-client like normal and hope it finds the server I started manually. Is that recommended, or is there an option box I can't seem to find in the GTK-client to turn on verbose messages?

On the wishlist side of things, I'd like to be able to save output messages to a file, maybe 4 files for each of the types of messages (fatal, error, something I forgot, and verbose, correct?).

Re: Weird AI behavior while mapbuilding

Posted: Sun Nov 10, 2013 3:20 pm
by cazfi
Dox4242 wrote:My top-of-head solution would be to run Freeciv-server from a command line console, then run the GTK-client like normal and hope it finds the server I started manually.
That's the way to do it as you cannot control commandline parameters client passes to server it automatically launches. Separately launched server should be available via client "Connect to Network Game" -> host: localhost, port: 5556 (unless you specify different port on server launch). Logging level is controlled by commandline parameter "-d <level>". Try "-d 3" for debug, or "-d 2" for verbose (this is actually often more useful, as -d 3 outpus so much it's hard to see relevant messages from the mass)
Dox4242 wrote:On the wishlist side of things, I'd like to be able to save output messages to a file, maybe 4 files for each of the types of messages (fatal, error, something I forgot, and verbose, correct?).
Directing log messages to a file "-l filename.log" command.

Re: Weird AI behavior while mapbuilding

Posted: Mon Nov 11, 2013 5:34 am
by Dox4242
Thanks for confirming that, cazfi. I'll give it try.
cazfi wrote:
Dox4242 wrote:On the wishlist side of things, I'd like to be able to save output messages to a file, maybe 4 files for each of the types of messages (fatal, error, something I forgot, and verbose, correct?).
Directing log messages to a file "-l filename.log" command.
Ask and you will receive, eh? ;)