strange cash injection...

greenie

Warlord
Joined
Jun 10, 2001
Messages
180
Location
Auckland, New Zealand
Having played with rules.txt and changing Nuclear units to 990 resources to build (effectively putting nukes out of the game unless the comp cheats) I built one mysefl and discovered something interesting.

About three quarters of the way to builiding it, I checked how much it would cost for me to complete (to get the upper hand in negiotations).

Low and behold, it cost me -378 dollars, yes, that NEGATIVE 378 dollars. Needless to say, after "buying" it, my cashflow increased by 378. Most unusual I thought, I'm just wondering if anyone else has come across that before?

------------------
- Greenie

" Let us take by
cunning what we would
take by force"
 

changing Nuclear units to 990 resources to build (effectively putting nukes out of the game unless the comp cheats)

Unless you changed the priority the Ai places on Nukes, the only effect your should see is a reduced rate of Nukes, since the AI should build them anyway... but it will take longer.

And the AI does "cheat".


Low and behold, it cost me -378 dollars, yes, that NEGATIVE 378 dollars. Needless to say, after "buying" it, my cashflow increased by 378. Most unusual I thought, I'm just wondering if anyone else has come across that before?

Normally, because of the way the data is stored (bits for an integer), when the data exceeds a certain amount, the integer value increases which has the effect of setting the negative sign. The value is then negative, and when subtracted from your treasury, the "minus a negative number" is the same as adding a positive number of the same magnitude. So your treasure increases.

However, in this case the general numbers don't work out based on your 990/-612, and the known 4/8 multipliers for rush buying of units.

If you determine the exact number of remaining shields when you clicked "buy", and not the "cost", it should be possible to compute the rollover amount. Also, be sure to note if the shields box had any shilds in it.

The answer likely is greater than 4800, and less than 7920, which does not correspond neatly to an integer format.
 
The negative cost of buying a unit also appears in the starwars scenario. When you want to build a star destroyer (the more powerfull) you can buy it for -1280 a think.
 
Back
Top Bottom