UnvanquishedAssets / UnvanquishedAssets

The parent asset repository for the Unvanquished game project
https://unvanquished.net
10 stars 1 forks source link

md5 and md3 formats are still used #11

Open ghost opened 1 year ago

ghost commented 1 year ago

When looking at the models, I noticed that those 2 old formats are still used. Maybe it could be used to uniformize the formats used.

Of course, this is not important at all from a functional point of view. I even do not know if this would bring any advantage out of possibly reducing the complexity and number of tools required to bootstrap-build the game, but my guess is that there is a reason why new formats were implemented (and are used).

ghost commented 1 year ago

While I am at it, body.md5mesh is dupliacted for naked, light, and medium human. Using a single file for those would allow to remove ~2.4Megs from uncompressed archive size. There might be other duplicated ones or maybe even some unused ones.

illwieckz commented 1 year ago

While I am at it, body.md5mesh is dupliacted for naked, light, and medium human. Using a single file for those would allow to remove ~2.4Megs from uncompressed archive size.

Yes, the difference among them is only a matter of skin!

While all md5 models can be converted to IQM, only non-animated md3 may be converted to IQM as the way the animation is implemented is very different and not compatible, fortunately we probably got rid of animated md3 models.

If I'm right, one thing we still need md3 for is the mechanism to attach models together. For example, the third weapon models, even if not md3, are attached to an invisible md3 model… Improving this may even allow us to avoid to process this extra invisible model…

Right now md5 models are a bit faster than IQM when animated on old CPUs, I noticed places were IQM improvements can be done, especially IQM are processed with half-floats, meaning the CPU code always convert back and forth them to do any computation and this likely prevent compiler optimizations. This CPU code path is only used if GPU itself is too old to process the models, so fixing this has lower priority, but that's something I want to address.

Since the engine have code for md3, md5 and iqm, and that md3 models were heavily used in idtech3 games and mods, and md5 models were heavily used in idtech4 games and mods, it is still a good idea to make sure the engine can load and process md3 and md5 properly even if we get rid of them from Unvanquished. We can add a special package to test them in UnvanquishedTestAssets.

ghost commented 1 year ago

This issue is not about removing support, mind you, as it's likely required by various maps anyway. And I do not consider this an important issue neither.

illwieckz commented 1 year ago

Yes but it's a concern to me that support doesn't rot and got broken without being noticed. The human model being md5, I know the engine is still supporting them just by starting the game! 😁️

Before removing the last md5 models from our data, I want a ready-to-use test bed to verify I don't break the support when optimizing the model code. 😉️

ghost commented 1 year ago

And then you go proud to shave 1kiB data on IRC... I'm not sure to understand it.

illwieckz commented 1 year ago

Not dividing by three the size of the data by shipping a single md5 requiring to make sure the code still works after that has nothing to do with not replacing that single md5 with a single iqm.