Staredit Network

Staredit Network -> StarForge -> How Is this possible?
Report, edit, etc...Posted by Carlsagan43 on 2005-04-18 at 08:33:40
QUOTE
Max Strings: 1024
Max Locations: 255 (Including "Anywhere")
Min unit HP: -8388608
Max unit HP: 8388608 (8388607+1)
Min Shield Ammount: -32768
Max Shield Ammount: 32767
Max Armour Ammount: 255
Max Upgrades: 255
Max Mineral Cost: 65535
Max Gas Cost: 65535
Max Damage: 65535
Max(upgraded) Damage: 65535 + (65535*255) = 16776960
Max text characters displayed in force: 29
Max Players: 256
Max colours: 256
Max minerals/vaspene geyser ammount: 65535
Max units/sprites: 1700
Min ever working map size: 1x6 ( By SaLaCiouS(U) )
Max working map size: 256x256




How is it possible for the max life to be that high if the limits of the life int are limited to 65535?
Report, edit, etc...Posted by Heimdal on 2005-04-18 at 08:45:08
HP info for evey unit is stored in 4 bytes. It turns out that the low order byte is not part of the number at all, and has some weird effects when it is non-zero. This is the "HP2" box you see in SF and SCMD2. The other 3 bytes are a signed integer, so you have:

256 ^ 3 / 2 = 8388608 (biggest negative value)
256 ^ 3 / 2 - 1 = 8388607 (biggest positive value)
Report, edit, etc...Posted by Clokr_ on 2005-04-18 at 11:11:22
Now we should ask SC programmers why the censored.gif the HP is 3 bytes, and why that fourth byte exists tongue.gif
Report, edit, etc...Posted by SI on 2005-04-18 at 11:22:51
The fourth byte was used as invincibility flag I believe (most if not all invincible units have it set to 0x01)
Next Page (1)