code in adjust_tooling_crossover?

Stan Shebs shebs@apple.com
Thu Jul 11 05:55:00 GMT 2002


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



More information about the Xconq7 mailing list