Jump to content
The Dark Mod Forums

Recommended Posts

Posted

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.

Posted

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

Posted

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.
Posted

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.

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
×
×
  • Create New...