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.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: NudeRaider