Skip to content

ELF32bit/godot-mapper-characters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animation system for godot-mapper plugin

Demonstration
This frame-by-frame animation system aims to improve map prefab creation.
While more powerful animation tools exist, often a simpler solution can be more handy.
The ability to work with the single and flexible asset format is great for prototyping ideas.

Explanation (for TrenchBroom maps)

Maps inside characters directory are scanned for layer names like RUN->3.5, IDLE->0.
The build system will then construct the animation table that switches visibility of the layers.
info_animation entity stores additional animation parameters as RUN | { "loop_mode": 1 }.

  • loop_mode can be 0 (none), 1 (loop), 2 (ping pong). 1 is default.
  • frame_duration multiplies layer number (frame number) by the duration.
  • fade is an array of fade percentages like [0.5, 0.75, 0.9] for previous frames.
  • fade_loop set to True will enable a smoother transition for looping animations.
  • fade_before set to False will disable after-images of previous frames.
  • fade_after set to True will enable after-images for future frames.
  • fade_mode interpolation can be 0 (none), 1 (linear), 2 (cubic).

info_animation also supports the following properties.

  • autoplay animation name will be used as the default animation.
  • fade_visibility_end distance after which after-images will be hidden.
  • visibility_end distance in units. 0 is default, meaning disabled.
  • cast_shadow can be 0 (disabled), 1 (on), 2 (double sided).

Layers named like OPEN->0 | CLOSE->9 | ... will be reused in multiple animations.

Animation layers can contain specially constructed point and brush entities.
For example, certain frames might need hit boxes or moving lights.
One-shot audio, particles and activatable scripts are supported.
All other layers will be parsed as the global STORAGE node.

Transparent after-images

Characters must use override shader materials with fade property from 0 to 1.
Additionally, the materials can implement fade_index property <0 (before), >0 (after).
Furthemore, the materials need to have depth_prepass_alpha render mode.

Depth prepass is disabled in Mobile renderer, so there is a workaround.

Override materials can provide fade_material metadata with a simpler transparency.
If the override material provides such metadata, then it itself should not use fade property.
The animation system will then use different materials for the character and the after-images.

Swappable weapons/items from the STORAGE node will not generate after-images.

Modular parts require an invisible placeholder geometry to be present in the animation layers.
Wrap such geometry into a special brush entity and construct a scripted node in place.
The scripts can then instantiate the similarly shaped children parts at runtime.

About

Character animation system for godot-mapper plugin

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors