Random 2D character graphics generation

Hi gang.

I’m working on a 2D sidescrolling game (picture castle crashers fro reference) where I want many different random character designs, all based on more or less the same or character frame/skeleton size, if you will. I picture dividing the character up into parts like head, hair, armL, armR, torso, and so on. I want to be able to randomly or manually assign a certain character look. I picture these to be just pre-rendered sprite art, so If i have a walking animation of 6 frames for some legs with boots, I’ll have separate drawn frames for legs with sandals. I want to be able to put these together on the fly so I’m able to swap out one body part for another design dynamically but still have a functioning animated sprite character. Ideally I would like to have just one ‘walk’ animation clip of an entire built character, where i can just swap out the sprite art. Does that make sense, and is this possible?

Does anyone know how to begin to structure such a character manager? Resources or tips would be much appreciated!

Great question but sadly i don’t think that is possible

1 Like

Was afraid that might be the case. If not, how about dynamically changing color schemes on an animated sprite character?

Check on unity asset store, theres a cartoon character generator thing i’m using and with a bit of code i managed to randomize the characters, and as such i currently got millions of unique characters coming onto the screen. Its totally worth its money.

Actually it is doable. Just FYI, the user who replied saying its not, is a new user who is learning the basics of unity, and known to give out wrong and incorrect advice on the forums. You can see good examples of this by going through their history on the forums.

1 Like

Hi @DarkProphetStudio ,
Definitely doable. You could approach this in a few different ways, depending on the look/style you want. i.e. different approach If it’s a really low-res blocky pixel art, or more like a traditionally drawn 2D art. You could just have pre-rendered whole arms (for example) or segmented arms, and so on. You could also get some variation to the body parts dimensions too. i.e. you could have different length torso, legs, arms and maybe different size head. This won’t be much of a problem (imo) unless you have lots of fine detail interaction with the character’s own body, like character touching top of his/her own head, character taking a weapon from belt and so on. These would need to be taken into account if you have noticeably different dimensions (like a 50% taller torso.)

Depending on how many characters you want on the screen at the same time, you could also implement a system to to bake the body part elements to same texture (instead of having separate elements for head, arms, torso etc. like you said.) That way you could save some overdraw etc. But definitely don’t think about that until performance comes an issue…

2 Likes