Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize
Home

[Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory.Berkolaiko@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2650) Overflow in military_amortize
From: "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 26 Dec 2002 14:09:37 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 26 Dec 2002, Gregory Berkolaiko via RT wrote:
> I was thinking more in the direction of fixing the overflow.Well,thanks for
> turning me around.What you say makes perfect sense.We wait for comments for
> some time and then I commit, ok?

Ok.

> Two remarks: average production (over the whole nation) canbe very different
> from what we have in this given city.But I guess we shouldn't bother about it,
> it'sall relative anyway.

Well, there isn't a problem that can't be solved with a few extra
parameters! We can pass pcity or find_city_by_id(punit->homecity) to
military_amortize() and use that city's shield_surplus instead of an
average value.

This avoids the pathological case of most-cities-have-zero-surplus, which
means the one city with lots of surplus shields will think "gee, it takes
1243928 turns to build that tanks and drive it to the enemy, so lets
not!", even though it could build it in 3 turns and drive it there in 1!

See the attached patch which implements this.

> There is a danger that changing amortize in such a brutal way will unsynch the
> weight in other areas (like tech want).But I wouldn't bother about it either,
> we won't learn until we break it.

I would guess the maintainer to commit such a patch would do some play
testing and comparisons of it, though ;)

> > The big question is if we need this at all. Simpe amortize might just get
> > the job done, too.
>
> With what delay?

We might just ignore build_cost altogether, as I think your comment in
military_amortize() hinted at.

  - Per




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