pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.59k stars 362 forks source link

Mods don't override sgm files (no sgm in model) #3386

Open bszlrd opened 9 years ago

bszlrd commented 9 years ago

Not sure if it's considered a bug, but while I was fiddling a bit with the default cockpit model, that if the prebuilt sgm file is present for a model, than a mod doesn't override it if it doesn't have it's own sgm file in the mod. This might be confusing in a very few cases, but I thought I report it just in case, and to document it.

fluffyfreak commented 9 years ago

Ah, yes I can see how this would happen. Not much we can do about it because the game doesn't know when it getting a mod file or an original. Or even a mod file which is overriding another mod's file.

Erm, I can only suggest that we always ship sgm's with mods. Maybe a note for the FAQ or mod questions?

bszlrd commented 9 years ago

Yeah, I just thought I mention it to document it. How do you compile .sgms exactly? I'll extend the wiki mod section with that info too.

Web-eWorks commented 3 years ago

I'll throw this one on the pile for future ModelLoader work. Will probably set it up to ensure that an SGM is referring to a specific version of a model file (probably via checksum) and then ignore / regenerate it if the SGM is out of date.

SGM is a bit of a weird solution in search of a problem - it should either be an engine-internal cache format, or the primary method of storing models and targeted via an offline tool, but right now it overlaps both incompletely, which makes it difficult to reason about how it should be used and when.

fluffyfreak commented 3 years ago

SGM is meant to be the optimised loading path and should be the only way of loading stuff in... but people didn't want that because it's an extra step and being able to load the raw models is useful during development. So it's not a cache, it's just a compromise.

A checksum would be slow, some of our models are quite large like station_hub_A.dae is 24MB.

The complication here is that our mod system is additive, so if you replaced station_hub_A.dae in a mod without providing an SGM it will still find the SGM and assume that it's the newest version.

This is partially the mod providers fault, we ship with all the tools to build the SGM file