Jump to content

Jittery animations


Recommended Posts

Sorry, you guys. Back again with another question.

 

I've completed the majority of the mapping for a singleplayer project I'm working on, and I've now gotten to the scripting part, where I've started to run into some new problems. Now, I've always been primarily focused on the mapping itself, and whatever limited experience I had with everything else, such as scripting, has been erased from my memory at this point. I've looked at a couple of tutorials to reacquaint myself with the basics, but here's where I'm stuck...

 

I'm currently working on a cinematic, that has two characters sit and talk to each other. I've gotten the cameras and all that working, but the animations are giving me problems. I figured it would be pretty dull to look at two completely motionless characters talking for upwards of a minute, so I want to add different animations to accompany their dialogue, but the problem is, that these animations are quite jittery whenever they switch from one to the next, and include some weird things in between. I've added a short video below of what I mean (but mind you, the angles, models, etc., are temporary, so it'll be a bit different in the final version):

https://youtu.be/DK2OfuUfG00

 

I guess the problem lies in the way I write my scripts, which I assume is amateurish / not the right way, so perhaps you guys can tell me how to properly do this stuff? I've been over various tutorials and such, but couldn't find anything on this particular subject. Here's what it looks like now:

 

 

//Generated by BehavEd

 
rem ( "Intro Cinematic" );
 
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "ship1-cam", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "ship1-cam", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 2000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "ship2-cam", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "ship2-cam", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
wait ( 5500.000 );
sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/vehicles/shuttle/flyby.mp3" );
wait ( 500.000 );
 
affect ( "ship1", /*@AFFECT_TYPE*/ FLUSH )
{
move ( $tag( "ship1-start", ORIGIN)$, < 0.000 0.000 0.000 >, 0.000 );
wait ( 100.000 );
move ( $tag( "ship1-end", ORIGIN)$, < 0.000 0.000 0.000 >, 7000.000 );
}
 
wait ( 6000.000 );
 
affect ( "fakeplayer", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@@weaponx_NAMES*/ "WP_NONE" );
set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT1" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 );
}
 
 
affect ( "friend1", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@@weaponx_NAMES*/ "WP_NONE" );
set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT1" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 );
}
 
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
camera ( /*@CAMERA_COMMANDS*/ SHAKE, 3.000, 4000 );
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 2000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 2000 );
camera ( /*@CAMERA_COMMANDS*/ SHAKE, 1.000, 2000 );
wait ( 2000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 2000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 2000 );
wait ( 2000.000 );
camera ( /*@CAMERA_COMMANDS*/ SHAKE, 1.000, 2000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3-1", ORIGIN)$, 2000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3-1", ANGLES)$, < 0.000 0.000 0.000 >, 2000 );
wait ( 2000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam4", ORIGIN)$, 3000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam4", ANGLES)$, < 0.000 0.000 0.000 >, 3000 );
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam5", ORIGIN)$, 3000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam5", ANGLES)$, < 0.000 0.000 0.000 >, 3000 );
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam6", ORIGIN)$, 4000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam6", ANGLES)$, < 0.000 0.000 0.000 >, 4000 );
wait ( 4000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam7", ORIGIN)$, 3000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam7", ANGLES)$, < 0.000 0.000 0.000 >, 3000 );
wait ( 4000.000 );
 
affect ( "friend1", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/f1.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK1" );
}
 
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam9", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam9", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
 
affect ( "fakeplayer", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/kr1.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "FACE_TALK2" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_UPPER", 3000 );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK2" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_UPPER", 3000 );
}
 
wait ( 6000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam8", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam8", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
 
affect ( "friend1", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/f2.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK1" );
}
 
wait ( 7000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam9", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam9", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
 
affect ( "fakeplayer", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/kr2.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK2" );
}
 
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam8", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam8", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
 
affect ( "friend1", $INSERT$ )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/f3.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "FACE_TALK3" );
}
 
wait ( 5000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam9", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam9", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
 
affect ( "fakeplayer", $INSERT$ )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/kr3.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "FACE_TALK4" );
}
 
wait ( 2000.000 );
 
affect ( "friend1", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/f4.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK1" );
}
 
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam8", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam8", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 3000.000 );
 
affect ( "fakeplayer", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/kr4.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK2" );
set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "friend1" );
wait ( 2000.000 );
set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "NULL" );
}
 
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam9", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam9", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 3000.000 );
 
affect ( "friend1", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/f5.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT7" );
set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "fakeplayer" );
}
 
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam8", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam8", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 3000.000 );
 
affect ( "fakeplayer", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/tafkat/cin1/kr5.wav" );
set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_SIT5_TALK2" );
set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "friend1" );
}
 
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam9", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam9", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam10", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam10", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 8000.000 );
remove ( "fakeplayer" );
remove ( "friend1" );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );
 

 

I've highlighted the pertinent parts (I think). Any obvious faults in what I've been doing so far?

 

And I do apologize for being so utterly helpless all the time :lol:  Hopefully, I get to repay you all soon for your help, by giving you a kick-ass singleplayer mod!  :D

Link to comment

If you look at the character animations in ModView for Kyle... you see all those FACE_TALK animations have the body in a DaVinci T-Pose...  I've never done what you are doing... but I would suggest try adding an animation to the TORSO... or figure out how to have those FACE_TALK animations affect only the face bones.  @@DT85 -- any suggestions?

Link to comment

Not sure why you're adding the face talk animations to the characters. AFAIK any sound played through a NPC or player model with CHAN_VOICE automatically applies the face animations. And yeah, given that the face animations are set with a T-pose I guess that's the problem. Try removing the FACE_TALK animations from the script, and see if it works.

Link to comment

You see, this is what I mean about me being amateurish  :P I just saw that the FACE_TALK animations had some different emotions (loud, quiet, etc.), so I thought it was worth putting in. Didn't know about the T-pose, so thank you for that  :)

 

Taking them out has definitely helped, but there are still jitters when the characters switch between different animations. But I suppose that's an unavoidable consequence of the engine being the way it is?

Link to comment

You'll get the best results by creating a custom animation for the conversation, but that's quite a bit of work and requires you to learn a bunch of things about animating first.

 

I thought about that, actually. My initial idea was to get some kind of mo-cap software, and then port the animations over, since that would be infinitely easier than actually learning how to animate, but even the new low-cost options on the market are waaaay too pricey for me to invest in, for what is essentially just a hobby. My only real choice would be to learn how to do it by hand, but honestly, I don't think the amount of time I'd have to put into it to do it properly is something I can afford either, at least not for now. I'm already tied up with mapping, texturing, scripting, voice-acting, and all that stuff, which is hard enough to do on my own, when I've got to relearn most of the basics in every department. : Maybe for the next map, I'll go for it!  :)

Link to comment

I think from memory the FACE_XXXX animations will play blended with any other animation. Here's a script from the now dead DF2 Mod that made the bartender say a line and do stuff:

//Generated by BehavEd

rem ( "Get out of my bar, you always cause trouble!" );

affect ( "bartender", /*@AFFECT_TYPE*/ FLUSH )
{

	task ( "nav_patrol1" )
	{
		set ( /*@SET_TYPES*/ "SET_NAVGOAL", "bartender_patrol1" );
	}


	task ( "nav_patrol2" )
	{
		set ( /*@SET_TYPES*/ "SET_NAVGOAL", "bartender_patrol2" );
	}

	set ( /*@SET_TYPES*/ "SET_LOOK_FOR_ENEMIES", /*@BOOL_TYPES*/ "false" );

	task ( "get_out" )
	{
		sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/bartender/get_out.mp3" );
	}

	wait ( 2000.000 );
	do ( "get_out" );
	wait ( 10000.000 );
	set ( /*@SET_TYPES*/ "SET_ANIM_LOWER", /*@ANIM_NAMES*/ "BOTH_STAND1" );
	set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_BUTTON2" );
	wait ( 500.000 );

	affect ( "beer_glass", /*@AFFECT_TYPE*/ FLUSH )
	{
		remove ( "beer_glass" );
	}

	set ( /*@SET_TYPES*/ "SET_ADDLHANDBOLT_MODEL", "models/map_objects/nar_shaddar/beerglass.glm" );
	dowait ( "nav_patrol1" );
	set ( /*@SET_TYPES*/ "SET_ANIM_LOWER", /*@ANIM_NAMES*/ "BOTH_STAND1" );
	set ( /*@SET_TYPES*/ "SET_ANIM_UPPER", /*@ANIM_NAMES*/ "BOTH_BUTTON2" );
	wait ( 250.000 );
	set ( /*@SET_TYPES*/ "SET_REMOVELHANDBOLT_MODEL", "models/map_objects/nar_shaddar/beerglass.glm" );
	wait ( 5000.000 );
	dowait ( "nav_patrol2" );
	set ( /*@SET_TYPES*/ "SET_ANGLES", < 0.000 -90.000 0.000 > );
}


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...