Harmony Gaming SDK 2022 Release Notes

Exporting From Harmony

Feature Description
New Exporter Options

To facilitate better support within Game Editors, the Export to Sprite Sheet interface has been given some additional features to pack more information into the exported file.

New Options

  • Palette selection tab - Exclude certain palettes that you don’t want included in your exported file, this will cover all possible variations of palettes that will result in different colors showing on the character

  • Encode to TBG - zips the XML files to the TBG custom file format so that they may be imported to Unity with Unity custom importers. When the files are imported, they will be treated like any asset in Unity and will contain sub-assets for textures, sprites, and animations. This improves the ergonomics of creating and moving character data and checking changes into source control.

  • Improved performance on “Save and Export” - Exporting process generally takes 1/3 of the time compared to Harmony 21, for both XML folders and .tbg files

“bake_” Groups

There are many nodes that are not possible to render in the Game SDK currently. As a means of bringing in the value of those nodes to your export, there is a new feature to group drawings and the nodes that affect them into a new group with the “bake_” prefix (eg. bake_hips).

Any group named with the “bake_” prefix will be analysed for unique frames of animation for effects, movements, and drawing substitutions. When exported to a spritesheet, each unique frame from this group will export as a sprite. If many frames of the timeline have nothing changed within that group, it will all be considered the same exported sprite in the spritesheet

Importing TBG files in Unity

Feature Description
Automatic Importing Process

Unity will automatically detect changes to TBG files and re-import them using a custom importer. The file can then be dragged into the scene as a prefab, much like you’d expect from an FBX file.

Textures, sprites, animations and TbgStore assets will be generated and provided as sub-assets underneath the main TBG prefab asset. These assets will not have to be managed separately in source control, and only exist in Unity’s library cache. An AnimatorController and SpriteSheet asset are generated beside the character, since these are unable to operate as sub-assets.

Importer Settings

The Importing process can be modified from the settings in the inspector view.

Animation Settings

  • Discretization Step - The number of columns / rows that sprites will get split into if they are being deformed by bones.

  • Framerate - The number of frames per second that the animation runs at.

  • Stepped - Disable interpolation between authored frames.

  • Create Animator Controller - Disable interpolation between authored frames.

  • AnimatorController - Provides a workspace to transition animations to one another given certain conditions. Can be referenced in gameplay scripts to trigger animations during gameplay.

  • Maintain Curves On Cloned Clips - Curves duplicated from clip sub-assets inside .tbg file (and referenced in the AnimatorController) will have their curves overridden with new data from the updated .tbg file.

Material Settings

  • Shader - Used to render all sprites in the prefab

  • SRGBTexture - Map gamma color space from textures into Linear color space rendering

  • FilterMode - How neighboring pixels of the texture interpolate

  • MipmapEnabled - Generate lower resolution textures to render at further distances

  • CreateSpriteAtlas - If no SpriteAtlas is referenced below, a new SpriteAtlas asset will be created in the project beside the .tbg file

  • SpriteAtlas - All sprites from the .tbg file can be added to a SpriteAtlas, when done will be able to combine multiple novel SpriteRenderers into a single drawcall, improving rendering performance

Rendering TBG files in Unity

Feature Description
Prefab Hierarchy

The structure of the generated prefab in Unity should match the hierarchical structure set up in the Timeline in Harmony. Harmony’s Node view structure of composites feeding into the output node are excluded during export.

New GameObjects can be attached to any of these child peg transforms. This allows procedural equipment attachment.

Also, any GameObject can be enabled or disabled at runtime, so optional visual additions on characters can be hidden until they’re needed. The hierarchy could also be entirely decomposed, restructured, or duplicated at runtime. This allows the option to explode characters or shoot certain drawings as projectiles.

TBG Renderer Settings The resolution, palette, material, color, and skins can be edited from the Inspector as well as the GameObject's custom scripts. The material and color for SpriteRenderers can also be set individually per drawing, so you can change the colors of a character’s accessories or provide special effects to some drawings through custom shaders.
2D Animation Package Integration Drawings deformed by GameBones in Harmony will be translated into SpriteSkin bones in Unity using Unity’s “2D Animation Package”. This package provides support for multi-threaded high-performance mesh deformation for SpriteRenderers as well as UI handles for moving bones in the Scene view. The bone chain can be procedurally animated using Unity’s “IK Manager 2D” for blending in aiming, leaning, jiggling, waving effects, etc. after the animation Update step.
Animations

All animation data is exported from Harmony per peg, so all intermediate rotations and scales are represented in the Animation window in Unity. Animations can be modified once their associated AnimationClip asset is duplicated from a TBG sub-asset to a novel asset in the project, allowing events to be added and additional curves to be provided within Unity.

AnimationClips are selected through an AnimatorController, providing a means of transitioning between animations, either immediately or with smooth blending of peg transforms.

Shader Graph Integration Compatible shadergraph shaders are provided as part of the SDK that can be duplicated and modified, allowing for an easy interface to introduce custom game-specific visual effects on your characters.

HarmonyRenderer Improvements (XML Folders)

Feature Description
HarmonyProject Preview Upon selecting a character in the Unity assets folder, a preview of the character will appear in the preview window. The preview window plays a preview of the character’s animations, and you will have the option to change skins without needing to drag the character into the scene view.

Fixes

The following issues have been fixed in this release of the Harmony Game SDK:

HarmonyRenderer

  • Anchors previously would leak memory while updating Anchor transforms. An update to the HarmonyRenderer C++ plugin resolves this issue.

  • HarmonyRenderers have improved rendering performance. Will now receive new meshes from the HarmonyRenderer C++ plugin that can be passed directly to Unity’s C++ backend using newer Unity mesh generation features. This greatly reduces time taken to update animations on HarmonyRenderer characters, allowing for more characters on-screen at once.