This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: code in adjust_tooling_crossover?
- From: Stan Shebs <shebs at apple dot com>
- To: Stanley Sutton <sutton at t-surf dot com>
- Cc: xconq7 at sources dot redhat dot com
- Date: Wed, 10 Jul 2002 11:39:12 -0700
- Subject: Re: code in adjust_tooling_crossover?
- Organization: Apple Computer, Inc.
- References: <8CB7243165D750498B12F7F868535B4009481E@pline2>
Stanley Sutton wrote:
>
> While working on the documentation, I ran into the following piece of
> code in calculating the crossover from tooling up one unit type to other
> types:
>
> cross = (unit->tooling[u2] * uucross * uu_tp_max(u2,
> u3)) /
> (uu_tp_max(u2, u3) * 100);
>
> The same quntity, uu_tp_max(u2, u3) is in both the numerator and
> denominator, which is uneeded arithmatic at best, since they would
> cancel each other out, unless it's depending on an arithmatic overflow,
> :-). From the code in adjust_tech_crossover, I suspect that they should
> be two differnt quantities. If someone more familiar with the code
> would look at it, I'd appreciate it.
Hmmm, yes. As the doc says, the theory is to give "free" tooling
points for the construction of related types, so, say, switching
from bombers to fighters does not require a complete retooling,
while switching to battleships would entail a longer toolup time.
But clearly nobody plays postmodern (the only game using tooling
crossover), because the formula is indeed wrong. Both of the
tp_max tables should be functions of the unit tooling up, so
the args should be unit->type, u3 and unit->type, u2 respectively.
(Just as a historical note, this all came from old Empire, where
it took a flat 20% longer to build the first unit when you
switched build types.)
Stan