OpenAWE-Project / OpenAWE

A reimplementation of Remedy Entertainments Alan Wake Engine, in later iterations known as the Northlight Engine
GNU General Public License v3.0
159 stars 13 forks source link

Should rid be a u64? #40

Closed mandar1jn closed 5 months ago

mandar1jn commented 5 months ago

When dumping the content of a rmdp file, we get a lot of meta files. All these files contain a r::ResourceMetadata property. These have a m_rid variable with a value that looks like "0x5172369b0bce2ff9". This is a u64 and not a u32. This also removes the need for the PackMeta file to skip a lot of bytes

maaxxaam commented 5 months ago

Hello and thank you for the interest in the project! If you don't mind, it would be great if you could clarify a few things to help understand the issue better:

When dumping the content of a rmdp file, we get a lot of meta files.

  1. Are you talking about any specific Remedy title or all games supported by the tooling in general? These have a m_rid variable with a value that looks like "0x5172369b0bce2ff9".
  2. Is this an example of one of possible values or is this a constant across many similar structures (according to your observations)? This is a u64 and not a u32. This also removes the need for the PackMeta file to skip a lot of bytes
  3. As af as I can understand your concern, this variable might have the wrong size, making code manually skip a lot. Do you think that this is some sort of a file pointer offset or just that data is read incorrectly by the tooling?
  4. In your opinion, why are the next four bytes after the m_rid field a part of it and not a separate value instead?
Nostritius commented 5 months ago

Maybe I can clarify some things here, the rid is used by the level description to reference resources like sounds, meshes or textures. If an object in the scene uses for example a specific mesh, it describes it by the rid. I am aware, that starting from Quantum Break, this id is extended to 64 bit. However since we currently focus the work on the first two Alan Wake games (and by extension Alan wake Remastered which also uses 32 bit rids), such a change is currently a very low priority.

mandar1jn commented 5 months ago

ah, okay. I haven't looked at alan wake so I just assumed it was always a u64.