Faster Characters

Published June 26, 2007
Advertisement
Recently I had a strange problem with my new character's head. The old character was bald, so it didn't show up with him. On the new character, it was a bit of skin showing up on the top of the dude's head on its silhouette, even though he had a full head of hair. Since the game is played 3rd person, this was pretty distracting.

Step one was to open up the texture and copy the hair parts over the empty areas of the texture which were filled with skin color, even near the hair. That reduced it, but it still showed up with AA on.

I next forced skin textures to only have a few mipmaps, to make sure that wasn't the issue. Reduced, but still happened.

When I dumped the character model as a .x file and loaded it in Unwrap3d, I saw that the 3 submeshes of the texture were not all in the [0..1] range, two were translated, one left, and one down.

I remembered that issue, and realized that to 'fix' it, I had set the texture wrap mode on the characters to wrap. Turns out, the bottom of the char's skin texture was skin colored ( legitimately, for the hands ), so the wrapping was kicking in on near-horizontal triangles, bringing in the nice bright skin color when the texture wrapped around vertically.

I can't easily fix the character models, our last character artist flaked out a while ago and is not returning our e-mails, so I needed to fix it up on loading.

That caused me to go back into the character animation code to add code to bring UV coords into [0..1] range when first loading. While in that code, I realized that I could probably speed up things a bit by not copying the texcoords down every frame into the cached vertex array, but only do it once when fixing things up.

It did speed things up a bit, so then I experimented with not updating the normals and tangents every frame, and that gave a nice boost, too, so I added code to only animate the normals and tangents every few frames. Looks the same, and runs much better. It's actually a single counter for all submeshes, so the more characters on screen, the less often it's run.

Now the canyon level, with 7 chars on screen, plus corpses, is running almost 50% faster than before, and no more skin artifacts.

Here is a shot of my weak work-in-progress DNA-like cloning effect.





Previous Entry Textures
Next Entry Sound the Alarm
0 likes 2 comments

Comments

jollyjeffers
interesting bug to fix!

Quote:our last character artist flaked out a while ago and is not returning our e-mails
Sucks a bit, out of curiousity have you found it easy or hard to get a team behind this project?

I remember you advertising for places and it then went quiet - so I just assumed it was all ticking over just fine on that front [smile]


Cheers,
Jack
June 26, 2007 05:10 PM
SimmerD
It's been brutal keeping folks, right now it's two full time folks ( me included ) and one part time level/model/texture artist.

Some of the issues that have come up with team members include serious illness, family member incarceration, and need to get a full-time job ( with no notice ), among others.

I really thought paying cash money would help, but I find it's really not the main issue. Now it's probably too late to bring on someone due to how long it would take to get someone up to speed...

June 26, 2007 08:48 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

1.2 Almost ready...

1138 views

Sound Paths

1355 views

Stately Progress

1167 views

State Lines

1310 views

Pulsing

890 views

Return to The Ship!

1029 views

Cameras & Boxes

1147 views
Advertisement