Bloopers, as promised! ...and technical ramblings.
In the comments two days ago I said I had a bloopers video for you, and here it is!
This is a mix of me failing to do an intro for the AI War 2 Kickstarter Video (hmm, maybe a clue why that doesn't have one after hours and hours of me trying to make said intro), and then funny things that glitched out visually during the creation of In Case of Emergency, Release Raptor.
The glitches shown are perhaps a little extra funny if you know how they came about (if you're into that sort of thing):
Green Screen Fail
That was the greenest sheet I had, and I figured I could hang it awkwardly in poor lighting and no problems -- right? Not only was it not fully in the shot, but it was just too varied in color to chroma-key out without also removing parts of me or the microphone.
Whatever, it was interesting. ;) I've never had a reason to directly mess with green screen before, and next time I'll know better. My wife is a professional photographer (among other things), so she has plenty of lights. I was just trying to do it myself in a fairly janky way.
The first one, with the dislocated jaw, was based on me rotating the jaw bone in the wrong axis when having it manually rotate for roars. Rather than updating the raptor via animators (as normal) for the roars, I was having it just rotate the bone at the base of the jaw, since that's simplest.
However, the X Y and Z axes are in the local space of the bone, meaning they are relative to its parent, which is relative to its parent, and so on... 15 or so bones up. So I had no quick way to immediately check which axis of that bone would correspond to actually opening the mouth.
Quickest thing was just to try one of the axes and see if that was the right one. First one I tried made the "roar" rotate sideways instead, so -- nope! Y axis isn't the one. It looked so funny that I took a video to keep, because my wife loves blooper videos and wanted to make one at the end of the project.
This was a preview in Maya, and I can't remember exactly what caused this. Blue was doing fantastic animation work there, but she found out that if she accidentally hit some combination of keys it really mangled the whole rig and would lead to really unexpected results such as the feet being locked to the ground.
Thus a graceful run animation turns into some sort of awkward dance. She didn't lose any work, but we were on Skype at the time and we both thought it was hilarious, so I quickly took a video of it.
The second bit in there where only the legs move but the rest of the body is eerily still was after her attempt to do a quick fix, IIRC. Nope, that doesn't work! Time to just reload the file.
Field Of Cats
This isn't actually anything of mine at all, but I was experimenting around with Runtime Mesh Operator, which you can read my review of at that link, when my wife walked into the room.
I happened to be recording for some reason, and her reactions were so funny (and made me kind of take a step back and think about the ludicrousness of what was on my screen), so I kept that video.
Awkward Rubbery Raptor Head
One of the things I spent the most time on in Release Raptor, from a technical standpoint, was making the raptor itself feel lifelike and not like some stiff piece of plastic when it touches the environment. There are a lot of little details in the "final" version of the game (where it had to be left, anyway), like the raptor subtly changing pose in a realistic manner when it smacks into walls, etc.
I'm really proud of that, because it was a really novel mix of direct bone manipulation code on my part, animation controller work in unity, and then of course great actual animations that Blue created in Maya.
What you see HERE, though, is one of my many (MANY) attempts at a variety of other approaches, this one involving PuppetMaster. That's also a really solid product, although I have not written a review for it. There's a lot to love there, and I spent a lot of time with it, and the way it can basically let you blend animations, ragdolls, and even inverse kinematics together is really cool... but I found such a hard time really getting a truly usable case for it that I didn't feel I could leave a good review.
The raptor is one of the harder cases you could have, so that's not something I'd hold against the product. Humanoids or even quadrupeds would be vastly more straightforward. I picked a really, really hard animal.
Raptor Head In The Air
This one is probably the least-understandable of all of them, but it's extra funny when you know what's going on. Basically, using PuppetMaster it has an invisible ragdoll copy of the bone structure for the raptor, and it has those "pinned" somewhat loosely to the actual visible bones, which are traditionally animated using keyframes and all that jazz.
What PuppetMaster does is interpolate between those two values, which can lead to things like a character having a ragdoll-style collision with the wall with part of their body (which was my goal), while still otherwise maintaining the rest of their animations.
Because of the size of my collision capsule, I only cared about unpinning the head and tail to allow for this sort of thing. And because those were rooted to other bones that would exactly follow the visible raptor, that meant I could leave the head in particular VERY loosely pinned.
That led to things like the over-rubberyness on the walls that you saw before, but it also led to a funny bug that I found where the doors that open and shut in the background could actually trap the nose bones on the far side of them when they shut. I could then walk the raptor away, and the ragdoll would get pulled invisibly to insane lengths away, because like a cartoon the nose was still stuck on the other side of the door.
Since this was interpolating, it would lead to the raptor's head bending up and doing all sorts of crazy motions until the door next opened, releasing the invisible nose to snap back into position. Good times.
Raptor Tail Insanity
This is another example of trying to make the raptor work well with the complex collider geometry of the environment, without having the tail clip through walls, etc. Eventually I just left it clipping through walls (hey, Link's sword clips through walls in Ocarina of Time), but I spent a whole lot of time trying everything from I/K chains to ragdoll hybrid approaches to even some far more customized code on my part.
That sort of customized code ultimately led to my figuring out how to handle the FRONT of the raptor well, and so was a big win eventually. But the tail always had issues like this. What you're seeing with the tail flipping around here is an inverse kinematics chain (I think 11 bones in the tail) recalculating itself rapidly to try to simulaneously avoid collisions with the environment, itself, and also honor the joint bend limits connecting each bone.
What that led to was it avoiding collisions with the environment and itself, but breaking the rules of the joint bend limits and then trying to figure out a way to fix itself by exerting force on that joint, which then would cause further cascades of insanity, etc. All that, and it's only super expensive to calculate on your CPU, too!
I had used IK chains in the past for many years in programs like Poser, but it was my first time doing something quite this complex, and my first time with it in Unity. Ultimately I really like what is there in Unity, but it has its limits for sure because of the tradeoffs between realtime performance and correctness. This raptor tail was such a complex chain that even with the correctness (number of solver iterations) turned way up, it still couldn't manage it.
Spewing Golden Wood
This one was simply a minor typo on my part, but it was so much fun that I played around with it a bit a few times and recorded videos.
When you fracture the wooden beam, which is fairly golden in color because it was just a test prop, it calculates the voronoi fractures on a separate thread and then passes back the resulting meshes that represent the pieces.
So if I "cut the wood in half," it calculates what the two halves should look like, gives me those two halves, and it's now time for me to hide or destroy the original full piece, and present to you the two halves in the positions that correspond to the original full piece.
Works great, and it's so much fun to do in the game. One tiny hiccup: in this particular part of the video, I had forgotten to despawn the original piece, and so it kept hitting the "I'm done, now create the resultant two pieces" code over and over again... thus causing an infinite rain of pieces of wood. Super easy fix, but I had some fun playing with it for a while before I did.
Human-like Raptor Running And Checking The Time
This was earlier on with a different raptor model, and I was testing how its rig would work if I mapped it as a Humanoid avatar rather than as a Generic one.
There are some special benefits that unity has for humanoid avatars, such as the ability to do foot IK directly (placing the feet of the character on objects more realistically), and I wanted to see if I could trick this into using that kind of avatar but more raptor-like animations.
That... might be possible, I'm not 1000% sure it's not. However, overall it was not something that seemed very promising to me, and using other methods for foot IK was preferable to trying to just keep ramming that square peg at the round hole. It was worth a shot, though, briefly. :)
Anyhow, I temporarily was using some generic humanoid animations (another big advantage of the humanoid avatar setup is that they are universally able to use animations made for humanoids), and the results were so hilarious I decided to video it. This was actually the first blooper bit I shot for the game.
Raptor "Begging" Dog-Style At The Wall
This was an in-progress part of my work to get the raptor to react to the walls in front of it and then not clip through them. I eventually had to set up a fairly complex collider chain and series of additive bone adjusters based on what was presently colliding and what was not.
However, in this early test I was simply making the raptor's hip and back bones rear back as it neared the wall, which had some unintended hilarity with it looking like it was begging. In the actual "final" version of the game, you can see it rear back in a variety of ways, but it lowers its arms and shoulders a bit, and adjusts neck posture so it doesn't look ridiculous.
That's all custom-coded to work alongside whatever animation is actually playing contextually, and it's a big part of how I made the raptor feel so organic.
Raptor Running On One Foot
I don't remember exactly what happened here, but I think I was editing some animation keyframes and basically cutting out bones that didn't need to be updated (for the sake of efficiency). I think I accidentally removed too much, though, and so one of the leg bones no longer had the bend in it, thus leading to a hilarious one-legged result.
Ice Skating Raptor
This was one of our test scenes that we would set up certain colliders in, and there was an issue with the character controller I was using at the time. Basically the raptor's actual collider went below the range at which the raptor would detect the ground, by a couple of cm.
So basically the raptor would be on the ground, but think it was still in the air, and there was no way to adjust that. So the raptor was stuck in part of its old falling animation, and could not jump, but I could steer it around as if it were falling, and it led to this crazy sort of ice-skating look.
My Growing Frustration In The Video
I spent something like 4 hours taking video of myself, and didn't get anything usable. I was getting increasingly burned out and feeling very robotic as I tried to deliver two lines, so I started being silly and goofing off to try and shake off the robotic-ness. That definitely helped loosen me up, and there were a few takes near the end that I probably could have used in the actual trailer...
...had the video quality not been poor, the green screen not been a fail, and Ben McAuly's voice not been so much cooler than mine for the voiceover... ;)
I Love My Job
If it's not clear, I have so much fun working on games. There are so many challenges in all aspects of this business, and even if you're working on a "dumb" game like Release Raptor (which I don't think is dumb at all, but still), it can be just as mentally taxing or even more for the coder/designer as something like AI War's AI was. That was honestly not something I had expected to be the case.
Anyway, the last year has really broadened my horizons in a lot of ways, and I've been able to work in lots of new areas of code that previously I had avoided. 3D is way easier than I had realized, at least compared to what I had built it up to be in my head. And a lot of the huge complexities I had set myself were based around crazy design goals like a lifelike velociraptor that can interact with its environment so heavily, etc.
With AI War 2, on the 3D side a lot of the challenges are on the front of scale, and being unable to use some of the things I know how to do simply because we need to pump so many things through your GPU at a good framerate. That said, that in itself is its own fun sort of challenge, and that's really what I love about making games: each game presents its own unique challenges that no other quite does, so my job never becomes routine.
What Else Is Up?
Keith and I spent something like 5 hours on skype yesterday going through design document stuff and plans for a re-launch of this kickstarter under the assumption it won't fund at this point.
If it does fund then hooray I'm happy to have wasted my time on prepping for the worse case, but otherwise we're making good progress on being ready for said case. We'll keep you up to date as we get closer!