ESM3, ESM4 mId and mFormId. How to handle IDs in the post Morrowind world.
This issue relates to &3, between esm3 types and esm4 types there is one major difference. mId
of a ESM3
type is a std::string
, but ESM4
types don't all have a string ID, but all of them have a mFormID
that is a u32
.
Sometimes, an ESM4 type will have a std::string mEditorId
. I imagine to have a name displayed in the construction set, it probably shouldn't be used to identify records in the game.
I don't think we should transform mFormID
to an std::string
, because an integer is more performant in pretty much every operation that can be done with an ID.
right now, in the engine we sometimes identify records by their string id, and that wouldn't be applicable to the new ESM4 types. class CellRef
for example has many string identifier. mSoul
, mFaction
, mDestCell
, mKey
, mTrap
etc... And that wouldn't really work with ESM4s.
This issue is here to discuss our options, what could be done to better handle those cases. There will probably be specific code to handle those cases, but we need to avoid having those leaking everywhere in the code. We don't want to make IDs hard to use, and the code hard to read.