Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2002:
[freeciv-ai] Problems with unit_desirability()
Home

[freeciv-ai] Problems with unit_desirability()

[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] Problems with unit_desirability()
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Sun, 1 Sep 2002 20:55:06 +0100 (BST)

First of all, there is a bug in ai_unit_defence_desirability:

        if (unit_types[i].move_type != LAND_MOVING

should be 

        if (unit_types[i].move_type != SEA_MOVING


Now, I came across slightly strange situation when a Stealth Fighter is 
selected as a city defender.  This is quite ridiculous.  A Mech.Inf. is a 
better defender and cheaper too.

The problem mostly comes from 
        desire += get_unit_type(i)->move_rate;
line in ai_unit_defence_desirability.

The root of all evil is, of course, in allowing process_defender_want to 
choose flying units at all.

There are situations when a Stealth Fighter is a good defender, even if 
the only one, e.g. when a transport-load of howitzers is sailing towards 
you.  But this is a rather exceptional case and should be only considered 
when we have organized a proper feed-back from the danger-assessing 
functions.

For now I suggest we take flying units out of the simple_ai_unit list.
And remove this += move_rate  from defense desirability.


G.



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