Tuesday, December 9, 2014

Clementine / FF2

For a long time players have requested a hide and seek boss for Freak Fortress 2. We tried this with the hidden, but he was for the most part, just a spy, and people ended up playing him as such. Good players can still be stealthy and run up and backstab people, but there is little else to him than that. His special ability (cling to walls), is also quite useless.

Halloween brought in some ideas for zombie bosses, and it was requested that I make some bosses revolving around that theme. I did manage to make a zombie style horde boss, which is somewhat fun, but it does not diverge far from the typical hale/minion idea.

This time I tried to create something a bit different, where the hale is the hunted, and the mercs are the hunters.

It was decided to use The Walking Dead series character "Clementine" for the boss, which is appropriate for a hide-and-seek type game. I believe the mesh was an XnaLara mesh from Facepunch forums. I rigged the mesh to scout, because it's the only class with bones of appropriate proportions. I had a bit of trouble getting the head and neck to work well, due to the scout's cartoonish skeletal system. I also had to tweak the arms and hands to get them to fit the weapons. This was a bit of a crapshot, as I did not want them to turn into gorilla arms, or make the hands large. overall I think it turned out decent.

I was able to use a simple lightwarp to get a not-quite-cel shader effect going on. Unfortunately there is no post processing effect available in this engine. Still, it helps with the lighting a bit at most angles, and is far better than that all-around matte look, or the shiny-as-rubber cornerstone TF2 look.

The textures were cut up into various segments, which is good for small devices and low-memory gpus. However, this is pretty rough on the limited stringtables in the source engine, that have never been repaired. So, to help reduce crashes, and get the load down from 15-30 things on there, I can cut it down to 2-3 by condensing the uvs onto one map. I noticed there were also some sloppy UV seams, mainly at the shoulders and wrists which were visible in the game as well, so I took a minute or two to fix those up. I notice this quite often on low poly models, and I don't understand why developers use a neutral background rather than a content aware fill, or neglect attention to UV seams. It's pretty obvious when two textures meet and a line breaks, and even more annoying when it is on a main character (even if it is on the top of their shoulders, or down their inner thigh). Anyhow, I didn't need to go in and edit out all the neutral grey, I just did some quick patch tool work in Photoshop, and then fudged the verts in Max's UV editor.

Clementine's Eyes in S2
Telltale appears to use a somewhat complex rigging system for the eyes, where they rotate in the sockets. The iris is inset, with the pupil (a plane) outset from that. A flipped normal caps the cornea. I did not notice it in the game, but I assume that there is some sort of blocklight (or possibly refract?) texture.

I like the movement and lighting that is produced from this effect. It looks quite realistic. Very rarely the eyes will not be set correctly (like the character will be looking perpendicular to the viewer, and will have iris-less eyes). This is interesting to see.

Looking over both S1 and S2, The flex/coreography is decent as well, though I have the feeling that much of it was automatically generated and mostly untouched. The animation and emotions are done really well, and I can only guess what was used, probably some fancy spline-based plugin for facial rigging. I'd like to learn how to do that some day. I've always just manually moved the vertices for each frame, which takes forever. The mouth origin/lighting on most models is off, with the inside or corners of the mouth often having inappropriate illumination. However, I think that most people would not notice it.

An EyeRefract Alpha Channel
Valve's Source Engine uses a refracting eye shader in newer games (TF2, L4D2), which creates a convincing effect, with much less effort. An iris texture is mapped onto a spherical surface for each eye, which determines the color of the eye and sclara. The alpha channel blocks out the shape of the iris and sclara (as well as the lighting and intensity of the cubemapper). Creating the alpha channel is fairly simple in Photoshop, and can be done by rendering some difference clouds, feathering a selection of a circle for a mask, and then rendering some chrome in the filter gallery. Additional maps (ambient occlusion, cubemap, cornea, and lightwarp) are combined to create the final effect. Flex controllers can be created to shift the eyes up/down, left/right, without actually moving the geometry.

This seems to work fairly well, however eyes on ragdolls tend to roll into the head. Also, dilation of the eyes is defined in the material file, and is constant. It would probably be possible for them to make it more dynamic at a later time.

Fitting this into the realm of Team Fortress 2 and FF2's twisted API was another can of worms, but I think it turned out Ok. Also, since I am limited by Sourcemod to use only server-side modification.. there's that too.
  • At the start of the round, all mercs are turned into scouts with a melee weapon and custom model of a zombie (using a hl2 zombie for now).
  • Added sound hook for voice calls and damage to use zombie sounds.
  • Replaced boss' model with Clementine model, scaled down in size. Granted pistol (revolver class can headshot), bonk (lunchbox item), and bat.
  • Added sound hook for damage to use random voice lines for boss.
  • Added item drop system so that boss can find pistol clips and bonk/food items to recover health, gain immunity, and increase speed for a short time.
  • Introduced stealth mechanic where boss can enter stealth while enemies do not have line of sight. Evasion increases weapon damage. Hit indicators will show players on both sides where each other are when detection occurs.
  • Added stealth detection meter, speed increases as danger increases, but it becomes difficult to re-stealth, and the boss takes damage over time.
  • Rage ability slows down all players and gives a few pistol shots, so that the boss can escape and re-enter stealth, or pick off a player or two.
This will probably be hard to balance out. Right now the boss does very little damage do players unless they play cautiously and pick them off or sneak up on them. Attempting to go after large groups of players does not end well. However, there is the option of sneaking up to groups and shooting unsuspecting players in the head. We will have to wait and see how it goes after players have gotten used to the gameplay :3

No comments: