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: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: flying AI (PR#1162)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Sat, 29 Dec 2001 12:41:24 +0100

Dear diary, on Sat, Dec 29, 2001 at 07:16:05AM CET, I got a letter,
where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
>  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?
Quick recapitulation where's 40 used for which...

First, it's used as city walls and coastal defense value. Probably just a
coincidence, but probably not.

Then, it's used in setting up the value of the unit, everytime we add the
value BUT one case:

      if (!is_ground_unit(myunit) && !is_heli_unit(myunit) &&
         (!(acity->ai.invasion&1))) b -= 40; /* boats can't conquer cities */

So it appears to me that 40 is the 'value of ability to conquer' :). Ross?

To fix less desire for building boats for invasion (?), we also do:

    if (is_ground_unit(myunit) && !sanity && !boatid)
      needferry = 40; /* cost of ferry */

and add needferry to fprime later, on the same place where we use + 40 in
similiar calculations.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv, (e)links
.
Firewall in a way is like the doorkeeper of a local pub. If you don't have your
I.D. on you, or if for some reason you do not qualify to enter, the doorkeeper
will not permit you to enter. In some extreme cases these doorkeepers will not
let you out, or at least give you a hard time before they finally let you out.
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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