Jump to content
  • Advertisement
Sign in to follow this  
Mia Blue

Suggestions: Making procedural video game characters

This topic is 1361 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm looking for an efficient way to go about making procedural video game characters, and I'd like your help. In my program, the characters are drawn entirely by procedural geometry algorithms (broken down, one function draws eyes, another draws the head, etc.). Also, the characters are not drawn in a pixel art style. Because they're intended to look like 2D drawn versions of 3D character models, they resemble the avatars you might see when two RPG characters are talking to each other.


In case you're wondering, "Why would you want to draw 2D characters from scratch instead of just using 3D models," I just wanted to try a different method of rendering. I'd like to make a 2D world that is 2D, but with the depth of a 3D world (a.k.a. pseudo 3D). In other words, I want my world to look flat. Flat, in terms of drawn as opposed to modeled.


I don't know a lot about procedural graphics or techniques related to this style, so I would greatly appreciate any suggestions or comments regarding techniques that would be helpful in making these characters. I think the Bézier Curve could be useful, although I have not yet learned how to model one.


Again, if you have any input on this, please give me your input! I will appreciate it, for sure!

Share this post

Link to post
Share on other sites

I don't know a lot about procedural graphics or techniques related to this style

Well, PCG is really not simple.


Nevertheless, it reminds me of spore and Chris Hecker has some interesting information about (procedural) creatures in Spore over here.


Good luck smile.png

Share this post

Link to post
Share on other sites
That is an interesting idea. You can also expand it with "ethnicity," so that most of the actors from the same general region have similar features, different than those of actors from other regions.
In the ideal implementation a player would be able to recognize the place of origin of an actor solely based on their look.

I don't have any experience to share on the subject, but Ken Perlin (the same person behind "Perlin noise") has some inspiring work on it:

(These are Java applets.)
- http://mrl.nyu.edu/~perlin/experiments/violet/ (Procedural rendering of an animated 2D actor.)
- http://mrl.nyu.edu/~perlin/experiments/emotive-actors/ (Humanoid skeleton solver)
- http://mrl.nyu.edu/~perlin/experiments/facedemo/ (Facial expression simulator)
- http://mrl.nyu.edu/~perlin/experiments/bodyguy/ (Procedural body modification)

Source: http://mrl.nyu.edu/~perlin/

Share this post

Link to post
Share on other sites

I had to do this for 3D and it's a beetch.


The apprioach I took had to be based on DNA, it was a requirement of the game, so I started with a basic skeleton and modified it based on 'genes' in the DNA stream.


So genes could define the length of the bones, and a few other things, but just start by thinking of bones, it's a lot simpler.


Once I had my skeleton, I reparsed the DNA stream remapping the genes to body shape. So gene's for big ass, big mammory glands, etc.


These were used to deform a standard skin which was then mapped to the bone structure.


Once again I parsed the DNA stream remapping the genes to things like ethnicity, social standing, intellect. These were used to select a texture set that was then applied to the skinned mesh to create a character.


So technically it's only a partial procedurial system, you still need to generate the texture sets by hand. (I was working on generating them, but never got it quite right)


You would need to extend it to faces as well, I never got around to that, but the approach is the same. Have a look at a facial recognition tutorial, extract the key measurements from that, modify them by genes, procedural facial structure.


The real fun comes when you extend the system away from humanoid skeletons, breed horse DNA with human, dog with horse, crab with snake.


I got my code to the point where I could generate the skeletons for these chimera, and I was talking to Natural Motion about getting them to animate when my company went pointy bits in the air and I was forced to get a real job.


It's great fun seeing what happens.




I thought I should mention a happy accident in my code. Purely by chance I coded the DNA parsing in a way that worked out perfectly. I didn't want to waste processing time by applying mutually opposite genes, so I created a job list.


something like this.

while (!done)
    switch (dna.GetNextGene())
        case BIG_ASS:
        case LITTLE_ASS:


This meant that the LAST gene became dominant.


When I did the breading I used the original DNA sequence and did it properly.

while (!done)
         int a = rand()%1;
         int l = rand()%8+2;
         for (int i=0; i<l; i++)


So you get random gene sequences from each parent.


So if one parent has the SMALL_ASS gene even though both have the BIG_ASS gene, it's possible to get a child with the SMALL_ASS gene.


So the SMALL_ASS gene is recessive.


A really nice accident smile.png

Edited by Stainless

Share this post

Link to post
Share on other sites



Wow! Thanks for the links! I'd heard of Spore, but I never really looked into it before now.




I need to install a plugin to run the applets for the Perlin Experiments, but they appear to be exactly what I was looking for. Thank you!




That's certainly a good idea! I actually wanted to use a more simplistic version of that--using more general parameters to change the appearance of the characters. I hadn't planned to use external textures or images though. My goal is to draw everything within the program. Thank you for your comment (that was quite an example)!


If anyone has additional suggestions, I am open to those as well!

Share this post

Link to post
Share on other sites

look at how pro evolution soccer 2014 from konami does it, you have some face attributes -

brow height
eye separation
upper eye limit

lower eye limit

nose length

nose width

mouth width

mouth position
face width
face length
skull depth

then you only have a few types of nose (aquiline, straight nose, curved nose, round button nose, split nose)
only a few types of eye (asian-eastern and occidental-western)

this way you can create any player, from messi to park ji sung to mario balotelli.

your best bet is to make the actual faces render in 3d this way, and then use no anti aliasing, and only linear filter so that everything looks like 2d pixels.

this is the easiest way to make it in the way you talk about IMO - unless you want to use sprites instead of 3d but that will be more limiting and more difficult to mix and match not to mention you will use a lot more memory

check out here how konami did this:

there is a few simple vertices that you can move around that will affect the actual models somehow, via splines i reckon but i am not really sure how.

instead of rendering realistically if you use no filtering and no anti aliasing it will look like a prerendered age of empires 2 portrait.

Share this post

Link to post
Share on other sites

by the way i would NOT go the ethnicity route, you can set something like that up for eastern and western MAYBE, but in reality - look here


these girls are twins, one is white and the other black.

yet they have virtually the same genes so how would you go about classifying them by ethnicity? their faces are shaped nearly identical.
don't bother with ethnicity variables, is what i would advice

Share this post

Link to post
Share on other sites

Skin colour is not the same as ethnicity.


Certain races have very striking featural differences, eye shape, brow ridges, nasal flaring, loads of them.


Skin colour would be a single gene, the rest single genes, no different than any other gene in the system.


The difference would be in the initial racial prototype. All the features would start out with values that approximate the racial type and give a reasonable visual look.


Once the breeding starts, the gene mixing system will take care of the rest.


In the image above, if you photoshopped the black girls face to white, she wouldn't look strange. That's because her basic facial structure is caucasoid.


A negroid face with white skin, would still look negroid, a chinese face with black skin would still look chinese.


Forget about skin colour and look at what's beneath.


smile.png  That sounds a bit like a song...

Share this post

Link to post
Share on other sites

african and caucasian is not the same ethnicity, but in 2014 people are mixed enough that the lines are blurred a LOT

most american caucasians have a good percentage of african genes in them, you just can't tell

while a thing like this might be useful in a game simulating the past like age of empires, i still fail to see the use here

Share this post

Link to post
Share on other sites

Thanks for the great discussion everyone! As far as ethnicity goes, I certainly don't plan to make it so all people from X look like X (because that's often untrue). The previous posts have helped me decide to use only general appearance variables, not ethnicity variables. I will keep all of this in mind!




I'll be sure to include attributes like that as drawing parameters, for sure! Also...I realize it would be easier to render in 3D; however, I did state in the original post that I do not wish to use 3D models. Thank you very much for the in-depth examples of attributes!




I'd also like to add a link that somewhat demonstrates what I am trying to achieve:



Live2D renders and animates 2D images so that they appear to be 3D. I'm doing something similar to this, but I'm not using pre-rendered images and I'm rendering full-body characters.


I hope this helps to clarify my intentions a little! Your advice is very much appreciated! Thanks!

Edited by Mia.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!