I want to build a character customization system similar to stardew valley but don't even know where to begin... I've done research know the coloring is done via shaders but the tutorials I've found all have comments saying it's not optimized properly... Can someone please make a proper tutorial on this?
Character Customization similar to Stardew Valley...
Id like to create character customization like in mordhau where you can change facial expressions, and scale of the character itself (midgets) Also voice customization would be fun. Its all in my head, so once i get to it i might post my results here on how to.
So far i would somehow keep the customizable data in the player class. Maybe its doable using resource class.
So the player is built based on the data in that resource class. It gets different nodes (Scenes) based on what the dictionary contains. For example you have character slots, maybe surface level in the beginning like armor for hands, legs. So you have dictionary with scenes to load for that part of the character.
Fillanengram post code?
I don't know anything about stardew valley and sometimes confuse it with another game, so you will have to be more specific and maybe post some pictures of what you want to achieve. also it depends on the setup of your character, if it's a single sprite or a bunch of node2D combined.
kuligs2 character customization like in mordhau where you can change facial expressions, and scale of the character itself (midgets) Also voice customization would be fun. Its all in my head, so once i get to it i might post my results here on how to.
that is more specific and I can answer because I've done this in godot (and unity, and bge). It's a combination of different techniques:
kuligs2 facial expressions
this is done with shapekeys
. you need shapekeys
of the head for every expression the player has to make, and these can be combined.
kuligs2 scale of the character itself (midgets)
this is done one of two ways:
1 - you scale the entire character
2 - I sort of invented this one: you create an animation in blender and save it as gltf, then import it as animation library. you need for it to either be the same skeleton as the player, or to use humanoid retargeting.
for making the character shorter, you will have an animation where the bones are scaled, with the legs and arms shorter (torso, head and hands optional). making the arms shorter you have to scale the hands up to make them bigger.
and make sure you have a "average size", a "RESET" animation to go back to.
then your first thing in animationTree
must be a blendTree
, and there you have a Statemachine
and an animation
(or set of animations), this is the scale animation, and you combine them. in your state machine you put the character animations. it is better if you use humanoid retargeting.
kuligs2 voice customization
this I can't help you with. read the docs and find a way to alter the parameters of the sounds.
kuligs2 So far i would somehow keep the customizable data in the player class. Maybe its doable using resource class.
So the player is built based on the data in that resource class. It gets different nodes (Scenes) based on what the dictionary contains. For example you have character slots, maybe surface level in the beginning like armor for hands, legs. So you have dictionary with scenes to load for that part of the character.
for armor, you have to divide your character in parts. the simplest is a head and a body.
more complex is head, torso, legs, hands and feet.
there can also be arms and hands.
each part has variations for armor and these all share the same skeleton.
your MeshInstance3D
for each part must be a scene, when you swap them you delete the current part and spawn a new one, then assign the reference to the new one.
other customization like tattoos and skin color must be done with a shader. you can't change textures
at runtime but you can assign instance uniform
s with colors and values and mix
them.
- Edited
Jesusemora kuligs2 facial expressions
this is done with shapekeys. you need shapekeys of the head for every expression the player has to make, and these can be combined.
The tags say #2D
, and shapekeys
is referring to 3D. But if we talk about 3D facial expression, it is realized in two ways: 1st — yeah with the help of shapekeys, which is hard work for the engine, especially when there are a lot of characters; 2nd way — using a face rig:
the bones are scaled
If you scale the bones individually, interesting things start to happen.
Tomcat I was answering to @kuligs2, I also answered to OP, there are many ways to do character customization in 2D and I don't know which one he's looking for.
Tomcat 1st — yeah with the help of shapekeys, which is hard work for the engine, especially when there are a lot of characters
depends on the amount of shapekeys, and we can hide the head MeshInstance3D and show one with fewer or no shapekeys at distance.
Tomcat nd way — using a face rig:
I find face rigs IMPOSIBLE, I also doubt they are better than shapekeys since we are adding more bones. they are good for animation in blender, but most games use shapekeys.
Tomcat the bones are scaled
If you scale the bones individually, interesting things start to happen.
It works in godot. I doesn't work in unity or any other engine, specially with humanoid. but works in godot.
you just need a RESET
and to keep the animation with scale in a separate animation library, which is another advantage of godot, you can split your file into various files and work on meshes and animation in different blends, so long as the skeleton is the same.
- Edited
Jesusemora depends on the amount of shapekeys, and we can hide the head MeshInstance3D and show one with fewer or no shapekeys at distance.
A few characters at close range and there will be noticeable slowdown.
I find face rigs IMPOSIBLE
Why impossible?
I also doubt they are better than shapekeys since we are adding more bones. they are good for animation in blender, but most games use shapekeys.
Rigs are much easier on the engine than shapekeys. Not used — well, there was no big need — usually not so many characters are displayed in the game at the same time. Yeah, shapekeys are a bit easier to use.
It works in godot.
I'd be curious to see it. I want to make characters of different ages with different body proportions and it didn't work for me.