Complete.Org: Mailing Lists: Archives: freeciv-ai: November 2005:
[freeciv-ai] Re: AI personalities
Home

[freeciv-ai] Re: AI personalities

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: AI personalities
From: Per Inge Mathisen <per@xxxxxxxxxxx>
Date: Sat, 5 Nov 2005 21:58:27 +0000 (GMT)

Hi Gregory!

Good to see you are still alive and kicking ;)

On Mon, 31 Oct 2005, Gregory Berkolaiko wrote:
> I was actually thinking about it lately. In the building system overhaul
> which I never finished, I was trying to implement tags for proposed
> builds. They were something like:
> 1. EMERGENCY_MILITARY(emergency defence)
> 2. EMERGENCY_CIVIL(temples)
> 3. MILITARY (aggressive units)
> 4. EXPANSION (settlers)
> 5. CIVIL (development like banks)
>
> Then to compare them, I wanted to implement the following simple rules:
> 1 trumps all others
> 2 trumps all but 1
> 3, 4 and 5 have certain weights and the comparison is done on numerical
> basis
>
> Changing these weights would allow cheap implementation of three traits.

This seems like a good idea. I have thought along the same lines, too.

However, there is something that has been bugging me lately with the
design of the AI. It is connected to my attempts to introduce a bit more
fake intelligence and emotion into the AI's diplomacy. I think the
fundamental mistake is that the AI is outcome oriented, rather than
historically oriented.

Currently the AI attempts to recalculate pretty much the entire state
every turn, and figure out what to do based on what would generate the
most beneficial outcome, city by city, unit by unit. The problem with this
is that the lack of memory makes it unable to learn from mistakes and set
goals for itself.

When I designed the AI diplomacy code, I made it create values like 'AI
love' and act on abstracts like that and 'war fear' and 'war desire'. Now
I think that was a fundamental mistake (but one that matched well with how
the rest of the AI is written). These abstractions should be the main
motivators for the AI, but be mere tools for finding goals.

When the game begins, the AI should set itself the goal of expanding
horizontally. It should attempt to stick to this goal until it is
frustrated, either by lack of good expansions, enemy aggression or
anti-smallpox factors. Only then should it start to look at other goals.

(Except: If it finds opportunities too good to pass up. If we find one of
the enemy's three cities is undefended and we can snatch it, we should do
so (if we have the personality for it). Currently the AI leaves such
fantastic opportunities alone.)

Now the AI can set a new goal for itself - to expand in depth (buildings),
to attack an enemy, or to race ahead to launch a spaceship. When it
decides to attack an enemy, it should decide on a tactic and a ground zero
for its attacks. If this goal is frustrated, it should eventually drop it,
but also remember it so it does not try it again if there are other goals
to be pursued instead.

When it comes to AI diplomacy, the 'AI love' is quite information poor. It
tells us little about how trustworthy another player is, since it is
composed of so many factors. Instead, we should have a memory of past
events - has this player broken treaties with us in the past, has he given
us gifts, has he rejected previous offers, and so on.

Same with the anti-spam controls - now we just keep a counter ticking.
What we should do instead is remember past rejections, and either
"arrogantly" keep away from suggesting treaties, or increase the offer
each time from what was offered last time.

I've started in a small way already. In the previous rewrite of the AI
diplomacy, I added a temporary goal mechanism for declaring war, whereby
the AI would decide on a target and a 'reason for war' which we would
announce to the victim when a counter ran out. I would like to make such
goals a lot more central to the whole AI, though.

  - Per




[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] Re: AI personalities, Per Inge Mathisen <=