minetest / minetest_game

Minetest Game - A lightweight and well-maintained base for modding [https://github.com/minetest/minetest/]
http://minetest.net/
Other
1.42k stars 572 forks source link

Add sneak animations #2294

Closed ClobberXD closed 4 years ago

ClobberXD commented 5 years ago

I was working on adding sneak animations for CTF (see MT-CTF/capturetheflag#318), and thought it'd be useful for MTG as well. Please do let me know if this is a good idea, and what the actual animations should be. Just bending the torso forward looks very awkward, as the legs would still be upright. Legs bent at the knees with a forward-leaning torso, would be very realistic and ideal, IMO, but isn't directly possible as there is only one bone for the whole leg. Should the collision/selection box be altered as well?

paramat commented 5 years ago

No knees! The player intentionally doesn't have knees so adding them makes no sense =) Current sneak just being a slow normal movement doesn't look good so a dedicated sneak animation could be good. Not sure what the animation could be yet, let's do it when we have a good idea.

Currently the sneak animation swings the limbs to the same degree, which is too much swing, a possibility is a walk animation with less swing.

benrob0329 commented 5 years ago

I think that the "MC Style" sneak animation looks fine with the limited articulation that our current model has.

Desour commented 5 years ago

Not all people think that knees are ugly or bad.

LoneWolfHT commented 5 years ago

Knees are fine if you do them right

An0n3m0us commented 5 years ago

Sneak animation (I made this quickly so it still needs to be tweaked a little): sneak

Uses 40 frames (frames 221 - 261). Also, this is using the sneak state but without using animation_speed/2.

Desour commented 5 years ago

Tbh, that looks like Sam is going to vomit to the left.

An0n3m0us commented 5 years ago

I did say it needed improvement. Maybe his head needs to be a bit more higher.

LoneWolfHT commented 5 years ago

Needs the chin lifted a little. Might look good with the arms out to the side a little too. Kind of like the Skyrim crouching if you've ever played that game

An0n3m0us commented 5 years ago
GIF (click to uncollapse)

![walk](https://user-images.githubusercontent.com/49789044/59210134-c1925180-8ba4-11e9-91a5-4cef4474ff80.gif)

Don't worry about that sharp movement at the end; the loop didn't complete there. (As you can see in this gif his head bobbing too much, but I've fixed that in the model now)

LoneWolfHT commented 5 years ago

In the gif it just looks like they're slouching badly. I think something needs to be done with the arms/legs to make them look a little more involved in their sneaking

An0n3m0us commented 5 years ago

There. I made the bobbing less prominent: https://my.pcloud.com/publink/show?code=XZ4imN7ZHL1LmknPVejLkGcF2Dl7pzdkbh8k

paramat commented 5 years ago

I think head tilted downwards as before looks better, as sneaking is usually done when carefully creeping along edges where you would be looking downwards a little. Anyway, potentially good work.

ghost commented 5 years ago

I like the animation and the idea! Will be cool when it will be added to mtg!

benrob0329 commented 5 years ago

Maybe move the arms out a little while sneaking, almost like you do when slinking along a wall or keeping one's balance (but not quite as much as either of those examples).

ClobberXD commented 5 years ago

Regarding what paramat suggested, I think the head should be tilted down very slightly, and should still be facing forward.

Desour commented 5 years ago

May I suggest not doing such a minecrafty sneak animation but more something like this: sneak.m4v.zip (download, dezip, then watch)

An0n3m0us commented 5 years ago

Looks good, but I think the body rotation is a little too much!

An0n3m0us commented 5 years ago

I changed the sneak animation a little:

GIFs (click to uncollapse) ![output](https://user-images.githubusercontent.com/49789044/63368139-33410580-c375-11e9-80c7-e5a9ba11f78a.gif) ![output2](https://user-images.githubusercontent.com/49789044/63368151-39cf7d00-c375-11e9-8915-c7330bdb3aaa.gif)
ClobberXD commented 5 years ago

Nice! I like how the arms are pointing outwards a little.

I prefer the first one more than the second - the second one swings the arms a tad too much.

An0n3m0us commented 5 years ago

Haha they are the same animation! Just different views. And Blender doesn't loop the animation perfectly, so it kinda stutters as it loops.

EDIT: Actually, you were kinda right. The forward swing of both of the arms went further than the backward swing. I've fixed that.

An0n3m0us commented 4 years ago

Here's the latest; the arm movement is a little weird still but I'm working on it. https://my.pcloud.com/publink/show?code=XZbQgBkZdkxGPiGeWn5QGrAjC0oATjOlhBuX

Also, can someone add the "Engine change needed" tag? We might need to edit the engine to change the sneak animation; I cannot find a way to implement it using the player API.

An0n3m0us commented 4 years ago

@DS-Minetest How did you manage to play the sneak animation? I've battled with the player api for around 2 hours now but with little success.

I can get the animation to play when the player isn't walking but holding control, but I cannot get it to work otherwise unless I remove the "local_animation" table in init.lua.

LoneWolfHT commented 4 years ago

https://github.com/minetest/minetest/issues/8335

An0n3m0us commented 4 years ago

So it isn't possible (without engine change)?

Desour commented 4 years ago

@DS-Minetest How did you manage to play the sneak animation? I've battled with the player api for around 2 hours now but with little success.

I've just set the client-side walk animation (in set_local_animation) to nil and added a player_set_animation call for server-side animation. :/

paramat commented 4 years ago

Closing due to #2710