I’m a programmer trying to animate a character walking for a game project, using Ogre. I’ve made a very simple walk cycle in Blender and exported it to Ogre, and it plays just fine. By fine, I mean it works, but there’s terrible foot sliding. This is because I just animated the walk in-place (at the origin) in Blender, and of course I don’t know what “speed of walk” that corresponds to, so when I move the character in-game the motion doesn’t necessarily match up with the movement of the feet in the animation.
So my question is: what’s the normal approach for this kind of thing? At work we use Maya, and the animators either animate a special ‘moveTrans’ node that represents the “position” of the character (or have the exporter generate it for them from the movement of the root node), then the game can read this to know how fast the animation moves the character. So in the Maya file, the character will walk forward for one cycle and this extra node will follow along with them by their feet. I’ve not seen anything like this in open-source land, and there’s certainly no provision for that in the Ogre Exporter script. Presumably some of you artist types have had to make walk cycles and so on for games; what do you normally do for this?
The engine itself determines what needs to be done for the final output format. Doom 3 & based games have the character walk as expected in the mode file & that’s the motion speed. Pretty cool. Most engines don’t do that.
Most times you would move your character with a master bone & animate the legs, arms, etc. Moving the master bone gets you how you want it to walk. But you still have the same problem as before: if you don’t know how that speed translates in to the engine you’re working on them it will still slide (Doom 3 doesn’t have you move the master bone, it stays put & everything moves in relation to it. This is done for game designing purposes).
The best way to get a feel is to look at the code that determines the speed.
I’ve had a good look around the forum and at batFinger’s samples, and unfortunately I’m none the wiser about how to actually implement this. Clearly the animations should not be animated in place but how to extract the motion information for use in the game is definitely not standard, even for something with a lot of users like Ogre. I’ve skimmed through the Ogre Exporter source code but I’m not too familiar with Python; it doesn’t look like it would be easy to implement this myself. So for now I’m just going to ignore the problem and match up the motion as best I can! Thanks anyway, guys!