Where is my animation?

Just got some stuff up and running with JME for the first time and I'm really impressed- in a couple of hours I've got my model exported from blender and imported into jme along with terrain and lighting and all manner of stuff. Fantastic. It makes me feel like there is a chance I could one day get around to writing that game…



Anyways, I've got all my stuff imported from blender using the blender-xml exporter, but I don't really know enough about the scenegraph to be able to work out how to get the animation running or how to switch between animations. I've got as far as working out that I should be using the KeyframeController but I don't know where I should put it- I'm sure the animations are in the XML file ( otherwise it would surely not need to be a nearly 70 meg? ) but I can't work out how to access them or what I need to add the controller to or what I need to add to the controller.



I'm sure this is pretty obvious to anyone else in the entire world, so I apologise in advance for my excessive n00bness…

Are you making use of Hevee's blender plug-in or are you saving out as some other format then loading that format into jME?



If you are using Hevee's, posting in this thread: http://www.jmonkeyengine.com/jmeforum/index.php?topic=1439.0 usually wakes him up.



Have you tried searching through that XML (30 Meg? Wow), to look for a KeyFrameAnimation tag?

Not yet, it's 30 meg…



Now I know how easy it is to import stuff I'm going to start having a serious play with the modeller and trying to get my models a little smaller and a lot better before I take them back into the engine. I am using the blender exporter and it really is very good and easy to use. So far the monkey engine is making a very good impression…

Look, I little of help here. I used fantastic hevee's blender exproter. Latest version I used was capable of me writting in one of the text windows in Blender (you go to TEXT editor window, one of the "modes" in blender, there down you see a rolling list if u click on certain "v" arrow, so to select the several texts that comes with the exporter , if I remember well. Well, there's one about keyframes. there you write down lines (I think u needed to care for no spaces at beguining and such) so to write the STEP you want, ie, 5 will export only one meshframe every 5 frames! )



This is terribly important with any vertex animation export format.  A note here: Interpolation. A brief little explanation before. You have keyframes. That is, changes in time. be it a rotation, move, etc, of something. Those occur in a timeline. Well, you have to main types of character animation ways: Bones based, and vertex based. Hevee's format, last time I checked, is vertex based. Which indeed, is better for very low machine (but if your meshes ar small, and you use few keyframes)  as bones -except milkshape format- require weights calculations, and if done by software for no card support…bad thing. 



Well, interpolation occurs in any of the two ways. If you do vertex based aniamtion, the concept is plain simple: you store a WHOLE character mesh every time you set a keyframe.  Now think of…a typical 2,000 or 3,000 tris character. That's a load of meshes per frame. hevee's standard ouput is the best quality one: a keyframe per frame. Accuracy in the movement you made in blender, is total this way.If you target to gamers machines -no necesarily "powerful" ones, it's ok. And whenever the machine could eat it, I'd go fo r 1 by 1. But would try how is seen in 2 by 2 and even 5 by 5.



The problem is…when you use really few keyframes. You're not exporting the mathematical curves of interpolation among the bones u used for the animation. Is simply linear interpolation. Do a test, and will see that with very few frames, it becomes too mechanical, and feet sink under floor, etc. Why? easy, is not taking in account the interpolation curves. This happen with any vertex animaiton export format.  What happens when you add more keyframes: you're grabbing more and more "photos" of instants, and while interpolation is yet plain lineal, is grabbing well all or enough moments to fool the eye (art is allways fooling the eye)



Md2 has stronger problems than hevee's format, as also md3.  Why? Simply because hevee didn't need to put the weird limits needed for the time and moment those old formats got released,neither was counting for edsigning for a very specific game (luckily, carmack's latest, md5, is really good for any purpose…but have weights calculation(anyway, many artist we hate bones without weights ;)  ))  Ie: md2 has vertex limit very low, usually a problem with precission, and both md2 and md3 have problems with breaking the mesh when there's a border on UVs(very very often). And way more.(certain problems with transformations, etc. Besides many of the packages plugins are far from good.hevee's I'd say is better than any of those. )



So, imho , like allways, every format has its use. I am thinking now hevee's format is very good to go with usual needs. maybe specially good when frames can be reduced a lot and though doing this, wont be much seen if some feet sinking occur , or interpolation starts to fail when very low keyfraems number.



We were very nicely helped by hevee in its moment, but for the very low machines we aim to, besides size, needed to go with md5, as noticed it seems  to be more or less lightweight. The blender plugin for it is amazing.



Indeed, for me are the best two options in its type: Hevee's for vertex aniamtion, md5 for bone-weights based.



Even more, I think of a load of uses of Hevee's which would be hard with bones formats…like some animatable scenery, curtains, flags, etc, etc. And as I said, we were really close to adopt the format if we weren't in a terrible need of use a really low in HD memory animation format (as we base on downloads, very small size) and couldn't make it calculate big count meshes keyframes.

So, what I say, is I recommend it, but play with keyframes generated text window inside blender, as that's the key ot reduce that huge size. To say that I think I reached one meg for a walck cycle, I think, and mesh was about 1,500 tris, that for me is enough to do a nice character (heck, at work am forced to do em at 450 XDD )

So, pretty usable but I hope my tricks helpe here.



Also, model. If the model is waaaay hi in polycount, tell ur artist to reduce. Is a general good rule. If you aim for performance, I'd say, try to make a great model of no more than 2k tris. I've done often , for shareware like games, and is enough. If you aim machines with more power, and allways thinking in a typical fps,not to overloaded, maybe you can reach safely 3500.Bu u don't need more than that. (if so, go for normal maps, bu dunno if there's that in jme yet) Anyway, 3500 is a lot. Trust on good texturing and good vertex normals(smoothing info, smoothing groups, hard edges in Maya, or wings3d), is key thing.



Each keyframe will store those 3,500 tris (so much more vertices than that number) …that's why u end up having so much megs for anim file.



OH! Forgetting…u dont need to export every setting. Ie, no vertex colors usually in a character. Unmark that in exporter, as i f not, hehe, you will export all those coords in text file TWICE, resulting in double size in memory or so…just leave pressed what is really needed. material info, uvs. etc. But check all to see how much u can discount.



Good luck, is a very nice plugin.










oh, and after reading that above, check the thread Mojo pointed to you. It tells in last posts how to set the keyframes. I was forgetting last trick was actually deciding WHICH keyframes you want, not simply an step. That is, frames…1, 5, 7, 22, 25…



so you add em in the main points where action happens, and adding for example one in certain moment where foot is more sinked, being maximum sinking there, you avoid any sinking before and after…dunno if u understand… :slight_smile:





indeed, I remember: our problem was we have a very specific need of going really crazily low in Kbs size of each animation. That was why we used finally md5. I told hevee's I had to change, and the man gave me one of the more gentle responses I have ever had from a programmer :)  So, he tends to be very helpful. (but read well all info here and what is explained in that thread (i summarize above, besides add some personal experience info not posted))  …as surely you will not need more help than that if read carefully. :)  And tell a summary to your artist. I know we artists like to read little paragraphs (ironically, I like to write long ones ;)  )

the main advices to him are short:



-reduce mesh tris count



-do good texturing and smoothing normals so to do the "higher look with lower mesh" thing.Normals well set, and modelling with that very in mind, do allow to output what looks much higher. Texturing if good, does the rest.



-dont export from blender non used features in hevee's dialog



-use blender text window, with keyframes text window that you can switch to from the exporter scene. Type in that text the exact keyframes to export(yep, a bit boring, but heck, it's a good trick! :wink: )






a really good situation I'd totally go with hevee's exporter, is strategy, many units from a distant game. There, really low mesh keyframes, and little unaccuracies for low keyframe count, do it ideal, besides 200tris or lower will alow to put much more keyframes, as wont be so much memory, and so, not neither much cpu. Anyway, I don't have a clue, but I think surely even high mesh counts do kill lees than bones and weights. vertex anim so went ok in those old machines. halflife1 could have had weights, but they avoided for the hardware at that moment. That i read long ago at least…



As I said, in that scenery, I'd use hevee's format better than md2 or md3. Is simply way nicer to the artist, and more powerful. And I wouldnt dare to put a load of strategy units in a weights and bones format. Surely is done in AAA games, but…Warcraft3 where made with shaders for that. I've remembered reading that othe rthread now active about 20 milkshape models at a time…

Thanks snaga, there is a lot of useful information there!



I think I can get away with keyframed animation because the way I'm planning to work should enable me to have more or less flat terrain in the areas that the player can move over, so that I have more of a 2D maze effect ( everything in 3d, but principles apply ) and don't risk players sinking into the terrain.



I'd love to be able to do things with skeletal animation, but right now I'm doing my own modelling, design and programming and I don't want to make things ridiculously complex for myself this time around.



I don't want to make things more ridiculously complex for myself, anyroads.


Glad to be of help. :)

then yup, hevee's route provides you -provided you take in consideration some things-  a very direct way, if hd memory is no more issue than it is in any standard machine (and not the more than 5 years old ones I'm targetting ) .Or target old ones but the feet sinking is not a problem(or you handle it selecting very well keyframes, not minding if movement is a bit robotic at the end for low keyframe numbers).

if you can just output a step 2 (every 2 frames) export, you're all set. just do your blender anims and everything and export with hevee's exporter, and you'r free of problems :)


I don't want to make things more ridiculously complex for myself, anyroads.



Way to go. That's the only clever way to do a game :) (and get it ended )  (and I very well know what I speak of...  ;) )
is more important than skills, cool programming, freaking good ability to do graphics...that sentense is more important than anything else to do the long thing than a game is.


It's the cruel yet important thing about having years of experience as a developer- you slowly realise that the most important thing is to get something finished. I've seen so many great projects vanish without trace on Javagaming and seen the relative simplicity of the tasks that have succeeded so that I now know that if I'm ever going to finish I will have to keep thing simple- I've got my project narrowed down to four main areas  - if I get it complete with those then I can worry about adding more cleverness to the sequel. I know where my strengths are as well- I can afford for my models and scenery to be relatively simple if my storytelling is good and my gameplay is involving - so I'm trying to play to those.



It's still ambitious in the extreme, but it feels attainable…