Jump to content
The Dark Mod Forums

Lean Animation Requests


Ishtvan

Recommended Posts

Leaning in the SDK now sets a script variable to tell the AI it's leaning. All that remains to play the lean animation is to modify ai_player.script to check that variable and play the appropriate animations at the appropriate times. I know we have a current WIP lean animation, but now that the code is more or less done, it may have to be revised...

 

Goal:

Since we don't care about supporting third person, the main goal of the lean animation is to make the player's model follow the position of the first person viewpoint during a lean. We want to avoid situations where the player can see/shoot AI, but the AI can't see/shoot the player because the model, which is used for collisions, does not lean in the same way as the viewpoint does.

 

Strategy:

I think the first-person lean settings are one thing we'll have to tweak to perfection now instead of later, since the anim will have to be based on them. We can test both by leaning into a mirror from the side, and making sure the head tracks with our viewpoint.

 

Moving while leaned:

I suspect that we won't be able to match up the player model head and first person leaned viewpoint with an anim that only takes place on the torso channel (correct me if I'm wrong!). This means our lean animation will also have to involve the legs channel.

 

Now, we've allowed walking around while leaned. If the lean anim uses the legs channel, this means we can't play the walking anim and the lean anim at the same time. We'll need an anim for leaned walking. Don't panic though, since we don't care about third person, this anim can basically be holding the lean anim and sliding around. The only requirement for the anim is playing the footstep sounds at the proper times (same as the regular walk anims).

 

So I'm proposing that, once the stationary lean anim is finalized, we make walking/leaned animations that just hold the stationary lean pose for the same number of frames as the length of the regular walking animation. In addition, they would play footsteps at the same frames as the walking animation. Any other moving animations that are different from the normal ones for functional reasons (lantern?) would also need a leaned version.

 

Does that sound reasonable?

 

Of course if we had infinite time, we could make lean/walk animations that actually move, but there's so many permutations of movement (sneak/walk/run, standing/crouched = 6) that I doubt that's possible.

Link to comment
Share on other sites

Sorry if I misunderstand. Just wondering if it would be more efficient if the lean generated an event that is hooked to a script function, rather than the script (which probably runs slower than actual code) checking a variable every frame?

Probably. But premature optimisation is the root of all evil, as they say. :) There are many juicier targets for optimisation than a simple script loop.

 

AI are already running scripts every frame anyway. One more isn't going to make much difference.

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

In vanilla Doom3, all the player animation is done by checking script variables for movement state in a script every frame (ai_player.script). I agree that this method is a bit silly, but rather than re-invent the wheel for negligible benefit, I just added script variables for TDM movement states and modified that script.

 

I'm curious to hear from animators though if this setup would make sense, or if there's a smarter way to do it animation-wise. I don't see another way if the lean animation requires movement on the legs channel to move the model far enough over to match first person view.

Link to comment
Share on other sites

In vanilla Doom3, all the player animation is done by checking script variables for movement state in a script every frame (ai_player.script). I agree that this method is a bit silly, but rather than re-invent the wheel for negligible benefit, I just added script variables for TDM movement states and modified that script.
Ah, fair enough.

 

I'm curious to hear from animators though if this setup would make sense, or if there's a smarter way to do it animation-wise. I don't see another way if the lean animation requires movement on the legs channel to move the model far enough over to match first person view.

Well I keep thinking of what I've seen in other games. So many FPS games let the torso bend backwards and forwards when you use the mouse to look up and down, while the legs play an independant walk/run animation. It doesn't look perfectly realistic but it looks fine... and if we aren't even supporting 3rd person then we shouldn't care that it doesn't look perfectly realistic. I think it's just a toss up between quality of anim, and development time.

 

Like you said, there are so many permutations. And for what it ends up being worth, I think just letting the legs play their own channel would be fine.

Link to comment
Share on other sites

Moving while leaned:

I suspect that we won't be able to match up the player model head and first person leaned viewpoint with an anim that only takes place on the torso channel (correct me if I'm wrong!). This means our lean animation will also have to involve the legs channel.

How do we know? I'm not sure right now what would be the easiest way to try and match this up.

 

First thing that comes to mind, is getting a placeholder anim in game, then a programmer makes it work, then an animator can use an in-game mirror and experiment with different anims, leaning into view of the mirror and seeing if they see what they think they should see.

Link to comment
Share on other sites

You can sort've test it now. testmodel the player_thief model, bind a key to play the lean anim, stand right in front of the model facing it, lean to one side and hit your key to play the lean. The current lean anim uses the legs channel to step out a bit. To match it up exactly, you're right that we need a mirror and a script to play the lean anim on the player, while stationary for starters.

 

@Domarius:

You can't get that much movement by bending the model from the waist up. Remember when SZ implemented the lean by bending the player model at the waist and tracking it exactly with the camera view? It wasn't enough of a lean to be useful ingame, so we had to go farther than that with the camera. That's what makes me think we won't be able to come up with an animation that puts the model into a position matching the camera without making use of the legs channel.

 

I suppose you could do something weird like stretch the mesh of the upper torso, but it would be nice to look at least semi-believable in a mirror. A leaned player that ice skates when walking I can accept in a mirror, but a Mr. Fantastic leaned player I would have trouble with. :)

 

As for the permutations, what I'm suggesting is making an animation with the same exact frame all the way through, no motion, just so that it matches up with the length of the other walking anims. I wouldn't think that would take too much time even to create 6 of those, since you only have to take the same frame and copy it for X frames each time. In effect, the leaned + moving player becomes an ice-skating leaned player that still plays footsteps at the right times.

Link to comment
Share on other sites

I think ascottK actually did one. We just need to tweak our lean settings and then tweak the animation until it matches. Then, if the strategy I posted makes sense, someone has to go thru and make walk + lean animations that just consist of the fully leaned body position repeated over a number of frames equal to the un-leaned standing/crouching walk/sneak/run animation.

Link to comment
Share on other sites

I'm a bit hesitant to change the lean settings to match the animation. Not to be a stick in the mud, just being honest. Our goal is to have a T1/2 lean, and I put a good deal of time into getting the feeling just right and matching it as closely to T1/2 as I could. As I said in a previous thread, I feel confident that these settings are as close as we can get. From what I've seen of the current lean anim, I think it should match close enough for our purposes. :)

Link to comment
Share on other sites

Oh, I meant that we should finalize the first person settings, and then only do the lean animation once to match it, rather than having to redo the lean animation multiple times while the first person settings are tweaked over time. So I did mean tha we should make the 3rd person anim match the first person, but was trying to say we should wait on changing the anim until the 1st person lean settings are finalized and only do it once.

Link to comment
Share on other sites

Oh, I meant that we should finalize the first person settings, and then only do the lean animation once to match it, rather than having to redo the lean animation multiple times while the first person settings are tweaked over time. So I did mean tha we should make the 3rd person anim match the first person, but was trying to say we should wait on changing the anim until the 1st person lean settings are finalized and only do it once.

 

Ahhh, gotcha. :) It seemed like the other way around. I'll take a final pass of the lean settings and if they can be brought any closer. I think they're pretty much as good as they're going to get, but I'll give it another go.

Link to comment
Share on other sites

Ahhh, gotcha. :) It seemed like the other way around. I'll take a final pass of the lean settings and if they can be brought any closer. I think they're pretty much as good as they're going to get, but I'll give it another go.

I think I liked your first iteration of settings better that had 18 degrees and leaning a little farther sideways, but then maybe I just got used to leaning that far out and felt wronged when it didn't go out that far anymore. :)

 

We should probably get everyone's feedback on it before it's locked in. I'm not trying to doubt your methods, but I remember how hard it was to exactly get the movement settings from T2. Also, even if you do get a perfect copy of the movement in T2, other variations between us and T2 like map scale, AI scale, model scale, etc, will still be different and all those things effect the feel of how far the lean is going. So we may still need to do some tweaking to reproduce the "feel" in addition to reproducing the physical motion that leans thru the same points in an empty box room.

Link to comment
Share on other sites

I tried the new settings out. The only one that rubbed me a little strange was that the lean forward felt more like a slide forward. I messed around a minute or two and came up with this adjustment, but I dunno... up to you guys.

 

pm_lean_forward_stretch = "6"

pm_lean_forward_height = ".4"

pm_lean_forward_time = "400"

pm_lean_forward_angle = "5"

 

I took the settings in the other thread and just made the angle higher and the stretch shorter (dunno if it's the right distance, but it felt roughly the same), just so there's a bit more tilt to the lean and less slide.

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

    • The Black Arrow

      Hey @nbohr1morehow come the zombies in The Dark Mod don't have a "resurrection" mechanic to it, similar to how Thief has it?
      They're quite a weak creature as of right now, it's merely a walking corpse that slashes you, making attacking them to kill them an actual strategy.
      Would be better if they had some cool mechanism to it that truly makes them a danger, such as the resurrection idea itself.
      · 2 replies
    • Ansome

      Query: when was the last time a zombie in a video game was unnerving or scary to you? I'm chipping away at my anniversary submission and I've been trying to gather opinions on the subject. I'm perfectly capable of lighting them well, changing their sfx, and creating effective ambience, but I'm worried that zombies at their core are just too overdone to be an effective payoff to the tension I'm creating.
      · 4 replies
    • nbohr1more

      The Lieutenant 3 is out! Congrats Frost_Salamander! ( raising awareness )
      · 2 replies
    • OrbWeaver

      Has anyone had any luck with textures from Polyhaven? Their OpenEXR normal maps seem too washed out and give incorrect shading in the engine.
      · 5 replies
    • datiswous

      I tried to upscale the TDM logo video. First try:

      briefing_video.mp4 You can test it ingame by making a copy of the core tdm_gui.mtr and place it in your-tdm-root/materials/ , then edit line 249 of that file into the location where you placed the new briefing.mp4 file.
      What I did was I extracted all the image files, then used Upscayl to upscale the images using General photo (Real-Esrgan) upscale setting and then turn it back into a video.
      I might have to crop it a bit, the logo looks smaller on screen (or maybe it's actually better this way?). My video editor turned it into a 16:9 video, which I think overal looks better than 1:1 video of original.
      · 1 reply
×
×
  • Create New...