Ladder Progress
Climbing upstairs works now. Might require some adaptions once downstairs climbing is possible.
I tested only in the swamp/-camp. I guess in the Mines there could be some problems sometimes thanks to the steep edges.
https://github.com/Try/OpenGothic/issues/120
Hi, @thokkat and thanks for PR!
I have had a quick look at the code, one thing that is suspicious:
- void Interactive::nextState(Npc& npc)
Why this function is no longer needed? What about other interactive objects?
PS: will look more closely at the end of the week
It was only used in the processLadder function.
Testing right now(Jarkentar only): can't climb down - ladder is not interactive. Can be unrelated issue when holding UpKey, upon climbing, there is a point when key-repeat stops working, at begin at climb
Yes non-interactive ladder upstairs was already the case. After some tries there's sometimes an interactive object found but not at the correct place, The climbing animation is played but the character doesn't move.
When you climb up, reach the end of the ladder and press the action key after the climbing animation ends, you are now again attached to the ladder but a bit shifted. For most ladders i tested that point looks like the vanilla endpoint after climbing is finished, but could also be coincidental.
I tried the original nextState like this
const int prev = state;
reverseState=reverse;
if(!setAnim(&npc,Anim::In))
return;
if (reverse)
setState(std::max(0,state-1));
else
setState(std::min(stateNum,state+1));
loopState = (prev==state);
but it shows micro stuttering because the animation for the next state is only started after a key press triggers it. Stuttering was also happening before but less noticeable. Also removed the marvin stuff. Like you said it's artificial. Got a bit tricked by memory but vanilla shows it's a smooth process.
Hi, @thokkat !
Sorry, for late response, bit to much code review in flight :)
for debugging, you can use F9/F10, to have frame-by-frame debugging:
F9 - pause
F10 - next frame
Setting MAX_FPS to low values in gothic.ini file can also be useful.
@Try, everything works so far, i think you can review. Vanilla G2 crashes for me when entering Jharkendar so i don't know if G2 behavior is replicated correctly.
Still to do but i don't know how:
- Stuttering issue. At the end of an animation the character is lifted for like 2 frames and then moved back. This results in mini stuttering, less noticeable if fps are high and causes a bit of camera shaking sometimes after climbing upstairs is finished.
- AI
Some footage so you know what i mean with tilted ladders.
https://user-images.githubusercontent.com/100468436/196058888-7322be56-b4a3-44c4-9f90-22f1c0900549.mp4
https://user-images.githubusercontent.com/100468436/196058889-ef350bce-50c7-4850-b7e7-9f0c1d4cfbc1.mp4
https://user-images.githubusercontent.com/100468436/196058957-8b7a87f7-e868-42f1-a1c2-f9fff06d2cd2.mp4
I made the aforementioned changes. Tell me if there*s more to do.
@Try, reminder for review, now that phoenix has been merged ;) . G2 works as expected. In G1 there's now a general bug so animations aren't played.
@Try, I cleaned up the abs stuff. Vec3(c,0,s) moves the character leftwards and i only found it in camera.cpp. Vec3(s,0,-c) is copied from marvinF8/K routines,
Merged, thanks!