Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de
Home

[Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_de

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: Petr Baudis <pasky@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] [1.2] move some common AI equations to kill_desire() (PR#1279)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Feb 2002 18:40:55 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Feb 25, 2002 at 04:58:07PM +0000, Gregory Berkolaiko wrote:
> Ok, you are in for some trouble, boy.
> 
> First of all, I don't think the desire equation is fully correct.
> 
> To be mathematically sound it has to be of the following form
> 
> Desire = Probability_To_Win * Amount_Won - Probability_To_Lose * Amount_Lost
> 
> This would estimate your average win from the action (if you perform this
> action N times, N is big, you'd be N*Desire better off).

Ack.

> The probabilities are estimated in this way:

> Probability_To_Win = Attack_Rating / (Attack_Rating + Defence_Rating)
> Probability_To_Lose = Defence_Rating / (Attack_Rating + Defence_Rating)

Side note: I came across these a lot. Should be put into extra
functions.

> and it's alright (although win_chance would be the exact value).
> 
> What troubles me the most is the use of victim_count and of ai.f (it's added
> to Amount_Lost).
> NB: the next line, which you didn't bother to convert to use kill_desire and
> you should, basically says "if there are enough units on the job, we don't
> need this one".  Add a comment please.
> 
> The problem with ai.f is that bigger it is, less is our desire to go help
> other units.  Now suppose we need five cavalries to take over a city, we have
> four (which is not enough), then we will be severely discouraged to build the
> fifth one.  Where is logic in this??!?!
> 
> The problem with victim_count is that if you do simple mathematical
> operations, you can reduce the equation to the form:
> Desire = Attack_Rating * Amount_Won - Attack_Rating * Amount_Lost 
>          / (Attack_Rating / Victim_Count + Defence_Rating) 
> 
> That is, with all other quantities constant and Victim_Count big our desire to
> go and bash this city (possibly alone) would go up.  But they are NOT
> helppless Victims, it's a city, not a stack!!!

You have to distinguish between the case 
 - where Victim_Count enemy units will be killed if my unit wins and
 - where another Victim_Count enemy units wait to kill me, even if my
 unit has won

> If you want, can add a comment from me: "Extremely dodgy usage of victim
> count"

Dodgy isn't a common word for a non-native speaker.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Many of my assistants were fans of Tolkien, who wrote 'Lord of the Rings'
  and a number of other children's stories for adults.  The first character
  alphabet that was programmed for my plotter was Elvish rather than Latin."
    -- from SAIs "life as a computer for a quarter of a century"


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