How did Runic Games do it ?


28-12-2009 14:37:33

Hi, I've been wondering for a few things, I'm quit new at this...

I used the models from Runic Games super Torchlight game.

But I don't seem to find how to change from one animation to another ???

I have the following files :


the material file contains the texture ( png or dds ) -> works fine
loading the player.mesh -> ok also
player.skeleton -> contains 1 animation ( wich is exctually no animation at all ) with the name bind

but all the other animations are in different files.


I don't seem to get how I change the animation from that player.skeleton to any of the others.

any ideas ??



12-01-2010 08:45:25


for now I just copy the content from the other skeleton files to one and then extract the names of the animation, that works... sort of cause the run animation does not seem to be able to work correctly... anyway I'm busy with doing some fx like they did in World Of Warcraft using the material file only, with my little knowledge I have, it is coming along quite well.

The only thing that sucks is the animation, wel getting in from 3DS MAX into MOGRE....



12-01-2010 12:45:56

You can change skeletons with 'Mesh.SkeletonName'.


12-01-2010 19:47:15

What do you mean ??

can you give an example plz



12-01-2010 20:06:43

Something like this (untested):
Entity e = sceneMgr.CreateEntity("player", "player.mesh");
e.GetMesh().SkeletonName = "attack_1";


16-01-2010 22:24:24

If I use that code, it gives me a memory access violation runtime error ....

How do you guys use animated meshes anyway ?????
Don't seem to find anything about this on the forums nor the internet ...



01-02-2010 14:27:10

Ok, I did find out how to swap from one file to another ( animation file that is .skeleton )
now the animation sucks big time cause the intial pose is completely different... still working on that...



17-03-2010 03:46:53

I got around this initial problem. I'm not using MOGRE though, but I'm sure there is something similar. The way you load the additional animations is like this (in C++):

SkeletonPtr s = mesh->getSkeleton();

Now this gives by far the cleanest results, and for some models (tarantula and burrower at least) it works perfectly. For other models there are still animation problems although it looks a million times better than replacing the original skeleton because the initial binding is all wrong when you replace. The problem now is that the blending weights seem to be wrong. For example when loading the Troll mesh you get a warning saying:

WARNING: the mesh 'troll.MESH' includes vertices with more than 4 bone assignments. The lowest weighted assignments beyond this limit have been removed, so your animation may look slightly different. To eliminate this, reduce the number of bone assignments per vertex on your mesh to 4.

Upon dumping the mesh to xml you definitely see vertices in the original 'bind' animation that have too many weights. I've played around with different things but just can't get it right. The Troll walks without being distorted, but his legs just don't move exactly right. Obviously there is something I'm missing, since the animations look fine in game. Any ideas?


I just saw your other post: I tried loading the dog model and attaching both the walk and run animations. The run looks much less distorted than the original screenshot in your other thread, but the dog is one of the models that gives the 'more than 4 bone assignments' warnings. This means that although close, the animation is still not 100% of what it is in game. I've been beating my head against this for a bit now and am up against a wall. Your threads are the only I've found on this topic so far.


28-01-2013 03:22:54

the same problem with me.
i solved this problem with the function _mergeSkeletonAnimations, here is my code, a function.

AnimationStateSet* MergeSkeletons (Entity* MainEntity, Ogre::String SearchSkeleton, Ogre::String GroupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
Ogre::String MasterSkeleton = MainEntity->getSkeleton()->getName();
SearchSkeleton += ".SKELETON";
Ogre::SkeletonPtr pSkeletonMaster = Ogre::SkeletonManager::getSingleton().load(MasterSkeleton, GroupName);
Ogre::SkeletonPtr pSkeletonSearch = Ogre::SkeletonManager::getSingleton().load(SearchSkeleton , GroupName);
Ogre::Skeleton::BoneHandleMap boneHandleMap;
return MainEntity->getAllAnimationStates();

mainEnt is the dog's entity, SearchSkeleton is Walk.skelton.....etc, pSkeletonMaster is dog.skeleton, AnimationStateSet can help you to operate the animations.