rdw-archive / RagnarokFileFormats

A manifest of the various file types used in the Ragnarok Online client
77 stars 23 forks source link

Research the changes made in GND version 1.8 #44

Closed rdw-software closed 2 years ago

rdw-software commented 2 years ago

GAT 1.3, GND 1.6 and RSW 2.6, the waterinfo is still not correct for those new, they removed waterinfo in RSW 2.6 and moved it to GND 1.6 (they changed that somewhere between 2021-11-03 and 2021-11-16)

Source: Discord

rdw-software commented 2 years ago

As mentioned in #45, this is almost certainly referring to GND 1.8. There is (at least) 14 files using this version:

rdw-software commented 2 years ago

Looks like there's now 36 bytes of RSW water info at the end of the GND file. The first 24 are likely the same info as existed before (six four-byte values). The rest one I'm less sure about, possibly a wind effect (direction X/Y and speed, also four bytes each)? If that is correct, the wind vectors are always normalized (and 1,1 - which would be the default direction?).

Obviously: This is pure conjecture since I can't see those maps in action anywhere. There's only so much you can do with a water plane, however, and I doubt they're rewriting their rendering engine to implement something completely unrelated all of a sudden.

Preliminary results:

image

So far this seems like a decent enough first guess, which of course still needs to be verified somehow.

rdw-software commented 2 years ago

That first guess is almost certainly wrong. After finding some kRO videos, there is something odd about the water - it seems to be disturbed in its animation, but the disturbance isn't quite like what a regular physics-based system would induce (wind vectors and velocity are typical configuration parameters in such a system, hence my initial guess).

Instead I'm almost certain the first two numbers are some sort of "width and height" or other co-related properties, that describe how many different animations there are, with the latter possibly being a timeout or other criterion for switching between them. In 1.8 there is just one, which leaves open the question of how the "time" (assuming it is one) would be used in this case.

After looking into 1.9, it seems as though the number of water plane configurations (which is higher than one in 1.9) is directly defined by these coordinates or whatever they are, e.g. 3, 7 result in 3*9=27 alternating sets of data that have the same structure as the initial water plane configuration.

Still guessing here, but... Is it possible they are simply switching up animations on the fly, or applying them with a timeout to individual parts of the water plane to generate more disturbances in the surface of the water? That would at least explain why it looks so "agitated" on some maps, but there is at least one map that doesn't have this effect (clock_01) so that needs looking into as well.

Research is still ongoing and I need to check out the other maps, but this seems to be a better explanation.

Edit: clock_01.gnd is obviously 1.8 and not 1.9, which explains why there's no visible disturbance. I can't find videos for the other 1.8 maps since I've no idea what they're used for, but my guess is that all the 1.8 maps simply have one water plane that works similarly to the one in previous versions (possibly with the third value being a "pause for X time" setting if there aren't other animations). Clearly, this was extended in 1.9 somehow (WIP).

rdw-software commented 2 years ago

Another update: There's no "third value" in 1.9, instead it's just a set of configurations. So clearly it's not multiple animations. Seeing how the water levels for icecastle.gnd are different but everything else is identical, I'm guessing there's simply multiple parts of the water plane that can have different configurations. This would explain how they can be at different heights (see RSW 2.6 issue), but not how it is determined which configuration to apply where, and how.

rdw-software commented 2 years ago

The last value is just the waterLevel again... I was expecting something more interesting.

I'm guessing what happened here is that they wanted to implement multiple water planes at different heights (as in 1.9), so they added a numWaterPlanes (u) and numWaterPlanes (v) setting and then simply a list of floats describing the height of each water plane... Except there's just one in all the maps using this version so it's ultimately pointless.

Shortly thereafter, they clearly decided they now want to adjust the individual water plane properties as well and turned said list of water levels into a full-fledged copy of the original water plane configuration in 1.9? Either way, mystery solved I guess.

Edit: I also found a kRO video showing bl_grass and there's absolutely nothing out of the ordinary about the water plane.

rdw-software commented 2 years ago

Added via 1cb5609.