GothicKit / ZenKit

A re-implementation of file formats used by the early 2000's ZenGin
http://zk.gothickit.dev/
MIT License
44 stars 10 forks source link

[v1.1.0] Add heuristic for automatic world version detection #17

Closed lmichaelis closed 1 year ago

lmichaelis commented 1 year ago

One idea would be to search through the archive's key-map to find object keys only present in Gothic 2 VObs, like visualAniMode (probably unlikely to yield good results since it's in the base zCVob which is most likely packed), canMove or fadeOutSky. It might still be a good idea, however, to keep the explicit version around somehow, so consumers of the library can prevent loading the wrong version anyways.

lmichaelis commented 1 year ago

This implementation uses the version of the MeshAndBsp section saved with the world. It contains a version identifier which can actually be used to determine the world version. The function which can do that, determine_world_version, may cause significant slowdowns when loading worlds (though in release mode they should be in the 100-200ms range).