Game Development Community

Does TSAnimate require TrackAnimation/AnimationFSM?

by Patrick Chambers · in Torque X 2D · 04/09/2008 (1:51 pm) · 1 replies

I've moved on to testing code to get my test sequences to animate on my models and although my loading code doesn't product any errors, it also doesn't animate anything when ran. I've started off with a simple TSAnimation that grabs a very simple sequence inbedded into my test DTS model. I take that, and add it to a Animation Component (which for whatever reason has to be added to my player object and have that player registered to the ObjectDatabase before I can do so). After all that, I just call the TSAnimation.Play() function in hopes that my cyclic test sequence will play in the game. No dice.

What I was wondering is in the FPS Demo only two real top level animation types are used: Track Animation and Finite State Machine Animation. TSAnimations are used to encapsulate the actual sequences, but they themselves are not added directly the the Animation Component. Is that the only real paths I can take for a simple animation? Use an interfaced track animation or a full FSM? If I just have a simple model that always animates during a game, shouldn't the TSAnimation just work as I am attempting?

As far as my debugging goes, the TSAnimation does load and populate, and the Animation Component is successfully added to the player object. The Animation Component should be updating automatically via Update(), and therefore I would assume my attached animation should also play automatically and endlessly unless I purposely stop it.

Am I missing something, or does the Animation Component not work like I think it is?

#1
04/11/2008 (1:43 pm)
Small update...and a small gripe.

After a few extra days of hammering on the code base to try and get an animation to load and appear via code, I decided this afternoon to toast my entire code and try duplicating the objects in the txscene xml to see what happened. What do you know, the bloody thing loaded and animated perfectly!

Apparently you can use TSAnimations directly in an Animation Component without going full bore with a FSM. Which is good to know. Also apparently, objects loaded up via XML in the txscene have magic initialization that make them work and straight coded objects do not. (Grrrr!)

I've traced through the Deserializer a few times trying to find this magic init code, but can't find anything in there that differs significantly from what I was trying to do manually in my game.cs. I believe I read a December post from John K. that he was seeing similar problems when he was trying to pull out the FPS Demo txscene FSM objects and put them in code, but I never saw any real follow-up post that said whether he figured out what was up there or not.

I guess for now, I'm gonna suck it up, assume that loading animated objects in txscene is the only way to go and actually push on, as fighting these types of problems with TX is really starting to frustrate me. However, if any of you have actually figured out what is going on between the SceneLoading stuff and manual coding of objects, I'd really like to know. I hate pushing on with mysteries left behind.