Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: flying AI (PR#1162)
Home

[Freeciv-Dev] Re: flying AI (PR#1162)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, Petr Baudis <pasky@xxxxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: flying AI (PR#1162)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Sun, 30 Dec 2001 21:39:32 -0800 (PST)

--- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
> At 04:57 PM 01/12/30 -0800, Raahul Kumar wrote:
> >
> >--- "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
> >> At 01:51 AM 01/12/29 -0800, Raahul Kumar wrote:
> >> >
> >> >--- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> >> >> Dear diary, on Sat, Dec 29, 2001 at 07:40:18AM CET, I got a letter,
> >> >> where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> >> >> > Some additional titbits for you. Hope this makes the function
> clearer.
> >> >> > I strongly suspect you want me to explain the 
> >> >> > 
> >> >> > else b0 = ((b * a - f * d) * SHIELD_WEIGHTING / (a + d)) - 
> >> >> > 1412 c * (unhap ? SHIELD_WEIGHTING + 2 * TRADE_WEIGHTING :
> >> >> SHIELD_WEIGHTING);
> >> 
> >> >Desire, is this like want? I assume the 0-100 stuff all applies here, I
> just
> >> >wish I knew exactly how all these weights interact to decide what gets
> >> built.
> >> 
> >> *_WEIGHTING values are things like food/shields/trade = 18/14/12 that give
> >> a relative bias to some resources over others. Trade is always the lowest,
> >> and generally food is more important than shields (if you grow you can get
> >> more shields, but choosing shields in preference leads to stagnation).
> >> 
> >> This is complicated by the fact that food is not a static WEIGHTING, but 
> >> amortized so it decreases in importance as the size of the food box grows
> >> (which is another reason to boost it initially, and probably a bad thing 
> >> to have done anyway). Thus, if you look carefully, the food formulas are
> >> always optimized a little bit differently with cryptic comments to drive
> >> you crazy if you don't understand this basic point.
> >> 
> >
> >This is all stuff that should go to README.AI.  I'm not quite clear as to
> what
> >alternative there is to boosting the food weights early on. Are you
> suggesting
> >a feedback loop where as the city grows in size, more food than the minimum
> >needed to keep the city from starving grows less and less important?
> 
> Food is currently not a static weight like the rest. For bigger cities,
> i.e. those with bigger foodboxes, food is correspondingly lower in weight
> because of amortization. This is bad, as cities stop growing at some point 
> in favour of sending workers to mountains because they have a single shield 
> rather than going for wheat and getting 2 mountains next time round :-).
> 
> IMHO this is a goofy atrategy, but by setting food to a higher priority
> than the rest you can push growth in the early stages, and production or 
> trade (whichever is next higher) or both will take over when cities reach 
> a certain (preset by the relative weights) size.
> 
> >My interpretation of your comment is that the more food we have, and the
> closer
> >we come to adding another population point(a full foodbox), the less
> important
> >food becomes. The trade weighting is perhaps too low. I think it's probably
> >necessary to weigh trade higher for cities that have lots of trade, and
> >trade routes, with an increase for each marketplace/bank/stock exchange that
> >gets built. 
> 
> The WEIGHTING values should be tied to AI personalities. A Gandhi likes
> lots of food, some production and poverty. A Bismarck goes for moderate
> everything with slight bias for production over food and low expand. 
> Elizabeth goes for moderation but slight bias trade >~ food > production 
> and boost to expand.
> 
> When these weights are folded into the want/choice calculations, they will
> send different AI personalities off in different directions.
> 
> >This probably explains why the AI is so damn bad at science.
> 
> The AI puts all its effort into taxes at some point. That is part of the
> reason it can't do science. 
> 

I noticed that. I thought it went 100 % into taxes to buy units because of
danger ratings. That's also the reason it goes into buying way too many
mech infs, and the annoying too many defensive units vs offensive bug.
You seem to be suggesting it's a much easier bug to fix. Give me the line nos,
and I'll see if I can come up with a quick hack to fix the tax/sci/lux
thing.

> The AI has a totally braindead understanding of lux/tax/sci and how to
> use elvii. It seems to run to some extreme instead of having a feedback
> to keep things sanely balanced.
> 

I was thinking about a feedback loop something like this

lux is the min necessary to avoid widespread disorder(higher for govs like
republic, democracy), increased if lacking happiness wonders, increased every
time a city goes into disorder. Should never exceed 90%(in order to allow the
ai to do the celebrates every turn trick). This will allow ai personalities
who shoot for republic, celebrate every turn, go for trade routes etc.
Really dependent on happiness, luxury is never increased when some %
(40? 50) of ai's cities are celebrating.

Tax - bare minimum unless at war, that allows positive cash flow.
For war, science and lux are minimised, we want more units. This could
be perhaps bad for a really long stalemate, we don't want two ai forces
forever trying to kill each other with catapaults attacking fortified 
muskeeters, when artillery would solve the problem.

Science - as much as it can be without driving us bankrupt and/or into civil
disorder. The interesting stuff happens in the other two funcs, in particular
the luxury one. This is really necessary, it's just too easy to build an
overwhelming science lead, and then beat all the ai enemies at once.

> IMHO it doesn't work much at all - basically broken logic like all the
> amortized stuff :-).
> 

Ok, so tell me what kind of logic you would like to see. I'm interested in any
ideas you may have to fix these functions.

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


[Prev in Thread] Current Thread [Next in Thread]