January 2024
General
Now that I can animate geometry much more easily, my focus this month has been on tools and animation management.
Digestive System Integration
As with every part of the game today, the digestive system is managed on a modular basis.
- I have a base module that manages basic technology and resources.
- And a module that makes use of that technology specifically for Talas, with assets for the digestive system such as 3D models, animations, and configuration files.
During this month, I have updated a part of the game to make proper use of the new modules and to remove the old assets that are now useless.
Everything is now working as it did before, but with the addition of the new digestive system of Talas.
Game Properties
I've done a major overhaul and a complete refactoring of my property system.
I've separated the code and management of properties from their use in the game interface.
Now this works more or less like the properties in the Blender API and the game settings in the Lyra game example.
The game has a property class for many types, each with its own attributes such as title, description, maximum and minimum values, and so on.
Each property has its own set of functions, such as to get the normalized value for the float properties.
Another function, for example, can return a formatted value, such as displaying one as a percentage.
This is now handled by the value class itself, rather than by the interface as it was before.
Gamemaster properties and tools also use this property class now.
In the end, the code is better, and it will be easier to adapt it to different contexts.
Modifier Tools
Last month I explained how I was able to animate the walls of Talas' digestive system using the GPU, while the CPU handles collisions and physics in real time.
The basic computation is deterministic and will always behave like a wave, in the same way and repeatedly.
This is a good basis for the animations, but I need to have more control to be able to make each zone a unique one with its own peculiarities and interactions.
Thus, I created "modifiers" that locally modify the animation.
Many thanks to Torvid for his help with the modifier vector calculation.
Each modifier has a position and a configuration that I can use to animate it.
It works a bit like layers in image editing software.
Using multiple modifiers, I can have a fairly advanced animation.
Since the animation of the modifiers is not deterministic, the position and configuration of each modifier at each frame has to be passed to the animation engine animating the walls of the digestive tract.
That's pretty simple on the CPU side, but it's much more complicated on the GPU side because I have to transfer all that data back to the shaders.
I told you how I used capsules to transfer the shape of the hands into the shader to simulate the friction of cleaning Talas' paws in the August 2023 development diary.
Well, it's the same principle for modifiers. It's just more advanced and optimized.
The CPU does the data transfer on a texture, which is then read by the shader on the GPU side.
Data like position, rotation and various parameters are stored for each pixel.
Thanks again to Torvid for giving me a more optimized method than Render Target Textures...
Before the data is transferred, the CPU will select and filter only the data that it needs in order to optimize the cost of computation and memory.
Modifier Animations Tools
Now that the modifiers are working, I need an easy way to animate them.
Some modifiers are handled directly by the actors. For example, the player pushes walls around him as he moves through the digestive system.
Other modifiers are animated through a rig, in much the same way that you would animate a 3D character.
This is useful for animations that are very specific in nature or for animations that need to be triggered by events in the game.
Finally, some of the modifiers are animated directly using a 3D curve (spline),
This is commonly used to animate cycles along a digestive tract.
Digestive System Animations
Now I have all the tools I need to create beautiful animations.
I have prepared a document in which I have defined all the animations that I'm going to create.
Some of the digestive system will be fully dynamic, animating and changing depending on the context of the game.
For example, Talas' crop will have 3 animations to swallow, regurgitate, or squeeze food.
Other animations will be more constant, such as the small intestine moving forward.
Other
I've continued to work on a few additional projects that are either directly or indirectly useful to me in the development process.
I've updated this little tool I made for 'Talas and Cobble in the Forest'. You can find it in my Discord.gallery.
While working on the Digestive System Rig, I've updated my Blender plugin to generate the Rig and can now export and import the Rig configuration.
I've updated my 'Blender for Unreal Engine' plugin to export curves.
More specifically, it is used to export curves of the digestive system.
See more: Devblogs - Wips Telegram Chanel - Discord Chanel - Support the game - MMVS game