Replies: 2 comments 1 reply
-
|
I wrote some notes about this in January, somewhere, but apparently never pressed "submit" and now they are lost. :( I think this a really cool lightweight way to make the townies/unnamed characters in the game have a bit more, well... character. It's a nice complement to providing opportunities for contributors to draw their own unique art. For example, I suggest that we could replace the sprites for the 5 static NPCs (Farmer, FarmersPartner, GardenerA, GardenerB, and the tutorial Talker) with this randomised art. What complicates this a little bit is that I think you should be able to talk to all of them. So I'm not quite sure what the scene structure would be here.
My money is on 2. It's a little bit of code duplication in one place, but makes it easy to drop new townies you can chat to into any scene. |
Beta Was this translation helpful? Give feedback.
-
|
This exploration is in the main game now! Closing. |
Beta Was this translation helpful? Give feedback.
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