[Freeciv-Dev] thoughts on settling cities
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I've been playing around a little with the new settlers patch, and I found
to my dismay that no matter how much I changed the various variables that
are used in the code, the AI never quite seemed to do the right thing.
Yes, the numbers compared to the current AI are much much better. Yet it
continues to make rather strange decisions. Sometimes I found that it did
better when there were bugs in the code that led it to take wrong
decisions - of course these errors more often than not proved
counterproductive, but still I couldn't quite shake off the feeling that
not everything was working as it should.
Then it struck me, that perhaps attempting to use one universal metric for
evaluating all cities may be mistaken. Perhaps sometimes shields are not
so important, and sometimes they are much more important. Perhaps some
cities can be founded without regard to trade, and trying to weight all of
these variables all the time may be mistaken. There may in fact be
different _kinds_ of cities that we should be settling.
This idea first hit me when I noticed that a bug led the AI to found a
city on a wheat where most other tiles were ocean. There were almost no
shields there, and it was one turn further away than the spot where it
would otherwise (without the bug) settle. However, in very short time, the
extra food from the wheat made the city grow very fast, and it made use of
the ocean tiles, giving the city a massive trade production. The AI
managed to get The Republic several turns earlier. With some cooperation
with other AI code, it could have built a Library instead of a Settler,
giving a further boost to research.
I managed to reproduce this behaviour later, but not only did the tuning
of variables that led to this particular behaviour give less optimal city
placements elsewhere - the worker allocation code now decided it wasn't
interested in ocean tiles. Duh.
There is also another case too. The new AI settler code (not to mention
the old one) does not understand that sometimes it pays off to settle on a
gold resource, even if you cannot grow, quite simply because the amount of
research that you get is so huge. However, the variables and algorithms
that modify by food availability and expansion possibilites prevent this
kind of cities from being made. More often than not this is a good thing:
If we put our first settlers on such spots we'd be screwed.
While thinking in terms of "what would this city be doing", and assigning
it a role in which some variables are discounted, may provide the most
optimal AI, I am not going to try to implement this in the new AI code.
Cooperation with the city management code is needed first and no doubt
adding ferry support to the new code will also give us some new insights
into how an optimal settler code should be.
Feedback from players on how they think when settling cities is more than
welcome :-)
- Per
- [Freeciv-Dev] thoughts on settling cities,
Per I. Mathisen <=
|
|