Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: flying AI (PR#1162)
Home

[Freeciv-Dev] Re: flying AI (PR#1162)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: flying AI (PR#1162)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Fri, 28 Dec 2001 22:16:05 -0800 (PST)

--- Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> wrote:

> kill_something_with, process_attacker_want: advmilitary.c
> find_something_to_kill : aiunit.c
> 
> unfortunately these functions are among the most horrible to read and
> understand.  therefore I ask if anyone has any knowledge about the
> complicated weighting techniques to produce the choice.want etc...
> In particular, how do you think the want should be calculated for the
> bombers.
> 
> Petr, Raahul, if you have any cleanup patches ready for the above
> functions, please submit them!
> 
> G.


I've got some patches, but they're too rough to submit yet. Here is a basic
summary for  kill_something_with

c is equal to min_turns_to_dest
a perhaps attack power, killing strength etc.
m  = max_move_rate

 m = get_virtual_defense_power(v, n, x, y);
 m *= unit_types[n].hp * unit_types[n].firepower;

This use of m in kill_something_with is plain wrong. Normally m is the
amount of turns a unit can move in a turn. This calls for a new variable,
actual_defense_strength for those 2 lines above. Those lines end up
calculating,
taking into account the strenght of one unit vs another, and veterancy, what
the defence power of the unit will be. If this is not clear, speak up, I'll
amend
the description.

 m = unit_type(pdef)->build_cost;

M is used wrongly again here. It seems one variable is all we have. Must have 
been a shortage of letters in the alphabet. You can call it build_cost here.

 b = unit_types[n].build_cost + 40;

I have no idea why we add 40 to build cost. If someone knows, speak up.
Ross, Petr?

n = defensive unit type


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


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