Tuesday, November 16, 2010

Burning Down the House

These last few weeks I have been banging my head against the proverbial digital wall, trying to get my computer game -- or 3D digital game-based learning environment, which sounds more sophisticated -- to work just the way I would like. The primary problems were: (1) the door animations in the game just didn't open and close right and (2) I couldn't get two animations on the same mesh object to play independently of each other inside of Unity. Taking inspiration from a Talking Heads song, I decided to burn everything to the ground and start over. As trying to explain my problems in written format is difficult, I made a video highlighting what the problems were and the solution I found for them:



So what have I learned? Well, for starters, any changes (e.g., scaling and rotation) you want to make to a Blender object that you will eventually import into Unity *must* be done in Edit Mode, not in Object Mode. If you made these changes already in Object mode then Alt-R will clear the rotation and Alt-S will clear the scaling. Apparently, you cannot include more than one animation armature on an object, which makes animations working independently of each other difficult to create (e.g., opening and closing two doors). However, this worked example by Devin and Calin Reimer shows that it is possible, with some advanced knowledge of how Blender animations work inside of Unity and a handle on the C# programming language. Thanks, Devin! Oh, by the way, if you use Devin's script in Unity when you have the Terrain Toolkit loaded, you'll get nothing but errors.

Now it's just a question of getting the models rebuilt, working on a GUI for the player to use, and getting some of the game functionality programmed. Trying to make the deadline by end of next semester so that I can run an experiment with a beginning German language course and publish the results. Let's see if I will be able to get everything done by then.

14 comments:

  1. Cool! But, my computer won't let me watch your whole video. Will people be able to buy the DigiBahn project in strores and stuff when it comes out?

    ReplyDelete
  2. Hmmm...that's strange about the video. As for the game, I'll just release it as an open source project. German language teachers will be able to use it for free as a classroom resource. Besides, I doubt it will be as good as Half-Life 2 so that people would actually pay money for it.

    ReplyDelete
  3. I would! Then I'd, like, show it to all my friends and tell them that I know the guy who made it on BLogspot!

    P.S. How do you make the animation play when you do something in the game? And how do you get textures in the game? (i.e. the cobblestone streets, the clouds?)

    ReplyDelete
  4. Thanks, Natron1, for the kind comments and for supporting the project. I made the animations in Blender using armatures, key frames, and the timeline. It's sorta complicated and took me a few attempts to get it right. "Blender for Dummies," "Mastering Blender" (both available on Amazon) and lots of web tutorials helped me out in this area. As for the textures, these books also helped me out. Although the cobblestone texture was easy to apply inside of Unity and the clouds are part of the standard skybox option that ships with Unity. You can make your own skybox with GIMP or Photoshop, but I just didn't want to spend time on developing this at the moment; too many other things to keep me busy.

    ReplyDelete
  5. Oh. I hate to show my ignorance, but, uh, what is Unity?

    ReplyDelete
  6. Unity (unity3D.com) is a freeware game development tool; the Pro version costs extra.

    ReplyDelete
  7. Ich kann nicht warten bis zu die beherzt komme raus!

    ReplyDelete
  8. Vielleicht Sie werden geben Sie mir umsonst abschreiben....

    ReplyDelete
  9. Sorry. That translating from German to English Web site was corrupt.

    ReplyDelete
  10. Hey!Don't start going glacial-blogger on me!

    ReplyDelete
  11. Sorry about being glacial. It's the end of the semester and I've been busy with correcting, preparing finals, etc. Hope to get some good development work done in the coming weeks, which will mean more posts.

    ReplyDelete