Unique object identifier
Is there any value in OpenMW which could be used as unique object identifier? I didn't find any. Any reason why there is no such?
The idea for this is any loaded object into game could be found by this value until object is unloaded and there is no two loaded objects with same identifier. Right now MWWorld::Ptr looks like and identifier, but it is contains 3 pointers, some of them could change within object lifetime. So having copy of this object could be useless if object change cell. MWWorld::Ptr::mRef is more useful. Only problem is that it is just memory address, so two different objects loaded in different time could have same mRef
.
I see this value as type of std::uint64_t
. Global counter increments on each object load and its new value assings to the new object identifier.
It could be even more useful if for single game session object will have same identifier within single game session from first load through all reloads. But I don't see how it is possible to do now.
Object identifier is required for the new pathfinding system. Also it could be very useful for debugging. An addition to this is a special render mode when identifier shows above each object in game or for specific set of objects classes.