EUD Byte Offset
Sep 4 2009, 9:27 pm
By: xYoshix  

Sep 4 2009, 9:27 pm xYoshix Post #1



I'm trying to learn more about euds, but I'm confused about the offset. I'm trying to do health detection. Here's what it says on the tutorial.

Quote
[h2]Byte Values[/h2]

Byte Offset: 00 00 00 00 00 00 00 00 = 0x01 multiply by 1
Byte Offset: 00 00 00 00 00 00 00 00 = 0x02 multiply by 2^8
Byte Offset: 00 00 00 00 00 00 00 00 = 0x03 multiply by 2^16
Byte Offset: 00 00 00 00 00 00 00 00 = 0x04 multiply by 2^38
Byte Offset: 00 00 00 00 00 00 00 00 = 0x05 multiply by 2^40
Byte Offset: 00 00 00 00 00 00 00 00 = 0x06 multiply by 2^48
Byte Offset: 00 00 00 00 00 00 00 00 = 0x07 multiply by 2^56
What does this mean?

I got
00 00 00 00 00 00 00 00
as a byte offset. Did I do it right?



None.

Sep 4 2009, 10:09 pm Heinermann Post #2

SDE, BWAPI owner, hacker.

None of that makes any sense, not even the wiki article. That's why you're confused.




Sep 4 2009, 10:23 pm xYoshix Post #3



Uhm.. I guess I was too confused even to make sense.

So basically, what I'm trying to do is have HP detection. I used artmoney to find the adress, and it came out to be 00615B51. I put it into EUD trig, and I pressed the arrow going down. It gave me the player number (P8), the Unit ID, (11903), and the byte offset (00 00 00 00 00 00 00 00). The problem is I don't know what to do with the byte offset to figure out the death value.



None.

Sep 4 2009, 10:38 pm O)FaRTy1billion[MM] Post #4

👻 👾 👽 💪

I agree. ;o

My explanation is probably no better, but it's a start....

Ok. Here is what the little "00 00 00 00 00 00 00 00" diagram means...
EUDs read data in groups of 4 bytes (as deaths have a 4-byte value), but sometimes a value might not be aligned to 4 bytes. Each 00 represents one byte. There are eight in EUDTrig just so if you have a 4-byte value that isn't properly aligned it can spill into the next group (though I don't think this happens much). Just ignore the last 4 in most cases... The first red one is the address that you used. If you have the data length set to 1, only that one will be highlighted. If you set it to 2, then two will be highlighted, etc. This is mostly just so it is pretty...

Health detection should show something like...
00 00 00 00 00 00 00 00
The first byte in this 4-byte group is a regen counter for zerg units or a fractional HP value for other units, so you probably wont know this value (which is why the value you found never includes the first byte). The remaining three are the HP value you see in SC. Because the first highlighted one is not the first 00 group shown, you will have to multiply a value you want to compare to by an exponent of 256 (shown below)... like if you wanted to test to see if a unit had 1 hp, you would multiply 1*256=256. If you wanted to test for 100 hp, 100*256=25600. Etc.

If the first highlighted byte is in these positions, multiply by the value shown:
00 00 00 00 - Multiply by 1 (Or not at all.) (1 = 0x01)
00 00 00 00 - Multiply be 256 (256 = 0x0100)
00 00 00 00 - Multiply by 65536 (65536 = 0x010000)
00 00 00 00 - Multiply by 16777216 (16777216 = 0x01000000)
-- You should never see the 5th+ bytes as the first highlighted byte, as it would give you +1 unit or +1 player.

Also, the first byte is unknown so comparing Exactly probably isn't the best idea...
To test for 100 HP, I'd test something like:
at least 100*256
at most 101*256-1
Which would test for an HP value >= 100 and < 101.

Ask questions, I'm definitely not the best at explaining these things. ;o

EDIT:
Wait, I don't see why 0xXXXXXX51 would give 00 00 00 00. ;o
I get P8//11903 and 00 00 00 00. ;o

EDIT2:
By looking at the very last digit of the address of a value, you can see what its alignment will be:
_0 _1 _2 _3
_4 _5 _6 _7
_8 _9 _A _B
_C _D _E _F
First column will be 00 00 00 00, second will be 00 00 00 00, etc.
xD I don't know if this is helpful.

Post has been edited 2 time(s), last time on Sep 4 2009, 10:45 pm by FaRTy1billion.



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!

Sep 5 2009, 12:16 am xYoshix Post #5



That helped a bit, farty. I just want to clear some things out.

Quote
EDIT:
Wait, I don't see why 0xXXXXXX51 would give 00 00 00 00. ;o
I get P8//11903 and 00 00 00 00. ;o

I re-entered the address into EUDTrig and it now came up as 00 00 00 00. Wierd :wtfage:

Quote from O)FaRTy1billion[MM]
00 00 00 00 00 00 00 00
The first byte in this 4-byte group is a regen counter for zerg units or a fractional HP value for other units, so you probably wont know this value (which is why the value you found never includes the first byte). The remaining three are the HP value you see in SC. Because the first highlighted one is not the first 00 group shown, you will have to multiply a value you want to compare to by an exponent of 256 (shown below)... like if you wanted to test to see if a unit had 1 hp, you would multiply 1*256=256. If you wanted to test for 100 hp, 100*256=25600. Etc.

If the first highlighted byte is in these positions, multiply by the value shown:
00 00 00 00 - Multiply by 1 (Or not at all.) (1 = 0x01)
00 00 00 00 - Multiply be 256 (256 = 0x0100)
00 00 00 00 - Multiply by 65536 (65536 = 0x010000)
00 00 00 00 - Multiply by 16777216 (16777216 = 0x01000000)
-- You should never see the 5th+ bytes as the first highlighted byte, as it would give you +1 unit or +1 player.

So only the first highlighted one matters? In my case, I should use multiples of 256, right?

Quote
Also, the first byte is unknown so comparing Exactly probably isn't the best idea...
To test for 100 HP, I'd test something like:
at least 100*256
at most 101*256-1
Which would test for an HP value >= 100 and < 101.
Can you explain more, please?

Quote
EDIT2:
By looking at the very last digit of the address of a value, you can see what its alignment will be:
_0 _1 _2 _3
_4 _5 _6 _7
_8 _9 _A _B
_C _D _E _F
First column will be 00 00 00 00, second will be 00 00 00 00, etc.
xD I don't know if this is helpful.
That's interesting xD I have an address to detect upgrades that ends with D. The first highlighed byte was the second one.

And I have a couple more questions. How would you find out the address for a mouse click? And how would you make EUDs do crazy things using actions? Use the set death action?



None.

Sep 5 2009, 2:06 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

hp is 4 bytes total
the first byte is 0-255, which is extra precision. This is a hidden number, you can't see it, but zerg regen works of this principle. It quickly adds 4 to this number (very small) to get a regeneration.
The next 3 bytes is the number you see in game. To read the second byte, it's 256*hp. Since the 3rd byte isn't where the hp is actually located, you don't have to worry about it, it's still 256*hp, but if you go over 256*255, you'll get into the 3rd byte naturally.

in short, the first byte is hidden, the second byte is hp.



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

Sep 5 2009, 3:19 am xYoshix Post #7



What if a unit has half a hp? (I.E 4 1/2) It seems like it's messing up the euds.



None.

Sep 5 2009, 3:21 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

as I said, the half hp is actually a hidden value. it's some number between 0-255, usually 128. when you detect life, detect a RANGE not an exact number like I did in my health detection map.

So if you have a unit which has 100 hp in game, the actual number sc is reading (and what your EUD needs to be) is 25600. If the unit gets hurt and goes down to 55.5 life, you can't actually see that .5, but you know its there. The number in SC would be somewhere between 14080-14336. More than likely it's going to be 14208, but with zerg unit's it's virtually impossible to tell.



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

Sep 5 2009, 3:26 am xYoshix Post #9



Alright, thanks. Ill try making the death condition in a range and not using exactly.



None.

Sep 5 2009, 2:56 pm xYoshix Post #10



I changed the condition from exactly (256, 512, 768) to at most and at least (1-256, 267-512, 513-768) but now the trigger doesn't work at all. I have no idea whats going on :wtfage:

Edit: I ran artmoney on it again, and the address changed! Does changing terrain and placing units change the address?



None.

Sep 5 2009, 7:05 pm rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

units, yes.



"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.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[2024-4-25. : 7:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
Please log in to shout.


Members Online: jun3hong