Suggestions: Making procedural video game characters

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 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

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 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:
break;
case LITTLE_ASS:
break;

..............
}
}


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++)
dna+=parents[a].GetNextGene();

...........
}


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

Edited by Stainless

Share on other sites

Ashaman73,

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

Kryzon,

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!

Stainless,

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 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 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 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.

That sounds a bit like a song...

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 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!

mazdaplz,

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!

Everyone,

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 on other sites
By using pre-generated graphics and "location tags" the game 'Papers, Please' manages to have a lot of different character permutations:

http://forums.tigsource.com/index.php?topic=29750.msg820306#msg820306

Most characters don't always look that different, but this sort of system can be adapted to use entirely procedural graphics, so along with unusual facial parameters you can get some unique results. The most important point is probably those tags that specify where each feature is attached.

Share on other sites

I really wish you luck on your project, if you get stuck, I and a lot more people here will be happy to offer advice and support.

However, I personally hate that style of graphics.

That video is really a sales pitch for the software they are building, a software package that solves a problem that doesn't exist.

Early on he states that this style of graphics cannot be done in 3D, bullshit. I'm not allowed to mention the game I am working on, but if we only had to do graphics of this style the game would have been finished a year ago. We have to handle vast numbers of data points for every face. Hair has a massive budget, every eyelash is rendered.

We can view a close up from any angle at huge levels of detail, that system will only work from a very small range of viewing angles. If you want to look at the character from any other angle, you have to create a new set of graphics.

Honestly I'm not having a go at you, as I stated earlier I'll give as much help and encouragement as I can.

That video has just pissed me off.

Share on other sites

Thanks Kryzon.

That project is really cool, and definitely gets a lot of ideas flowing in my head. This might have been obvious to you already, but I just realized that I'm drawing the procedural graphics in the same manner that I draw normal game sprites, So changing the way the eyes are drawn with a function, and specifying where they are attached to the face, becomes a lot easier to grasp in my mind.

I understand your point of view, and it's alright if you don't feel the same way about using this approach. I don't feel like you're having a go at me at all; rather, I'm glad you brought that up. I know it's a sales pitch, but the concept is very interesting to me as an artist and a programmer... I don't believe the man in the video was attacking 3D; he was just saying that they're trying to capture all the subtleties of the original 2D drawings by the artists.

That's not to say that there aren't any 3D anime-style games that look great. Notably, Guilty Gear Xrd Sign is a 3D game that beautifully captures the appeal of 2D anime with 3D cell-shaded graphics. So, there's really no argument that 2D is better than 3D, or vice versa. It all depends on how the artists want the game to look. I'm sorry if I offended you in any way.

I'm currently searching for algorithms that will make it easier for me to draw these aforementioned characters (the head, the hair, the arms, etc.) with more than straight ines, rectangles, and circles. Here are a few links I found regarding procedural drawing techniques:

Do you know of more resources like these?

Edited by Mia.

Create an account

Register a new account

• Forum Statistics

• Total Topics
627736
• Total Posts
2978857

• 10
• 10
• 21
• 14
• 12