Matt's Dev Diary 004: Lighting and Characters

warning: Creating default object from empty value in /home/buckman/public_html/neo/modules/advanced_forum/advanced_forum.module on line 492.
Matt Barton's picture

Today I spent most of my time working with Blender. The first order of the day was to learn all about lighting. Blender has a dizzying amount of options for this, but I'm not even sure I'll need any of it so I didn't spend a lot of time here. UNITY has its own lighting system, and I'm not sure to what extent I'll be able to use lights I make in Blender anyway, but I figured the knowledge would be transferable in a general sense. In any case, it is fascinating (and addictive) to just experiment with all the lighting options and see how they affect shading and such. You can really get some nice shading effects with different kinds of lighting. Here's just an example:
Cube with LightsCube with Lights
The next chapter was on Character Animation, and the author pointed out two different people-making tools you can use. Both were free in terms of cost: Make Human and Daz Studio. While you can try to make humans from scratch, these tools essentially give you an interface similar to those seen in games like Skyrim where you can adjust and tweak your face, nose, etc. The exciting part is that you can export your creations into Blender. I may know next to nothing about modeling and animation, but even I can use these interfaces and my combat mode looks a helluva lot more feasible.

However, here's where I hit some major snags. First off, I ran into some posts complaining about DAZ Studio's EULA; apparently, you're not allowed to use any of your creations in UNITY or any game. However, there seems to be some confusion, and it's obvious that SOME people are using it. I dug around, wasted a lot of time looking at forums and such, and finally just emailed the company to hopefully get the lowdown on this.

If it turns out I can't use it, that's a real shame, because the interface is drop-dead easy, the models are gorgeous, and there's all kinds of built-in animations and such that look very promising.

MakeHuman is open source and looks it, but I didn't see any limitations about using it other than you're not allowed to make a direct competitor with the software itself. (Duh). There's not nearly as many bells and whistles, but on a positive note, I was able (after some researching) to export a model directly into Blender, armature attached. I was even able to pose the model a bit in Blender! This is pretty exciting for me, since it means I'll likely be able to bypass the forbidding step of having to rig my own humans. On the downside, there's very few assets included with this product, and I didn't see any (obvious) places online where you can download extra templates and such. If anybody has some leads on this I'd like to hear them.

There's still an infinite amount of stuff I need to know how to do, of course. For instance, how would I make somebody sit down in a chair? I think I could figure out how to get the animation done in Blender with poses, but the collision code and such needed on the UNITY side; not sure about that. I hope my UNITY books will walk me gently through this sort of process. I don't really expect to be doing much custom animation or cut scenes; I realize this is stuff that could get infeasible in a hurry. The only things I feel I must have are walking, raising a shield, idling, and some hopefully simple combat animations (swinging a sword, casting a spell, etc.) You know, the typical stuff you'd expect to see in an RPG. The characters will only be seen during combat anyway, except in the unlikely event I need to show them in a cut scene or some such.

I'm still hesitating to try to import anything into UNITY from Blender, though. I tried importing some stuff from my previous game, and that didn't go well at all. Hopefully, I'll have more luck next time, but I'm a apprehensive about it.
Lady made with Make HumanLady made with Make Human
I noticed it's not quite as intuitive as I'd like; the rig isn't limited to "realistic" deformations and it's easy to get her bent out like Mr. Fantastic. I also wanted to make her smile, but somehow moving her head also removed the armatures for her lips. Sigh. Obviously, it's not going to be as easy as I'd hoped, and like always there are a hundred little things you need to know about and do to make it work like you'd expect!

From what I've been able to gather so far, once I get these into Unity, I'll be using triggers of various sorts to activate whatever frames in the animation I need. I noticed an option in Unity to "apply physics to animation." If I'm reading that correctly, it'll automate some of the work of trying to integrate the character into the game world. I'm still completely mystified about how walking and such will work, especially with the differences in terrain I want. I've noticed some amateur games that look really bad when characters are going up and down hills--they just rise in the air and then continue forward. UGH. If it turns out I'm limited to that kind of animation, I'll just rethink the level design as perfectly flat. :)

At any rate, you guys with some experience in these areas--man, I'd love to hear from ya. I don't even have a conceptual framework in my head for how to integrate the 3D models and animation with UNITY. Assuming I make some decent animations using Blender for stuff like walking, running, swinging a sword, etc., how hard will it be to get that working right in Unity? I'm also wondering if I'll be making all the animations in Blender, or if it's possible to do a lot of this work in Unity itself. I'm not sure what I should be doing in what, to put it simply.

Comments

Rowdy Rob
Rowdy Rob's picture
Offline
Joined: 09/04/2006
Perhaps (maybe) I can offer some useful/useless thoughts here.

Matt, I was about to recommend looking into both Daz Studio and especially Makehuman, but it seems you're already ahead of the curve there. I didn't know about Daz's EULA, so I wouldn't really bother with Daz at this point.

Makehuman has been especially fascinating to me, although I think it's been at least two years since I last tried it. It appears to have come a long way since then. I didn't know that it comes with "armatures." So much the better. But I can't think of a better freeware tool that allows you to come up with various humanoid objects quickly.

As for the problems with posing your humanoid object in Blender, you may have already done this, but if not, I suggest you look into "inverse kinematics." Inverse kinematics is supposed to allow for easier posing of "boned/rigged" objects, preventing some of the posing and deformation problems you're having. If you pull the finger forward, the arm is supposed to follow in realistic fashion, much like posing is done in Daz or Poser, without the odd deformations you seem to be experiencing. A "rig" can get very complicated if you put in "restraints" to keep joints from twisting in unnatural positions (i.e. a hand twisting 360 degrees).

I admit I am only vaguely familiar with the concept of "inverse kinematics," but its purpose is to aid character animators in creating poses and (of course) animations, so it's designed for the purposes you're trying to achieve. I don't know what the complexities or limitations of Blender's IK system is, but hopefully this will give you some direction to look into.

As for importing Blender objects into Unity... again I am on uncertain ground. But I'm fairly certain that Unity supports 3D Studio objects natively (.3ds files), and Blender supports exporting to 3D Studio format, so if you're not already doing this, this might be worth looking into. Export your objects from Blender in .3ds format to Unity, and perhaps everything may go smoothly. It all depends on just how well Blender supports the .3ds object format.

As for the character "rigs" for animating human characters, it might be worth checking to see if there are any PD Blender human objects that come "pre-rigged" for IK animation. I don't know, I haven't checked, but that's where I might look into if I were in your place. Assuming it's a reasonably close match to a "Makehuman" object, I think you can copy the "bones/rig" from the PD human (assuming it exists) into your own Makehuman and attach it. That might save some time.

I'm being totally hypothetical in this post, but maybe there's a glimmer of something useful in this.

gilgamesh (not verified)
Ragdolls

You probably don't want/need ragdoll like physics to make a character sit. Make a chair model and then take key frames. That level of realism should be ok.

You can let you character stick to the floor by rigid body physics or simply a constraint.

There are two ways to load a rigged model from MH into Blender, MHX and Rigify. You can pose your model and change facial expression using sliders (Pose tool and Lipsync tool). Raising a shield should become a walk in the park with these.
http://sites.google.com/site/makehumandocs/blender-export-and-mhx

Rowdy Rob
Rowdy Rob's picture
Offline
Joined: 09/04/2006
Nice, Gilgamesh
gilgamesh wrote:

There are two ways to load a rigged model from MH into Blender, MHX and Rigify. You can pose your model and change facial expression using sliders (Pose tool and Lipsync tool). Raising a shield should become a walk in the park with these.
http://sites.google.com/site/makehumandocs/blender-export-and-mhx

That's some excellent info, Gilgamesh! Rigify looks very Poser-ish, and looks like a fantastic tool for character animation!

Matt Barton
Matt Barton's picture
Offline
Joined: 01/16/2006
Indeed, thanks, Gilgamesh!

Indeed, thanks, Gilgamesh! You're obviously a pro at this, so thanks for dropping in to share your wisdom.

It looks like I'm at least a few days or weeks away from really being prepared to tackle rigging. Even my book author here says it's a painful and difficult process even for him, so I'm really wondering if I'll be able to make any headway! I will definitely try to get those sliders you mention working.

As long as I have you on the line, do you know where I can get some more hair and possibly some clothes and such for use with Make Human? Or is that something folks wait to do AFTER they've got it into Blender?

Man, even the remote possibility that I could be able to do LIP SYNCING and MOTION CAPTURE is mind blowing! Man, that'd be awesome! I'll definitely spend some time exploring those possibilities. Maybe making some actual cut scenes isn't pure fantasy after all, though I'd already pretty much resigned myself to making some kind of moving comic panel thing instead.

n/a
Matt Barton
Matt Barton's picture
Offline
Joined: 01/16/2006
This guy makes it all look SO


This guy makes it all look SO easy! :)

Lots of stuff he was doing there that I'm not up to yet. Hadn't even seen that action editor thing he was using; obviously a must. The script he showed there didn't look bad either. I don't want to get too optimistic here, but DAMN! Again, what at first seemed like a total fantasy is starting to feel more like a real possibility.

n/a

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.