Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2002:
[freeciv-ai] Re: ai govt eval improvement

[freeciv-ai] Re: ai govt eval improvement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: ai govt eval improvement
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 22 Dec 2002 19:59:48 +0000 (GMT)

On Sun, 22 Dec 2002, Per I. Mathisen wrote:

> On Sat, 21 Dec 2002, Gregory Berkolaiko wrote:
> > > Can you send me a savegame for that explorer bug you found?
> >
> > This is my fix for the bug:
> >
> > set_unit_activity(punit, ACTIVITY_GOTO);
> > result = do_unit_goto(punit, GOTO_MOVE_ANY, FALSE);
> > if (result != GR_DIED) {
> >   set_unit_activity(punit, activity);
> >   punit->goto_dest_x = oldx;
> >   punit->goto_dest_y = oldy;
> >   return TRUE;
> > }
> Danger, danger: You should not set activity back here without first
> checking if it is a valid activity for the new tile with
> can_unit_do_activity(). A player should not be able to move a fortified
> unit and immediately resume fortified status, and we might have goto'ed a
> transport, for example, where fortifying is an illegal state.

You are right, that's why I saw forified aI units moving around...
See my other email for better fixes.

> Ok, but you should move that MIN() above the freelog. Or better, drop the
> freelog - this function is (going to be) a CPU bottleneck.

Sure.  See my other email ;)

> Also, on a slightly related note, we should set ai->science_priority to
> zero once we have researched everything! No point in having Democracy once
> we can't research.


> > 2. When AI is in democracy, it is often seen:
> >  a. building an aggressive unit
> >  b. moving it out to attack
> >  c. getting disorder in the city
> >  d. fixing it by creating elvises (and food/shield deficit)
> >  e. disbanding the unit to fix the deficit (an ai_manage_taxes)
> > This should be fixed to at least attempting to move the unit back into the 
> > city.
> > It will be a kludge but it will work: the units will stay alive (moving
> > in-n-out) and when AI has enough of them, it will get so much unhappiness 
> > that
> > it will go for the more war-loving govt.
> Might work as an ugly kludge...
> A better solution is to make the AI better at solving unhappiness
> problems. CM will help. Also avoiding building attack units in cities
> where they will cause anarchy is a good idea - first build marketplaces
> and temples so that we can upkeep those units, like we first build
> barracks now.

This is wishful thinking at the current stage.  How would it know when to 
start building aggressive units?

> Finally, in times of all-out war, ai->shield_priority should be increased,
> which will have the side-effect of making the AI choose something other
> than Democracy (usually Monarchy or Communism) for government.

That is so.  But again, we would need strategy code to do that.  Which 
brings us closer to the discussion of your diplomacy, but not today :)


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