Researching the Unknown 16

People seem to refer to the (mesh) object hex value as the "unknown 16", probably because there are 16 bytes and what each byte does it not entirely known. I will call this "U-16" for convenience. I've been going through all of illusion's maps looking at how they set their hex values and have noticed some patterns that may be useful when you're creating your own maps.

After looking through about 100 maps from different games like Yuusha, @HomeMate, Sexy Beach 3, Battle Raper 2, Oppai Slider 2, etc. this is a list of things that I have concluded. The terminology can be refined, but I don't know what they're called in this field.

When importing meshes through the 3D tab, the unknown 16 string is usually assigned

02-64-00-00 00-00-00-00 00-00-00-00 00-00-00-00

(For terminology, each pair of digits is a "byte".
So the first byte in this string is 02, and the second byte is 64)

However this is inadequate for all cases. You have different meshes that serve different purposes such as shadow effects, light effects, transparency (textures with transparent regions),  translucency (ie: looking through a foggy window), reflections (mirror), and so on.

If you simply assign this same hex string to all meshes, they will not appear properly.
To improve the look and feel of your map, you will need to manually adjust individual meshes one at a time depending on what they're for.

It is important to note that if a value is "invalid", the mesh simply won't show up.

Byte 1 - transparency and effects

The first byte determines how the mesh (or maybe the textures) will appear. Several common values were noted between all of the maps:

00 and 02 - these were used for solid meshes. Nothing special
04 and 06 - these were used for meshes that gave a "light" effect.
08 and 0A - these were used for meshes that were "shadows"

For comparison, take a look at the following pictures of a light in a small shack.



From top to bottom, we have 00, 04, and 08. It isn't too hard to notice the differences in the textures.
Other values that were common are 0C and 0E.

I then noticed meshes that started with 46, 4C, and 4E. The higher the value, the more transparent the mesh is. Additionally all of them had a common property: they had transparent textures somewhere. However, the first byte alone does not do anything: you will need to combine it with the 9th byte. An example would be this post

The 9th byte I am not too clear what it's for, but values I have seen are 78, 80, and A0.
The most common combination of 1st and 9th byte is "4C and 80". This is used to render transparent textures properly and, as seen in the post, make sure that those meshes appear in front of objects that are behind it.

The following bytes all had values set:

2nd byte
3rd byte - appears to be backface culling
5th byte
6th byte
9th byte

All other bytes were 00. Presumably they are unused.
Previous I had assumed "01" disables backface culling, but based on my tests with the first byte, that may not be the case and it may be just an invalid value. 00 enables backface culling, but I haven't tried any other values yet.

Why 02, 04, 06, 08, 0A, 0C, and 0E?
I'm not sure, but if you convert it to binary, it may be setting bit-fields.

0x00 = 0000
0x02 = 0010
0x04 = 0100
0x06 = 0110
0x08 = 1000
0x0A = 1010
0x0C = 1100
0x0E = 1110

One should also note UnknownA ad UnknownB values.
They seem to deal mainly with water, but I haven't found any patterns at all amongst any water meshes.

No comments:

Post a Comment