in Engine

Castle Game Engine: November improvements: huge animation upgrade, guidelines about AI usage, Codeberg mirror, various fixes

From Castle Game Engine: link to original post

Displaying a crowd of characters animated using skinning in glTF Skinned animation of an alien Skinned animation of a fox

We have a few things to report from November. Enjoy 🙂

  1. We have merged a big branch with numerous improvements to our animation handling (skinned animation and other). The important new functionality is documented here. This merge features:
    • Skinned animation loaded from glTF is now performed on GPU (mesh is deformed using shaders). This allows such animations to be loaded much faster, take much less memory, and be more efficient at the same time. You can animate a big crowd of characters using this technique.

    • The same efficient skinned animation can be defined in X3D using new Skin node.

    • animate_bones_by_code example was updated to showcase this, including skinned animation and huge crowd test.

    • We have fixed loading/saving of matrix values from X3D.

      Testcases:

    • The OptimizeExtensiveTransformations flag is deprecated and does nothing now, because the related optimization is now done always, unconditionally, and for all animations (including Skin, H-Anim, and regular animation of transformations without the skin). The optimization has been reworked to be “always a gain”, by updating a set of sub-trees.

    • The InternalFastTransformUpdate flag does not exist anymore. This optimization is also now done always, unconditionally, for all animations, and it benefits all animations of transformations (with or without skinned animation).

    • I have a longer version of this news… but I also want to extend this work even more, in particular to pass joints information using a texture. Current implementation limits number of joints that can be handled by a shader: when the joints count is > 128 it falls back to CPU animation. We can make it better and handle almost ~any number of joints by passing their information in a different way.

  2. We have published guidelines for AI usage in Castle Game Engine.

    They are primarily for people who contribute to the engine, but the guidelines should also serve you well if you use AI in your own projects. To give a summary of my view: AI can be useful, but don’t trust it as it can also be wrong (and confuse you much). Don’t use AI to generate big unreviewed pieces of code or documentation, as they will likely have numerous problems. Start by using AI to generate smaller pieces that you understand + review + improve before committing, like for “code completion”.

    Go ahead and read the article, I go there into more details 🙂

  3. We maintain now a mirror of our repositories at Codeberg. GitHub is not your only choice 🙂 We intend to explore it more, including their CI/CD as alternative to GitHub Actions.

  4. Improved reading “extra” glTF data into X3D metadata, to put JSON contents into X3D metadata when we don’t have a better option.

  5. glTF reading is also a bit faster, as we use bounding box from glTF “accessor” (no need to calculate it on our side in some cases).

  6. Fixed and improved “Edit -> Visualize H-Anim Joints”, “Edit -> Visualize Skin Joints” in Castle Model Viewer.

  7. Workarounded Delphi 13 crashing when building our engine in release mode.

  8. Important fix for processing textures from data URI (caching was way too agreessive resulting in wrong textures used).