Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: Barbarians
Home

[Freeciv-Dev] Re: Barbarians

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Barbarians
From: Ross Wetmore <rwetmore@xxxxxxxxxxxx>
Date: Fri, 17 Oct 2003 20:54:02 -0400

Per has pretty much got it right (in my estimation) as to style of the
current codebase, how barbarians need to function, and how the current
codebase doesn't really inhibit this.

What might be nice though is to move the AI functionality towards a form
that allows for a more personality based aka modular functionality that
doesn't need to throw out the current spastic AI flavour as newer
coordinated functionality via advisors or higher level strategic concerns
is moved in.

Per is right that it is more of a pain to develop general code with sets
of specific options, than rewrite code but just with another monolithic
base flavour of the moment. However, this is one of those cases where it
might be possible with a little upfront planning, and would certainly
pay off in the long run.

However, there are some limits to how cleanly one can unscramble the
current code and Per is possibly going to have a stronger position
when the practical realities of coding it are a little more obvious.

The compromise is to think a little bit harder of what it might require
and for people to give Per a little help at this point with real ideas.
But after a good try, accept that it may take a round or two of such
rewrites to get things to the point where this can practically be
implemented, and go along with Per's current instincts. The advantage
of the brief attempt to do it right, is that it may produce enough
useful input to make this rewrite a step closer to the eventual goal.


Anyway, one initial thing to do is break the AI down into single task
modules. Thus barbarians would just not access certain tasking choices
and the selection of which tasks as well as the parameterization of
task priority weights would be part of the personality system. Where
the barbarian shortcuts currently appear may be some indication of
the task module interfaces, or personalized analysis as input data
for generating weights.


Cheers,
RossW
=====

Per I. Mathisen wrote:
On Wed, 15 Oct 2003, Mike Kaufman wrote:
[...]
Frankly, looking over your list, I don't see why barbarians can't be
regular AI players.

Because barbarians should not attempt to behave like one, single, player
entity.

The barbarian code spawns multiple independent hordes of barbarians, and
each need to throw themselves at the defences of the victim before they
despawn due to running of out 'fuel'. This requires a mindless, suicidal
behaviour and lack of planning that we should be moving away from in the
AI.


As long as you introduce personalities, etc. The only non-AI specific
code is the player creation and placement code. Then hand off to AI with
a set of personality restrictions (what to build in cities taken, how
fast to retreat, what role is give to leader...)


This is not how the AI works. Furthermore, the AI has no personalities,
and if it had personalities (which would be a lot of work), those
personalities would not be specific enough to implement barbarian type
behaviour. They would not specify what to build and what to do, but the
weights given to different kinds of behaviour (see eg aidata priorities).

Right now the barbarian behaviour is implemented as a series of short-cuts
through the AI code. This is ugly, but works to a certain extent because
the Syela AI is also a stupid suicidial maniac, without plan and
coordination. Once we move away from that paradigm, maintaining the
barbarian codepaths in the AI code will become more and more of a bother.

Also, implementing a tiny AI for barbarians will significantly reduce the
CPU usage of the barbarian player(s), since they will not be doing
unnecessary AI calculations.

  - Per



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