STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
376
IN-GAME
2,092
ONLINE
Founded
8 November, 2013
Showing 1-3 of 3 entries
5
[PR?] Reducing file sizes by improving animation compression when linear interpolation is used.
Hello, Tom, how are you?

Due to Source's limitations I had to make a bunch of DMX models with a lot of repeating animations. Since I want to use my animations in GMod the MDL files have to be bellow a certain file size. And I think that I know how to reduce it.

Since we don't see choppy animations in Source games, I assume they use linear interpolation between animation frames.

Proposal:
I guess that skipping the frames that can be achieved by linear interpolation would decrease the file size of the final MDL. If the bone transformation is set to local space this should not cause any issues.

Questions (If you don't know, I can test them myself):
  • Is such behavior possible? If yes, then I can make a PR. If you don't know, I can try making a prototype.
  • Do you have any automated tests, so I could quickly check the implementation?
  • Is there some sort of documentation about DMX keys and values? It would save me time.
  • Should I try implementing similar behavior for SMD?
  • May this cause issues with different versions of Source?
  • Does MDL compiler forcefully saves every frame during compilation? If so, it would make this feature useless.
  • Are there any other quirks with Source Engine or MDL compiler that I should take into consideration?
  • There are two possible ways of implementing this. Which one is better? I'm leaning towards the second one.
    1. Iterate over bone's keyframes and write interframe transformations if necessary. This approach would be clean, but it probably would cause a rewrite of animation handling and this might cause issues when using constraints.
    2. Iterate over the frames and see if last n frames can be achieved through linear interpolation, if so, skip until new keyframe is found. This would not require any serious rewrite and would be very generalized. For example: we could skip some frames if sine interpolation is used, but the keyframes are arranged in a way that let's us achieve the motion through linear interpolation with small enough error.
Showing 1-3 of 3 entries