You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
In pull request #1801 I'm exploring how to create characters dynamically from a set of body parts. In the current aesthetics of threadbare is tricky, but still possible. My main goal is to replace townies of the Void quest, but it can be generalized to any amount of stacked body parts. I simplified a lot to avoid drawing too much:
Only an "idle" animation with just 3 frames (like the ones proposed in the template).
Not too many layers: body contains hands, "legs" contains pelvis and shadow.
Update: I started redrawing all the parts today, and couldn't finish animating them. So the 3 frames of the "idle" animation are the same. So you'll have to use your imagination and believe me that these static characters can be in motion.
Here is how the townie character can be randomized in a test scene (the scene is playable here):
The animations of each part has to be coordinated (played at the same time). Works fine for a single "idle" animation, but what about having multiple animations like "walk" or "defeated"? The solution could be to use an AnimationPlayer node with one track per part.
The existing RandomFrameSpriteBehavior can't be used, so character_randomizer.gd duplicates some code. This could be improved by having a new behavior that works for an array of sprites.
Other things tried
While doing this I found that Godot has a Texture2DArray, and I thought that it could be used to keep all parts in the same SpriteFrames, in a single AnimatedSprite2D. But it doesn't work: SpriteFrames animations need a Texture2D, and Texture2DArray is not a subclass of it. I was able to build such texture from multiple images (body parts), but that's how far I went.
Texture2D may still be built by blitting images at runtime, and this would allow to treat all parts at once, and for instance using RandomFrameSpriteBehavior, or being a drop-in replacement for the existing characters, which use a single AnimatedSprite2D for the visuals. So this option is worth being explored, while probably very bad at performance. The advantage of my nodes-based exploration is that each body part is a node, so is easier to understand by inspecting the scene in the Godot editor.
I learned a lot while doing this, including some scripting in Aseprite with Lua. Here is a script to export all the body parts as sprite sheets in PNG.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
In pull request #1801 I'm exploring how to create characters dynamically from a set of body parts. In the current aesthetics of threadbare is tricky, but still possible. My main goal is to replace townies of the Void quest, but it can be generalized to any amount of stacked body parts. I simplified a lot to avoid drawing too much:
Update: I started redrawing all the parts today, and couldn't finish animating them. So the 3 frames of the "idle" animation are the same. So you'll have to use your imagination and believe me that these static characters can be in motion.
Here is how the townie character can be randomized in a test scene (the scene is playable here):
Grabacion.de.pantalla.desde.2025-12-31.17-00-13.webm
Here is how the townie character scene looks. This implementation uses an AnimatedSprite2D per body part:
Grabacion.de.pantalla.desde.2025-12-31.16-59-30.webm
And here is how the Aseprite file looks:
Grabacion.de.pantalla.desde.2025-12-31.16-57-52.webm
Limitations
The animations of each part has to be coordinated (played at the same time). Works fine for a single "idle" animation, but what about having multiple animations like "walk" or "defeated"? The solution could be to use an AnimationPlayer node with one track per part.
The existing RandomFrameSpriteBehavior can't be used, so character_randomizer.gd duplicates some code. This could be improved by having a new behavior that works for an array of sprites.
Other things tried
While doing this I found that Godot has a Texture2DArray, and I thought that it could be used to keep all parts in the same SpriteFrames, in a single AnimatedSprite2D. But it doesn't work: SpriteFrames animations need a Texture2D, and Texture2DArray is not a subclass of it. I was able to build such texture from multiple images (body parts), but that's how far I went.
Texture2D may still be built by blitting images at runtime, and this would allow to treat all parts at once, and for instance using RandomFrameSpriteBehavior, or being a drop-in replacement for the existing characters, which use a single AnimatedSprite2D for the visuals. So this option is worth being explored, while probably very bad at performance. The advantage of my nodes-based exploration is that each body part is a node, so is easier to understand by inspecting the scene in the Godot editor.
I learned a lot while doing this, including some scripting in Aseprite with Lua. Here is a script to export all the body parts as sprite sheets in PNG.
Beta Was this translation helpful? Give feedback.
All reactions