supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Revert or greatly improve rotating Tux on slopes

Open Rusty-Box opened this issue 1 year ago • 4 comments

This additions should have never been merged in the state it was in. I recommend reverting entirely if a fix is not considered in a timely manner unless someone is willing to highly improve it ASAP!

Some major issues I have spotted:

  • It worsens the slide jump animation by adding a rotation to it for no reason
  • The rotating is awkward and clunky with no smooth transition, whatsoever

Rusty-Box avatar Feb 16 '24 20:02 Rusty-Box

This was merged? I didnt notice lol.

Just checked it out and the sliding itself looks really cool, however the slide jumping looks really jank. The rotation should only be in the slide animation, not the slide jump.

tylerandari13 avatar Feb 16 '24 20:02 tylerandari13

This was merged? I didnt notice lol.

I was just as baffled by this as you. It wasn't even open for like a day iirc.

Just checked it out and the sliding itself looks really cool, however the slide jumping looks really jank. The rotation should only be in the slide animation, not the slide jump.

Yes absolutely! If done right this can work but as mentioned there is a flaw that should haven been tested before. Code is not all one has to check.

Rusty-Box avatar Feb 16 '24 20:02 Rusty-Box

I am really sorry that my changes seem to made you upset. As a first step I only added the rotation on the slope and figured out that the slope jump looked (at least in my opinion) very unrealistic due to the direction change caused by gravity. That is why I added the the rotation according to the direction of velocity and it felt - at least for me - way more natural. So please revert my changes. Sorry for the inconvenience.

Brockengespenst avatar Feb 17 '24 07:02 Brockengespenst

I am really sorry that my changes seem to made you upset.

Oh no, sorry if I came off as rude to you. This was not your fault, rather a mistake on the team’s end for not properly testing and prematurely merging a PR. The idea of the rotating sprite is fine but could have used more time to test and polish before getting merged.

Rusty-Box avatar Feb 17 '24 11:02 Rusty-Box

@Brockengespenst Do you want to work on this?

MatusGuy avatar Feb 19 '24 19:02 MatusGuy

Well, looks like the worst PR ever needs some tweaking, so let's get it done.

Regarding the rotating, I will try to add a smooth transition, hopefully a bit related Tux' sliding velocity. I will need to play around a bit with that.

According to slide jump: I guess I will remove the rotation as a first step. Advantage of rotating while slide jump is that if you hit water, Tux will remain in the same rotation when swimming. So when not rotating during slide jump, the transition when touching water needs to be smoothened as well.

Brockengespenst avatar Feb 19 '24 21:02 Brockengespenst

@Brockengespenst Wouldn’t it be possible to just disable rotation specifically for when Tux plays the slide jump animation (i.e. the one where he front flips)?

Rusty-Box avatar Feb 19 '24 22:02 Rusty-Box

You mean while Tux is in the air? Yes, I will disable it for now, leaving the rotation as it was on the last slope Tux was sliding on. Then you could check how it looks like.

Brockengespenst avatar Feb 20 '24 18:02 Brockengespenst

You mean while Tux is in the air?

I am talking about this animation:

slide_jump

Rusty-Box avatar Feb 20 '24 19:02 Rusty-Box

Shame on me, I did not even know that this was possible. Anyway, there is no problem in deactivating the rotation while this animation plays, but this does not have a dramatic effect right now. I guess the main problem is when the jump key is released and the rotating angle is a bit awkward, that might lead to some strange rotations. I will check how to get a better solution for this.

Brockengespenst avatar Feb 20 '24 23:02 Brockengespenst

The most simple solution seemed to be to continue the slidejump action when releasing the jump button. It seems this was not handled properly in the past, but should do now. With that change, there should be no problem with rotating Tux (sprite will not be rotated when slidejump animation is played). If jump is not pressed when approaching a slide from which Tux can jump off, Tux still rotates according to direction of velocity (just like in water) - I hope this is Ok, otherwise I can retain the last rotation from the slope, Tux was sliding on.

The rotation smoothing mechanism is not highly sophisticated. I was thinking about several possibilities, but ended up (again) with a primitive solution, that looks quite Ok. If anyone has better ideas, I would be grateful if they were shared.

There is actually one glitch sometimes when Tux slows down sliding due to fraction. For a very short time, the duck action is displayed before the crawl action is set. I will check how this can be improved.

Please feel free to test and leave comments to the PR.

Brockengespenst avatar Feb 21 '24 22:02 Brockengespenst