Staredit Network > Forums > General StarCraft > Topic: Max Dmg a unit can have/deal
Max Dmg a unit can have/deal
May 28 2015, 3:01 am
By: DoomDoomDoom  

May 28 2015, 3:01 am DoomDoomDoom Post #1



Hey guys, I was just wondering what is the max amount of DMG a unit can deal? Like the exact number?
Thanks.



None.

May 28 2015, 3:29 am Dem0n Post #2

ᕕ( ᐛ )ᕗ

It appears to 4095, and then units with two attacks do 8190 (twice the original).




May 28 2015, 3:39 am DoomDoomDoom Post #3



Thanks for your help.



None.

May 28 2015, 3:57 pm rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Hmm,

I seem to recall being able to set 9999 as the max damage in the editor?
Max damage is almost certainly 65535. I can personally vouch that the upgrade damage is capped at 65535. As you increase upgrades, if you increase past this level it will cause a buffer overflow or at least loop back around.

So the max damage any attack could do is 131070.

Also damage is not stored in the same way as HP. Damage is an integer. HP has a hidden byte for regeneration and half damage due to armor.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

May 28 2015, 11:01 pm Dem0n Post #5

ᕕ( ᐛ )ᕗ

Well, I put like 999999 in scmdraft and it came out as 4095 in-game, so I don't know. :hurr:

Then again, when I came back to look at it, it was then like -734985, so maybe it overflowed and gave an improper max attack.




May 30 2015, 1:40 pm UndeadStar Post #6



Knowing that damage is capped by MaxHP which is a signed int of 32 bits.
In memory it would be 7FFFFFFF, in decimal 2147483647.
In game you have to divide by 256 to get 7FFFFF, in decimal 8388607.
Logically, it would be that.

Now some types of damages may be limited to signed/unsigned 16 bits values, in which case the max would be 32767/65535.




Jun 1 2015, 5:30 pm rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

can you assign -1 damage?



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jun 2 2015, 3:56 am O)FaRTy1billion[MM] Post #8

👻 👾 👽 💪

I think it's unsigned, but don't quote me on that.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Jun 2 2015, 7:21 am rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

https://code.google.com/p/gptp/wiki/DataValues#weapons.dat
it's "16", but it doesn't have u beside it? I assume this means it's signed, so max is 15 bits, which would be 32767.

I can guarantee that the max bonus amount is capped at 65535.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
[2024-4-16. : 4:31 pm]
Zoan -- where's the option to delete my account
[2024-4-16. : 4:30 pm]
Zoan -- goodbye forever
Please log in to shout.


Members Online: lil-Inferno, Roy, Sie_Sayoka