nifxml icon indicating copy to clipboard operation
nifxml copied to clipboard

Conflicting info about PlatformID/RendererID

Open Not-Nik opened this issue 2 years ago • 2 comments

In the info for PlatformID it says "later than 30.1" and for RendererID "until 30.1", but in NiPersistentSrcTextureRendererData PlatformID is marked as until 30.1.0.0 and RendererID as since 30.1.0.1. Neither of those types have a versions attribute, so this is quite confusing.

Not-Nik avatar Apr 28 '22 17:04 Not-Nik

I probably swapped the until/later in the docstrings by mistake. The docstrings have no semantic value and only show up in doc gen. Enums in general aren't versioned -- except Bethesda-specific ones, which really only serve as documentation. There isn't much use in versioning an enum aside from stripping types during codegen or xmlgen (rewriting nifxml with pared down versions).

Enums don't have to have matching versions to the fields that use them either, unless the field is available in a version that the enum is not. This would only be a problem for anything actually validating the versioning, which I'm not sure anything publicly pushed does. Enums without the version attribute are always available. We cannot always be sure about when Gamebryo types were introduced or removed, so enums, structs, niobject, etc. only get version attributes when absolutely sure.

The since/until in NiPersistentSrcTextureRendererData are not documentation and are the only versions that matter, and are correct. You can easily tell which enum is newer because one has D3D11 and the other does not.

RendererID is from a Gamebryo namespace that has nothing to do specifically with NiPersistentSrcTextureRendererData so the versions on those fields should not dictate the versions of the enums. Even though it's the only type currently using those enums, that could change, and the other types may use them with different since/until values.

Hope that clarified everything. Tl;dr - The only versions that matter are on the fields, everything else is essentially just documentation/metadata.

hexabits avatar May 01 '22 20:05 hexabits

Off-Topic to the issue: Just so this is mentioned somewhere, PlatformID is only a temporary backwards compatibility (BC) enum used in Gamebryo for deserializing older versions, and has nothing to do with efd::SystemDesc::PlatformID which has different enum values entirely. efd::SystemDesc is also where RendererID lies, so I got very confused while formulating the response, wondering where I was getting these names from, since the enum values do not match.

The PlatformID in nifxml is NiPersistentSrcTextureRendererData::PlatformID, the values of which are set in stone, so the UNKNOWN_ values added from my unknown values audit must have come from the enum used before the BC enum (i.e. older Gamebryo versions). So ideally, a third enum should actually be introduced, PlatformID should be renamed to something like NiPersistentSrcTextureRendererData__PlatformID, and the third enum should contain the unknown pre-BC values. Because NiPersistentSrcTextureRendererData::PlatformID does not contain the enum values 6-8 at least in the Gamebryo versions I have looked at.

hexabits avatar May 01 '22 20:05 hexabits