opentomb / OpenTomb

An open-source Tomb Raider 1-5 engine remake
http://opentomb.github.io/
GNU Lesser General Public License v3.0
1.39k stars 145 forks source link

Wrong dive behaviour #27

Open Lwmte opened 9 years ago

Lwmte commented 9 years ago

Copied from TRF (post by Joey79100):

When Lara is floating and you want her to dive, she will start going forward (animation 118 then 116) and dive using animation 115. It's good that she can dive when swimming forward as she couldn't in the originals, but now she can't even dive when she's not moving.
In the original games, she didn't start swimming, but dived directly with animation 119. When the animation is triggered, she's rotated at 45° and the animations continue normally. <...> Actually, the animation is forced only when Lara has StateID 33 (floating but not moving). The diving animation never plays during the animation 116 (floating forward), but as soon as animation 117 (stopping animation, with StateID 33) is triggered. So Lara has to be stopped first, and only then she can dive if the Jump key is pressed.
The fact that she stops is certainly hardcoded when the Jump key is pressed though, but it doesn't force the stop animation to play. I think it simulates the releasing of the Up key, or it forces next StateID 33, so when the animation encounters a StateID change with StateID 33, she starts stopping... and as her animation will now be animation 117 which has StateID 33, she will dive at this precise moment.
Fun fact: animation 115, that makes Lara dive while floating forward, wasn't ever played in-game, but there's a StateID change in animation 116 that could trigger it. But it checks for StateID 17 (swimming underwater) instead of StateID 35 (diving)... so either it can't even work, or it works, but as the "stop" behavior has the priority (as it is on the same key), it will not be triggered as she will already be stopping.

vvs- commented 9 years ago

Also, as said here there is a missing animation in shallow water.

Joey79100 commented 9 years ago

Just thought about something recently, but not sure about it.

Left and Right keys at the same time is an illogical combination. If you press only one or the other, something happens, but as soon as the other key is pressed without releasing the first one, Lara just acts as if no key was pressed. This is an example.

And I thought that maybe it was the case when Lara is floating forwards (when she the corresponding StateID generally) with Up and Jump keys. It could be the reason why Lara has to "stop" before diving, why only animation 119 is played (stopped > dive) and never animation 115 (swimming forward > dive) even if it has the corresponding StateID change in animation 116 (swimming forward).

Lwmte commented 9 years ago

I don't think it's a bug, somebody had to notice it across TR2-TR5 development. Perhaps, it was left out purposefully, same as with crawlspace roll. All in all, it doesn't look too realistic.

I'm currently having problems with making Lara dive as in classics. She performs animation, but refuses to turn down and actually dive. I think I'll make a pull request, so someone can look into it.