Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Animatable template & animation transparency customization settings

Open Starkku opened this issue 1 year ago • 6 comments

Split from #1300


Customizable animation transparency settings

  • Translucency.Cloaked can be used to override Translucency on animations attached to currently cloaked TechnoTypes.
  • Both Translucency and Translucency.Cloaked can use the new keyframe system to animate along with the animation. Read more about the keyframe system below.
  • If interpolation is enabled, the keyframe values are clamped to valid transparency values (0,25,50 and 75), e.g a value of 1.5 would become 0 and 56.525 would become 50 and so on.

In artmd.ini:

[SOMEANIM]             ; AnimationType
Translucency=0         ; integer - only accepted values are 75, 50, 25 and 0.
Translucency.Cloaked=  ; integer - only accepted values are 75, 50, 25 and 0.

Keyframe animations (Animatable template)

  • Some features use keyframe-based animation system to define animations in INI. Defined in INI it looks something like following.
[SOMESECTION]
BASEKEY.KeyframeN.Value=        ; Key-dependant value type
BASEKEY.KeyframeN.Percentage=   ; floating point value, percents or absolute
BASEKEY.KeyframeN.Absolute=     ; integer, zero-based frame index
BASEKEY.Interpolation=none      ; Interpolation mode (none|linear)
BASEKEY.ResetData=false         ; boolean
  • BASEKEY is whatever base key name the feature in question may use. N is zero-based keyframe index. If no keyframes are defined, a single value from BASEKEY is attempted to be parsed instead.
    • Value is a key/feature-dependant value type associated with that keyframe.
    • Percentage is the percentage through the animation's frames where the keyframe becomes active. It is also possible to instead use zero-based frame index via Absolute which takes precedence over percentage, albeit it is internally converted to a percentage value.
    • Interpolation controls interpolation of values between keyframes. The behaviour here may depend on the value type in use, as not all value types may be interpolatable well or at all.
    • ResetData if set to true makes it so that all existing keyframe data is reset before parsing. Can be used to reset keyframes when redefining them in map files etc.
Keyframes are expected to be defined with no duplicates for Percentage or Absolute. Failure to do so will crash the game and output developer warnings about offending keys to the log.

Starkku avatar Jul 11 '24 13:07 Starkku

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Jul 11 '24 13:07 github-actions[bot]

Now uses @Metadorius's Animatable template that allows defining arbitrary keyframe animations in INI.

Might require testing to see if there's a noticeable performance overhead from the template.

Starkku avatar Sep 29 '24 21:09 Starkku

Updated credits & docs, ready for another review pass and/or further testing if needed, if not then merging.

Starkku avatar Mar 28 '25 09:03 Starkku

tested and worked

Coronia avatar Jun 23 '25 10:06 Coronia

This is actually complete and has been for a while. If @Metadorius wants to give a quick check that all the issues brought up in previous comment are addressed and/or otherwise give it a glance I'd say it is good to merge after that.

Starkku avatar Nov 09 '25 12:11 Starkku