Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / Animation glitches ...

Author
Message
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Jun 2004 18:33
Ok I need a little trouble shooting with animations with dbpro.

I'm making a really complex character animation for my game. Basically, in the region of 50 different animations, from combat moves, to death moves, injury moves, getting up from the ground, jumping climbing etc. The basic pattern of my system is:

oLoop Current Animation over and over
oWhen a new animation is required
-Stop current animation
-Set keyframe to first frame of new animation
-Interpolate there over the next 4 cycles
-When done, start new animation looping/playing

It all works fine. I can seemlessly move from running, to jumping, to falling, landing etc. All the animations play fine, and animate as expected. However, certain combinations of animations act strangely.

For example, I use a generic jump animation for jumping from stand still, or from walking forwards. From stand still, when I hit jump, it interpolates to the first keyframe of the jump animation fine, then runs the animation fine, and my character jumps. However, from walking, it all works in exactly the same way and works fine until half way through the jump animation, where the lower right leg goes insane for a few frames, then continues as normal.

This is weird.
-It's nothing to do with frame interpolation, because its all fine at that stage.
-It's nothing to do witht the code, cos at the stage of the glitch, there isnt any being run - just the animation itself.
-It nothing to do with a glitch inside the animation, as the animation looks fine in milkshape, as well as runs fine in db on its own, and fine when run after all other animations.
-The error only occurs when this animation is run after the walk animation.

I can only summize it's something to do with specific joint rotations, but I use the same local rotation for all animations. I could understand if it was during the interpolation stage, and db was converting a very twisted limb from another animation to the rotation of another limb, and it had to go around the houses, but that's not the case, because its mid animation. I have gone back into the animation and forced keyframes everywhere to not give any freedom of interpretation to db - it just has to obey the keyframes, but still I get the twitching rotating mad leg for a few frames.

Anyone have any clue? I am using Milkshape and the JT Exporter, and it's all been fine, except for these rare combinational glitches.

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Jun 2004 19:54 Edited at: 2nd Jun 2004 19:58
Ok, sussed it, I think.

WARNING - Big rant, but should be useful for anyone who intends to append lots of animations together.

You cant physically define an animation to be longer than the amount of frames (obviously), so the biggers playback of an animation you can have is:

play object obj,0,total object frames(obj)

If you append an object to this, you want to get the total object frames before you append it plus 1, and afterwards, to get you the frame range to play back the animation you just appended.

ie.
man_walk_start_frame = 0
load object "man-walking.x",1
man_walk_end_frame = total object frames(1)

man_jump_start_frame = total object frames(1) + 1
append object "man-jumping.x",1,total object frames(1) + 1
man_jump_end_frame = total object frames(1)


That's all fine and dandy until you append another animation. As soon as an animation is padded between two other animations, problems arise. To get a looping animation completely playing (without any tiny glitces) when it's padded between two other animations, you need to add an extra frame. This is because it appears DB needs an extra frame when animations are padded.

To explain this, to make a run animation in the middle work properly, I need to do this:

ie.
man_walk_start_frame = 0
load object "man-walking.x",1
man_walk_end_frame = total object frames(1)

man_run_start_frame = total object frames(1) + 1
append object "man-jumping.x",1,total object frames(1) + 1
man_run_end_frame = total object frames(1) + 1

man_jump_start_frame = total object frames(1) + 1
append object "man-jumping.x",1,total object frames(1) + 1
man_jump_end_frame = total object frames(1)


this supplies the extra frame it needs to complete the animation, but obviously this is also the first frame of the next animation. This seems to be unnoticable sometimes, because sometimes the first frame of a new animation will be the same as the last frame of the animation you want. e.g. My jump animation starts from a standing position, as does my slow walk animation (side on, in ready stance), and therefore, the start and end frames are the same on both animations. For this reason, it didn't cause a problem.

When I used this + 1 technique on other animations, I had weird glitches at the end of loops (because sometimes the first frame of the next animation was not right for the current animation), so I used this selectively. sometimes I used + 1 and sometimes I didn't. The problem not using + 1 causes is the last keyframe of the animation is not performed. Often you wont notice this, as its only one key frame, but sometimes it'll be obvious. The main problem however is, if all the limbs are not set to a specific keyframe before the end of the animation, it appears their rotations are "open for interpretation", so to speak. When you switch to another animation, the limbs appear to do just about anything to get to the right rotation.

The solution is actually quite simple. All animations, when setting their loop frames within db (i.e. loop object 1,startframe, endframe) make sure the end frame IS NOT + 1 on from the total object frames() after it was appended. This means you'll lose your last keyframe of your animation, but to solve this issue, just add it twice within the animation.

e.g. You have a 10 frame animation, with keyframes on frame 1,2,5,9 and 10. Simply make it an 11 frame animation, and make a keyframe on 11 identical to 10.

This will not make your animation look good in your modeller, but the animation playback in db should be faultless. Also, make sure the first and last keyframes of the animation are for every single joint. Don't leave any out.

The last animation in the set DOES NOT need the extra key frame, and infact, this'll cause the animation more problems.

Anyway, another problem with animation bites the proverbial dust after some blood, sweat and tears. Hope this helps some people get their animations pristine.

M00NSHiNE
22
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 2nd Jun 2004 21:05
Hey this sounds interesting fallout. What are you cooking up? Are we going to see a demo?

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 2nd Jun 2004 21:34
In summary, I'm cooking up a double dragon style scrolling beat 'em up (i.e. many opponnents) with the key differences being it's not side scrolling (it's full 3D, go anywhere, including jumping, climbing etc) and there are also guns, but the usual pick up anything and beat people with it applies.

At the moment it's taken me a hell of a long time to get some of the animation going, although I can make my guy run around a mock up level, jumping, running, walking, as well as falling realistically. There are ramps, tunnels and staircases, and he interacts with them all fine. Having said that, taking what I've learnt about animation, db, milkshape, and huge stabbing pains in the ass (ahem) I think I'm going to restart all animations from scratch, and do it much better. I'm not going for shoddy animation here. I've been spending about 10 minutes on each key frame, and then going back and tweaking over and over again until it looks seemless. I'm also having to simulate spline animation, cos db doesnt support it, and milkshape won't simulate it for me.

Anyway, should be funky. Beat em up, with lots of opponents, things to pick up, guns, as well as interesting ways to interact with the environment (climb up walls etc). It's based in hongkong, and my girlfriend is from hongkong, and I know a few chinese people through her. So the plan is, I might do all the speech in cantonese with english subtitles for some authenticity. Also, my gf is going to hongkong for 6 weeks in a couple of weeks time, so she's going to send me lots of imagary to get the locations right. I'm not trying to mimick hongkong - just get a feel for some of the looks of it, as well as get some photos of shop names etc. in chinese characters.

Anyway, enough divulging secrets. Last thing I'm gonna say is, this is a good game for me to make, because with the help of NG's collision DLL, this is technically very simple to make. And I like games like that. All I have to do is make lots of media, animations, music, sound, 2d art etc. and then tie them all together with some control code, animation handling routines, a bit of AI, and it's all done. Because its all about the media, I won't get bored. I'm just having fun animating models (inventing my own martial art moves! hehe), making skins, writing music, recording sound effects, drawing concept art, and getting the mrs to tell me how to say "f*ck you pig! I will exact revenge on you, for the murder of my master!" in cantonese! wehehe.

Right, I've said enough. I will post a demo/screen when the time comes. Lots of work ahead of me though.

M00NSHiNE
22
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 3rd Jun 2004 02:05
Sounds great, looking forward to it. The mrs certainly sounds like an interesting character, and im sure some chinese-styled DnB would be cool for this game. And I KNOW you can do that. Good luck with it

Login to post a reply

Server time is: 2026-07-10 16:48:48
Your offset time is: 2026-07-10 16:48:48