[freeciv-ai] Re: [Freeciv-Dev] Re: (PR#9887) AI defense code
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9887 >
On Fri, 3 Sep 2004, Gregory Berkolaiko wrote:
> Ok, lets think about it. A is our defender, B is attacker. strength is
> defence strength and attack strength respectively.
>
> The average number of hits unit A inflicts on B before getting hit _once_
> is
> strength_A / strength_B
> (that's probability theory)
>
> Since A can take hp_A / fp_B hits from B before dying, the average number
> of hits it will inflict on B before dying is
> strength_A / strength_B * hp_A / fp_B
>
> Since each hit takes fp_A off B's health, the average number of health
> lost by B is
> L = strength_A * hp_A * fp_A / (strength_B * fp_B)
BTW, strength_A * hp_A * fp_A is called defence_rating in the code, so the
code is not clueless about the probabilities.
|
|