So, having reviewed some various advice threads on the internet, I think I'm going to continue whacking away at the BlendShape issue until I get it right, because it's worth it.
Let's be clear about something, this isn't about breasts.
Well, it's not about breasts for me. It may be about breasts for you. And that's...well, that's whatever.
Shape Keys are what I'm trying to use to undermine the need for TONS of other things. They are my secret NOT SECRET AT ALL weapon, they are my favorite tool, they are my fire.
The Shape Key is one of two fundamental forms of animation, the other being Armature animation, which is probably exactly what you think of when you think of computer animation. These two tools meet together with the "bone driven shape key" which is a little more involved. Let me explain.
An armature is a set of bone-like objects that deform a 'mesh' or a 3d model as they move, and which obey a series of joints, very much like bones could be considered to do in real life, the main difference with real life being that they do not support the model as they do in real life, so they have more freedom and can be used to control things that bones don't control in real life. An important bone in most character models is the "gaze bone," which is basically a target which both eye bones orient towards that sets the gaze of the character, the point at which their eyes intersect. In real creatures, this is an extremely complicated operation coordinating dozens of muscles and complex neural pathways. In 3d modeling, it's setting an IK target of 1 bone depth and detaching it, then repeating the process on the other eye bone. Eye bones are another thing we don't have in real life.
So when you move a head bone, an eye bone, or a finger bone, the corresponding mesh deforms as it's been told to, usually to a pattern of weight painting, so that more than one bone can deform a given section of a mesh. If I tilt my head back my neck deforms to conform to this, but if I raise my shoulder, it deforms my neck as well. This is done by giving both my shoulder bone and head bone some weight control over the neck mesh.
A shape key is in some ways the opposite of an armature. A shape key is a specific configuration of the mesh or model, and is then given an influence (typically thought of like a percent of 0 to 100, but you can usually force it negative or over 100 and let the machine calculate what that means) to determine to what degree the mesh is in that configuration. This is most often done for facial animation. Take the smile for instance. Using armatures for facial animation is usually not great, shape keys are usually what is desired there. So, the Basis, the default shape, is a neutral mouth pose. Then we set a shape key in which the face is smiling. At 0 the face is still in the default shape, but at 100 it's exactly like the smile we designed. At 50 it is not like either the basis we made, nor is it like the smile we made, it is between the two, which is interesting to say the least.
Shape keys work with other shape keys, and (unless bugs or other weirdnesses crop up) deform with bones. So if you smile halfway, and then use a shape key to open the mouth halfway (50% of the open shape key) and then turn the head with the head armature bone, everything is being calculated by the machine. You've really only made three things (aside from your model) but your'e now seeing something new that you didn't make.
These are the fundamentals of computer animation that everyone learning this stuff gets indoctrinated to, and everyone learns to use armatures and shape keys when making cg animation.
Now we're going to talk a little about what I'm doing differently. Since they seem to be popular with this crowd, we'll talk about breasts.
Soft bodies are usually the go to solution for bouncing breast physics. I've experimented with this, and what you wind up with is up and down motion only, jello-like consistency for the most part, and if the model takes an orientation other than standing, the breast jiggles and then returns to the same orientation as it had when the model was standing. This is...not how breasts behave.
The reason that I am dedicated to getting them right is not, as I've mentioned before, to titillate and...spray come everywhere, but to portray women realistically. And also, other reasons, which I'll expand on momentarily.
Soft body physics calculations could theoretically be expanded or refined to produce the desired results. They are, however, time consuming. My machine is, as previously mentioned, a beast, and it cannot do them in real time. This means that any reasonable end user market cannot be expected to do them in real time either. So another solution is required. I have another solution. Shape keys and the already robust and real-time rigid body physics.
Rigid Bodies are what you usually think of when you talk about physics simulations in video games and computers. Cars smashing into walls, bullets bouncing off of armor, ragdoll physics, that kind of thing. Computers are good at this because they are far more friendly as far as calculations are concerned. For example, an object that is a rigid body is usually considered to be all one thing, so the computer needs to know it's speed and location and collisions, and that's most of it, mass, bounciness, friction, and so on. Throw in aerodynamics for good measure. In Soft Bodies, each vertex (most models in high quality video games have between 5000 and 10000 vertices) is calculated as a separate particle with it's own speed, location, collisions, and spring tensions between it and it's neighbors, in addition to the same rigid body dynamics.
So here's my model for breasts. On a separate (and un-rendered) layer, behind each breast is a sphere. Within that sphere is a much smaller sphere, which is a free falling rigid body. The smaller sphere has a bounciness and mass with variables determined by the attributes of the breasts. The larger sphere has friction determined by the same. In the center of the larger sphere is a cone that originates from the center and always points at the smaller sphere. The large sphere has a mesh collider (meaning that rigid bodies know when they hit it and react accordingly, with great precision) and it's collision iterations cranked up by script (making sure the smaller sphere doesn't fall out.) Additional scripts protect the spheres from bugs, so if the smaller sphere falls out or glitches and gets stuck, it is destroyed and re-spawns.
Instead of processor heavy physics calculations about bouncing breasts, we make shape keys for the breasts in the up, down, left, right, laying back, leaning forward, and neutral positions. The influence of these shape keys is then governed by the rotational angle of the cone in the middle of the sphere. Clothing, such as a bra or a corset, controls a shape key on the larger sphere, arresting most of the motion of the smaller sphere but not all of it. (Most clothing usually functions as paint against shape keys anyway, so this can help against bouncing dress syndrome.)
Other forces encountering the character, such as pressing against walls or other characters, strike a series of colliders that are attached to the smaller sphere itself, exerting force to change the shape anyway.
This same concept can apply to other aspects as well. Large breasts are notoriously bouncy, and small breasts are not. The size of the breast can determine the size of the outer sphere, the weight or bounciness of the smaller sphere, the friction of the larger sphere, and so on.
Enough about breasts.
At the last Kingmaker game, I got some amazing feedback. I know that a lot of horny teenage men out there crave for moving breasts. I know that a lot of moms wish the moving breasts were more realistic and less like jello. But what was interesting to me was that the women in the room were more interested in hair than breasts and butts. I heard you.
I've been studying my options for hair and how it could work. I've come up with what could be a solution. Using the particle hair system in Blender, which is quite pretty but demands a great deal of processing time when dealing with things like wind and physics, even more so than soft body dynamics, we set up extremes and styles and conditions, such as hair being blown in given directions, several hair styles, (or a lot of hair styles), wet hair, frizzy hair, hair laying against a variety of curved objects, hair laying against a flat object, and so on, much like we're doing for breasts and other soft parts of the body. Then we convert each of these hair configurations into a mesh, and then convert those meshes into shape keys for a single hair object. This is where things get tricky. A realistic hair design is a LOT of verts. I have this going on right now (it's rendering) and the model is at 6 million triangles. A normal AAA quality CG model for a high end video game might have ten thousand. Now, this includes geometry she doesn't need, like detailed curvature of her ovaries and other highly sculpted things that will go away later, but a lot of that is hair, when it wasn't before.
I think a balance could be found between using mesh geometry and particles/shaders. Fewer strands of hair, or hair with less geometry, could be made more realistic by duplicating it as particle strands, or making copies of it or blurring it with a special shader, like the FurFX people did.
All that said, I think it could be done pretty well with just geometry if we can keep the face count low. Right now it's most of the model and it doesn't look very good, because I hurried it out. Since it's not using particle rules any more, it'll need to have the material and textures re-designed, but that's not that big of a deal. Her hair might look thinner because it is. Well, because the particle effects aren't making the hair look thicker.
So, the point of all this? The reasoning beyond beautiful hair and bountiful heaving breasts that I'm doing all this?
I keep saying "this game won't make itself! gotta get back to it!" Well, that's not technically correct. The game will make itself, once I teach it how. That's where the Shape Keys come in. Beyond the useful physics workarounds, the male and female and canine character models will have shape keys expanding their appearances into a huge diversity, and once I can expose those shape keys to the parts of the game engine I can prepare AI behavior in, then the game itself can produce millions of characters as needed, and as long as I make those rules reasonable, and link the shape keys together so that unreasonable forms don't come into being, then the game will make the characters we need in abundance, a greater abundance than available in other games.
It's not just living characters either. I can make a single "proto-car" asset, and then give it shape keys that make it a truck, a van, and a sedan, and then let the game randomize different cars having those attributes in different values. A given vehicle might be truck-like or van-like or both. An NPC could do a ray-cast over a parkinglot (a process determining what he can see) returning the truck-like values of the shape keys of all the cars he can see. If your car has the most, he can approach you and complement you.
"Greetings Character. I detect that your vehicle is the most truck-like vehicle in this vicinity. I favor truck-like vehicles. My affinity towards you is therefore increased. Goodbye."
In a game like Grand Theft Auto, Saint's Row, Watch Dogs, Sleeping Dogs, or what have you, there could be 40 to 50 different cars. In a game like Asseto Corsa, or Gran Turismo, there might be 1000 or more. What I just described above would take an amount of time equal to that required to make basically four different cars (counting the proto-car) and would result in 800 distinct vehicles, calculated assuming increments of 5% to make sure they are distinct from one another. (Technically an infinite number, as the shape keys can be driven above 100%, but nobody wants mega-van.)
This same process is planned for all the assets in the game. Even minor assets like food items should get a couple shape keys so they can be randomized and then the game world is suddenly populated with non-identical things. Instead of one steak object, I make a steak object and then give it a couple shape keys, and then when it's instanced it has those keys randomized, and is oblong, or thick, or whatever.
So I drive on, and hope to ultimately succeed in exposing BlendShapes (as Shape Keys are called in Unity) to the AI tools I'm using. In the mean time, I have a short video rendering that I'll try to host somewhere. I'll post some shots of our favorite model getting her hair messed up by a blast of air, demonstrating shape keys in action as they might apply to hair.
As an aside, the most important thing we could take from using shape keys in hair is the use of extreme styles and then finding in-between points for them. That would be good. Most games with lots of hair variety have several dozen hairstyles. We could go beyond that.