Game Development Community

For newbs like me...

by Daniel Buckmaster · 08/08/2008 (9:16 am) · 4 comments

Today I had some arm animation craziness. I guess it's a microcosm of my experience working with Torque in general. I spent most of the day trying to understand why my modifications to Player weren't doing anything, and trying to fathom the Player animation system. And just now I realised how misled I was in the way I approached the problem, and exactly why things weren't working like they should have.

The goal was to separate the head and arms in their animations. That would require four DSQs - head vertical and horizontal, and arms vertical and horizontal. This would help me with my goals for torso twisting/freelooking, recoil, and NPC interactions. I thought it was a brilliant idea; I had my DSQs all ready to go, with a freshly exported character model.
The code changes were cheerily simple; in updateAnimationThread, some new clauses added, some old ones removed. New TSThread definitions, new animations to look for in onNewDataBlock. I compiled, and everything went to pot.

Not to put too fine a point on it, my modifications didn't work. And I couldn't understand why. I checked all my animations, re-exported, messed around with SVN trying to get back to an earlier revision (that was a hell of a job in itself...), and eventually just gave up and ripped out my changes.

But I still needed to know what the hell was going on. I spent a while doing 'find all references' on anything that I thought would inspire me. In my haste, I ignored Player::mArmAnimation. I mean, I wasn't out to change arm animations, just the look animation.
Th connection was finally made when I realised what the "look" animation actually was. And that what it was was the arm thread. So then I began to look up the arm thread.
Oh, hey, it's networked. Oh, hey, it plays on the server.
Deja vu.

See, it's about this point where, after beating hy head against the deak in frustration at Torque's obtuseness, I want to start beating my head against the desk again because of my own stupidity. That happens all too often. But the thing is, at least I hope, that I learn a bit. Not just about Torque itself, but about how to work with Torque. How to debug things, where to make code changes... heck, even how to restart when I've made a dog's breakfast of my code base.
That sort of experience comes whenever you change something, and it will only help. So, fellow newbs, if things are looking grim - don't beat yourself against a desk. Persevere, because trust me, it gets easier.
And until then, trust me, you can help yourself by thoroughly researching your planned change. If you're modifying existing functionality, figure out how Torque actually does that functionality - understand it solidly, then change it.

About the author

Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!


#1
08/08/2008 (9:27 am)
Quote:I realised how misled I was in the way I approached the problem

Yeah, I know that feeling!

If at first you don't succeed, try, try again ---- and then add the problem to your To-Do-Later list and get on with something else.

8D
#2
08/08/2008 (2:29 pm)
If you look at some of my first blogs, you'll find they are frighteningly similar in tone to this. There are definitely some spots with Torque where you just go.. "Okay.. DOUBLE-YOU-TEE-EFF!!" But eventually a light goes off.. and you're all "OOOhhhh...."

Writing stuff up here helps immensely. Each time I've shared my experiences in wrestling with some nasty obscure piece of code, I've almost always gotten responses from people that have traveled down a similar road and offered helpful insight.

And YES.. the "look" animation should be called the "point" animation. the "head" animation should be called the 'look" animation, and I still don't know what "lookde" is supposed to stand for.. ;)
#3
08/09/2008 (9:29 am)
Heh, I did just that, Devon - and it was quite comforting ;D. I guess these are the experiences of everyone just learning Torque. Ah, I remember the first time I figured out what a datablock was...

Steve - the to-do-later list is a favourite of mine, but now that I've committed myself to a plan, I can't do that as much :P. I think it'll force me to be more productive... at the expense of a few bruises.
#4
08/10/2008 (9:38 am)
Great blog post, Daniel! Thanks for sharing your experiences.