Jump to content
The Dark Mod Forums

Turning Animations


Ishtvan

Recommended Posts

Right now, our AI just spin without picking their feet up when they are turning to face some position. It's not really noticable when they're walking, but when they're standing still it looks pretty bad. Apparently D3 supports animations for turning left and right. I didn't know about these before, because they are only used in this ai_character script, so apparently turn animations are only present on "characters", like the npc marines, etc.

 

I don't know what it does, but am guessing it just picks up the feet a bit so that turning looks more natural. Maybe it actually turns them in the animation though, I'm not sure.

 

In any case, we should probably look at an example from one of the D3 npcs's, and make a similar turn animation for our AI (we can just do one and mirror it of course). That will make it a lot more believable when you have AI that are say standing in place, but turning around 180 every X seconds to watch behind them in a routine.

 

I think Domarius had worked on some turning animations in the past, although those were actually turning the AI to specific angles like 180 in the animation. We'll have to see how they're intended to be used by looking at D3 npc's, and then see if we can adapt Domarius' existing animation or if we have to make a new one.

 

If you're curious about the code, it's here:

 

/*
=====================
character::path_turn
=====================
*/
void character::Legs_TurnLeft() {
float delta;

allowMovement( true );
animTurn( 180 );
playAnim( ANIMCHANNEL_LEGS, "turn_left" );
while( !animDone( ANIMCHANNEL_LEGS, CHAR_BLEND_TURN_TO_IDLE ) ) {
	waitFrame();
}
animTurn( 0 );

if ( allow_turn && !AI_FORWARD ) {
	delta = getTurnDelta();
	if ( delta > CHAR_MIN_TURN ) {
		animState( ANIMCHANNEL_LEGS, "Legs_TurnLeft", CHAR_BLEND_TURN_TO_IDLE );
	}
	if ( delta < -CHAR_MIN_TURN ) {
		animState( ANIMCHANNEL_LEGS, "Legs_TurnRight", CHAR_BLEND_TURN_TO_IDLE );
	}
}

animState( ANIMCHANNEL_LEGS, "Legs_Idle", CHAR_BLEND_TURN_TO_IDLE );
}

 

It gets called in here (additionally called from some other leg states, like walking/running, if you stop and immediately turn to some other position):

void character::Legs_Idle() {
float delta;

if ( allow_turn && !AI_FORWARD ) {
	delta = getTurnDelta();
	if ( delta > CHAR_MIN_TURN ) {
		Legs_TurnLeft();
	}
	if ( delta < -CHAR_MIN_TURN ) {
		Legs_TurnRight();
	}
}

// ...

 

Maybe this is only used with path_turn nodes, I dunno. It specifically forbids it when the AI are walking forward, whcih makes sense since AI walking forward while they pivot looks natural enough that you don't need a unique walking and turning animation.

Link to comment
Share on other sites

I don't know what specification it needs, all I can do is point to the animation and let someone who knows about animation take a look :)

 

There are a few here in the base D3 directory (you'll probably have to extract them from one of the /base/pk4's)

 

anim models/characters/male_npc/cycles/idles/turn_right.mb -dest turn_right

anim models/characters/male_npc/cycles/idles/turn_left.mb -dest turn_left

anim models/characters/male_npc/cycles/idles/turn_right_rotation90.mb -dest turn_right_rotation90

anim models/characters/male_npc/cycles/idles/turn_left_rotation90.mb -dest turn_left_rotation90

anim models/characters/male_npc/cycles/idles/turn_right_rotation180.mb -dest turn_right_rotation180

anim models/characters/male_npc/cycles/idles/turn_left_rotation180.mb -dest turn_left_rotation180

Link to comment
Share on other sites

Wierd... I found the models folder in pak002.pk4, and got down as far as cycles, and that's where my folder structure stopped matching what you pasted there. All I have is

 

pak002.pk4\models\characters\male_npc\cycles\tweakedplayermoves

 

tweakedplayermoves is the only folder in cycles :(

Link to comment
Share on other sites

I'm in the same boat as Domarius.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Yeah, it looks like those files are missing. If you organize by "name" though in the zip file, you can find some turn_* md5 anims. For example turn_left.md5anim and turn_left_rotation180 in modes/md5/chars might be a good place to start. There's also a turn_left in models/md5/characters/npcs/playermoves (maybe we can see this one if we spawn a D3 marine and look thru the anims in the editor?).

 

We can ignore the models/md5/monsters/sentry ones obviously, but the others should be it.

 

@AscottK: How did the turn180 and turn_right animations differ? I would think turn180 actually turns them around, like that anim Domarius did, but who knows.

Link to comment
Share on other sites

@AscottK: How did the turn180 and turn_right animations differ? I would think turn180 actually turns them around, like that anim Domarius did, but who knows.
It's been a while since I saw them & I don't have a Doom 3 install up here so I can't answer that until I get back home.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...