RagnarokFileFormats
RagnarokFileFormats copied to clipboard
Research the iRO alpha client's GND format
Using https://github.com/flaviojs/eathena-devel-FlavioJS/blob/master/client/file_formats/gnd.txt as a source, rendering the maps is already possible. However, there are some bytes unaccounted for.
According to this video, those maps do support at least the shadow map texture present in modern versions. The author also seemingly used a map converter, but I was unable to find it anywhere and they no longer have it (apparently).
Looks like the maps available here are already converted to GND version 1.7.
While that's not sufficient by itself, it could help with verifying the results of my own research later.
As expected, the alpha maps don't have any lightmap data (only shadows). This is easily seen after loading the converted maps, as the entirety of the lightmap cache features 100% black texture images.
Also, some maps aren't working at all: prt_dugn01.rsw crashes the decoder; apparently the last scene object (expected to be a light source) references a .spr file? That's really weird.
The SPR object being present makes me think of Arcturus, so that might be another venue of research. Perhaps they just lifted the format from there, possibly with minor modifications?
Either way, this is completely unimportant so I'm shelving it for the time being.
Just randomly found this while checking some lightmap-related stuff. I'd guess that the 68 "???" bytes outlined in the OP are 64 alpha values (one byte each, 8x8 lightmap slices as usual), i.e. the intensity data also contained in more modern GND versions... and maybe a 4 byte format identifier or version tag? From the video we know it's there, so where else would it be?
This is just for whenever I have time to investigate further. Should be easy enough to test. (Edit: Can also test against the converted GND files, they should have the same 64 shadowmap pixels and no lightmap pixels)
Found some old notes that indicate the old format may just be a 64x64 texture applied on each GAT tile, that is 256x256 for one GND cube. That would (in principle) match the above assumption, though I didn't find any source or verification/test results in the notes, so for now it's nothing more than a theory - and the details seem nebulous, AKA needs further research.
If there is an alpha map with a colored lightmap it wouldn't work out, but if it's just alpha/intensity values then this could well be how it works. This approach does seem rather wasteful, which might explain why it was changed to use lookups in the current-day version.
Looking at my notes, it seems it's just the UVs for the other two surfaces (4 floats times 8 = 32 per surface, 64 total). Before that, one unknown value (possibly int), no indication in my notes as to what the usage was. Will revisit this later, maybe.