I'm sure that anyone who ever come across these tool compile errors -
the meter definition ui\hud\cyborg shield does not specify a stencil bitmap group.
the meter definition ui\hud\cyborg body does not specify a stencil bitmap group.
has been at least a little curious as to what's in them and why they are there.
The error is because guerilla doesnt know about the stencil data im about to talk about,
so if you resave a meter tag after opening it, guerilla erases the stencil data and
then tool complains that it isnt there. This doesnt matter for custom edition maps,
but xbox maps wont load without a valid stencil.
Well I got bored yesterday and decided to give it a crack. Through knowledge of
binary structures and hunches I was able to determine that the actual stencil data
is stored in a slightly compressed format, where the image is divided up into
horizontal lines that each have a 6 byte little endian header composed of unsigned
x and y offsets that the line starts at and the number of pixels wide the line is.
The header is ordered like this:
0:{ TYPE:UInt16, NAME:"X_Pos" }
1:{ TYPE:UInt16, NAME:"Y_Pos" }
2:{ TYPE:UInt16, NAME:"Width" }
There is nothing specifying how many lines exist, so you just have to try to read
another line and if there isnt enough data then you've reached the last line.
The body of the tag's data specifies the dimensions that the meter image will be
when uncompressed. This is in a field that is hidden from guerilla, but is easy
enough to locate in a hex editor. Meter_Width is at offset 212 and Meter_Height
is at offset 214. Both are little endian unsigned Int16s
Using all of this knowledge, I was able to write an extractor that assembled the lines
of ui/cyborg_body.meter and ui/cyborg_shield.meter into a single tga image.
The red channel is completely blank for some reason, the green channel LOOKS like
its 90% noise, the blue channel looks like its probably the image opacity, and the
alpha seems to pretty clearly be the meter gradient mask.
ARGB:

Alpha:

Red:

Green:

Blue:

I know that you guys have to be completely enthralled with this super useful discovery.
Seriously though, I was hoping to find some kind of hidden halo asset that none of us had
ever seen before and it'd be kinda cool to look at, like something in a museum.
Thought some of you might find it interesting.
Here's a link to a folder containing all of the image data separated into channels and with the
original raw image as well. The combined.tga is the raw data that has been untouched by
photoshop's grimy tweaking hands(photoshop likes to rescale values before saving), so if
anyone wants to try and figure out how the image color data is represented, that's your best bet.
https://www.dropbox.com/sh/4kv854tdwf3rwqt/AABBiL2mJMnj4aAVba844IDGa?lst
EDIT:
Actually, if you look at ui/hud/bitmaps/hud_health_stencil.bitmap you'll see that
the bitmap 0 merged with bitmap 2 make up the blue channel above and bitmap 1 merged
with bitmap 3(masked off by the blue channel) make up the alpha.
This is starting to lead me to believe they really did just end up corrupting the
green channel somehow. Either that or they only wanted the opacity and meter mask.
They could do this by using the blue channel as the transparency for a solid color
that they determined by mixing the empty_color and full_color(defined in the tag)
based on how full the units health of shield is. Idk, need to get back to homework tho.
Edited by MosesofEgypt on Jan 18, 2016 at 02:40 PM