Jump to content
Eternal Lands Official Forums
Sign in to follow this  
Roja

Cal3d, New Character Animation Format

Recommended Posts

Got a new question :P

 

Currently, with the md2 formats I have made animation "actions" such as this:

into sit

sit idle

out of sit

 

those are 3 separate animatons basically. The last frame of "into sit" is the same frame as "sit idle" is the same frame as the first frame in "out of sit".

Do I need to still have a 1 frame animation for the "sit idle" pose with cal3d? Or just the "into sit" and "out of sit" ones? The last frame of "into sit" would stick until "out of sit" is called.

Share this post


Link to post
Share on other sites
By the way.. we really need a hug animation :P

And kiss :D

 

As for the bounding-boxes, if the tile map is still updated, it would only influence how many tiles needs to be checked/updated. I thought you were suggesting storing a bunch of rectangles instead, checking against all of them.

 

We would need two versions of the check function, one that checks only the outer range (at least for rectangular actors) for moving, and one that checks them all for teleporting. And all the occupied tiles need to be marked as occupied, to avoid a 1x1 person teleporting into a 3x3 polar bear (they are bigger than brown bears).

 

The 45 degree problem could be solved by storing two bounding boxes with the character, one regular and one 45 degrees turned. This would give the most flexibility for funny stuff, like a dinosaur where you can walk between the legs or something.

Share this post


Link to post
Share on other sites

yeah, kisses :)

 

by the way, take a look at this here: http://www.blademistress.com/screenshots/showshot.php?shot=7

 

It's a screenie from Blade Mistress, another underground MMORPG. It's way behind EL in many cases, but just look at that Monsters, those hugh monsters! Awesome! And it just feels great to attack them with 20 other players!

Edited by kl4Uz

Share this post


Link to post
Share on other sites
hmm, interesting...

 

edit:

hrmf, seems they pulled a even faster one then entropy did. their monsters are stationary. you can see them a mile away and dont worry about it rushing you. its like the fluffy would sit around and wait and as long as you stayed x distance away from it, it would never attack.

Well, it kinda makes sense, maybe they have a limited field of view and can't see you when you're far away.

 

Btw, since I started playing with the lighting too, I thought to implement a favourite effect of mine, bright halos around the lights. It makes the scene a little more "alive", and it's really simple and cheap.

 

Here:

http://img185.exs.cx/img185/8533/el11ik.jpg

Share this post


Link to post
Share on other sites

Very nice.

 

What approach are you using to draw the light halos?

I implemented a simple version in bmc ( cvs -d:pserver:anonymous@cvs.bmc.berlios.de:/cvsroot/bmc/ co bmc ) that was merely drawing a halo using a texture. Would be interesting to know how you're doing it :)

 

...
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDisable(GL_LIGHTING);
glPushMatrix();
glTranslatef(x_pos, y_pos, z_pos);
glRotatef(-rz, 0.0f, 0.0f, 1.0f);
glRotatef(-rx, 1.0f, 0.0f, 0.0f);
glRotatef(-ry, 0.0f, 1.0f, 0.0f);
get_and_set_texture_id(halo_tex);
glBegin(GL_TRIANGLE_STRIP);
glColor3f(l->r/5.0f,l->g/5.0f,l->b/5.0f);
glTexCoord2f(u_start,v_start);	glVertex2f(-scale,-scale);
glTexCoord2f(u_start,v_end);	glVertex2f(-scale,scale);
glTexCoord2f(u_end,v_start);	glVertex2f(scale,-scale);
glTexCoord2f(u_end,v_end);	glVertex2f(scale,scale);
glEnd();
glPopMatrix();

glEnable(GL_LIGHTING);
glDisable(GL_BLEND);
}

Share this post


Link to post
Share on other sites

Wytter, I basically use the same method(just a textured billboard), only that I disable depth testing. With depth testing, the halo gets clipped against nearby geometry, and that's not good, it shows that it's just a quad. Also, in order to avoid the halo to show up when it's completely obscured by objects(since depth test is disabled), I make a simple visibility test using ARB_QUERY extension. If the point light is visible, the I draw the halo, else I don't. I wrote a small tutorial about it a couple of months ago:

http://www.angelfire.com/games5/mikeman/BrightLightsGL.htm

 

In EL, I don't use ARB_QUERY, I do the testing by just reading from the z-buffer, so it can run in cards that don't support queries.

Edited by mikeman

Share this post


Link to post
Share on other sites

Hmm. Here miniviewer loads them, but after initializing it crashes with a SEGV signal inside Cal3D (CalPhysique::calculateVertices(CalSubmesh*, float*, int) to be exact). As miniviewer loads all files here successfully there is no syntax error with the files and the model is accepted at first.

 

There has much changed, both with blender as well as cal3d within the last few months. Cal3d released 0.10.0 several weeks ago, and blender is at release 2.36. Also the blend2cal3d.py exporter stays now synchronized both with cal3d and blender sources, which was introduced with blender 2.34 or 2.35 and cal3d 0.10.0. Before the two shipped versions of the exporter were different for cal3d and blender.

 

 

@mikeman: miniviewer accepts both binary and xml format of cal3d here. And you can easily convert them into each other with the cal3d_converter tool, included in the tools/converter subdir of the cvs source. Also you can load both binary and xml files from within cal3d with the Loader utility class.

Share this post


Link to post
Share on other sites
@mikeman: miniviewer accepts both binary and xml format of cal3d here. And you can easily convert them into each other with the cal3d_converter tool, included in the tools/converter subdir of the cvs source. Also you can load both binary and xml files from within cal3d with the Loader utility class.

Yeah, I saw that and rushed here to tell Roja it's ok, but you beat me to it :blink:. I'm working on it right now.

 

-EDIT: Well, I think the skeleton file (testcal3d.xsf) may be the problem. All it contains is:

 

<HEADER MAGIC="XSF" VERSION="900"/>

<SKELETON NUMBONES="0">

</SKELETON>

 

This can't be right.

Edited by mikeman

Share this post


Link to post
Share on other sites

This might be, the animation files have boneids assigned, but they are not found at runtime, because there's no skeleton having this ids.

Share this post


Link to post
Share on other sites

Ok I'll take a look at it more when I get home. I kinda rushed that together last night anyway.

Btw, the cal3d exporter that shipped with 2.36 didn't work for me, so i found anohter one that someone had made...on the forums of the cal3d sourceforge site.

Share this post


Link to post
Share on other sites

I have another, important question. What SHOULD the frames per second animation be?

Right now, I think we can all say that the fighting animations are way too fast. The rest are pretty much ok though... but i think we can slow things down a bit. Ent said they're currently 18 i think?

 

And also, how exactly are the bones positions and the interpolations stored? Does cal3d only store the bones that move for each keyframe I lock them to in blender? Or...are ALL the bones positions stored at ALL keyframes regardless?

The reason I ask this is let's say I have a 13 frame animation. Right now I lock ALL the bones to a keyframe spot on frames 1, 4, 7, 10, 13. The rest of the frames have no bones set, they are only interpolated with the software. Now even though I lock ALL those bones to those keyframes, not all of those bones need to be locked, because not all of them I need to move..i just lock em all cause it's easier. So what I want to know is, each time I lock a bone, does that take a spot in the file? Does it make the file bigger the more bones I lock in a place? So should I optimize it to lock the least bones possible?

 

Hope that makes sense.

 

 

Edit: oh nevermind I think....I forgot that because I'm using IK chains I have to bake the animations in blender to keyframes anyway, so no matter what I still have to lock all those bones to each of their keyframes that I originally locked them to. :(

Share this post


Link to post
Share on other sites

Ok, miniviewer can load it, and it looks like this:

 

http://img162.exs.cx/img162/300/model3cg.jpg

 

There are 3 issues:

 

1)That thing that is sticking out of the guy's ass, what the hell is it?

 

2)The lighting isn't smooth, because I guess face normals are used. I assume Blender has a "smoothing groups" option or something like that. Using the .xmf mesh files you send the first time solves that(the model appears smooth lighted), but that "thing" is still there.

 

3)In the "walk" animation, the player gets "stuck" in a frame longer than it should, then it goes on as usual. That happens in every animation cycle. I don't know, maybe the first frame is the same as the last, thus causing it to interpolate between two identical frames?

Edited by mikeman

Share this post


Link to post
Share on other sites

lool..that thing is an unweighted vertex, I spotted it last night and fixed it, but you sitll have the old version.

 

I have no idea why the animation is pausing. Yes I did have the same frame at the beginning and at the end of the animation, however I also tried it withouth that frame there and it paused 1 frame before the last one when I play the animation in blender. I'm stumped as to why this happens. I'll give you the newer model anyway, without that double frame and see if it still happens.

 

And yes I can make the model smooth in blender, I didn't know I had to do that because I wasn't doing it for the md2's..

 

I'll post an updated file in an hour or so.

Share this post


Link to post
Share on other sites

Alright, here's a new download. I also found out that I need at least 2 defined keyframes in blender for the animatino to export. So default has 2 keyframes with the exact same settings.

 

http://www.eternal-lands.com/misc/cal3d_test.zip

 

 

Oh and I forgot about the smoothing, I'll do that with the next file I put up, with more animations once we find out about that pause in the frame loops.

Share this post


Link to post
Share on other sites

Ok... now the skeleton file doesn't work. Miniviewer complains about unsupported file format. It's a file with size only 12 bytes, so I guess something went wrong again with the export.

Edited by mikeman

Share this post


Link to post
Share on other sites

Normally yes, but depending on how you plan to implement it a fixed number of frames for the walk might be required, so that the animation loops properly. Otherwise the character might stop with the legs in the wrong position, etc.

Share this post


Link to post
Share on other sites

Cal3d will either loop the current animation(like walk) or execute it once as an action(like fight moves) and return to the previous state. I don't need fixed number of frames. Frames per second just define the "speed" of the animation.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×