Weird AI behavior while mapbuilding

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Post Reply
Dox4242
Posts: 20
Joined: Mon Sep 23, 2013 6:28 am

Weird AI behavior while mapbuilding

Post 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.
Attachments
myscenario-v1.11.sav.bz2
Scenario file
(12 KiB) Downloaded 312 times
freeciv-T0130-Y00600-auto.sav.bz2
Save game file
(123.47 KiB) Downloaded 312 times
Dox4242
Posts: 20
Joined: Mon Sep 23, 2013 6:28 am

Re: Weird AI behavior while mapbuilding

Post by Dox4242 »

Continued observation shows expansion...poor guys are just shield starved.
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Weird AI behavior while mapbuilding

Post 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.
louis94
Hardened
Posts: 270
Joined: Thu Apr 25, 2013 10:17 pm
Location: Belgium

Re: Weird AI behavior while mapbuilding

Post 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
Dox4242
Posts: 20
Joined: Mon Sep 23, 2013 6:28 am

Re: Weird AI behavior while mapbuilding

Post 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?).
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Weird AI behavior while mapbuilding

Post 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.
Dox4242
Posts: 20
Joined: Mon Sep 23, 2013 6:28 am

Re: Weird AI behavior while mapbuilding

Post 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? ;)
Post Reply