adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] Jumping and sliding glitches


From: Kai Sterker
Subject: Re: [Adonthell-devel] Jumping and sliding glitches
Date: Thu, 18 Aug 2011 19:10:27 +0200

2011/8/17 Michał Kaliński <address@hidden>:

> Not just a higher step. Try standing in between 3rd and 4th steps from
> then top and jump. You'll land on thin air, about the same height as
> the first step but far from it. It's possible to do from even further
> down the stairs, but harder.
>
> It's similar on the veranda. You will land at the level of veranda
> meeting the wall, the highest point you could normally reach by
> walking and pressing against the wall. At least it looked like it when
> I was logging GroundPos when attempting to wall jump.

Ah, now I understand better what the problem is. I had to look at the
code in detail to say for sure, but my suspicion is that vspeed gets
set to 0 when groundpos is reached. When all speeds are at zero, the
code in moving::update will skip the collision calculation and the
character will be stuck at the top of the object bbox. If that's the
case, walking a step to the left or right should trigger the collision
code and make the character fall to the proper position.

As for a fix ... either a more precise calculation of groundpos
(although I thought it should already work for the stairs, at least!),
or a better way to reset vspeed (independent of groundpos, perhaps).


> I changed that because when I added VSpeed == 0 check to jumping, it
> turned out that you can land on the ground while having negative
> VSpeed, preventing the character from ever jumping again. The VSpeed
> was only set to 0 when z()==GroundPos, but sometimes GroundPos could
> be a little higher then z upon landing (as noted in character::jump).
>
> Even before that, it didn't work as you say. Since in
> character::update VSpeed was only decreased as long it was positive,
> you could at most end up with -0.39(...), which wasn't even noticeable
> considering it started at 10. And since it seemed illogical to me to
> have negative VSpeed when you have 0 on ground level (you'd fall
> faster by jumping from the roof then by simply walking off the ledge),
> I thought it was a bug.

Seems like a bug, but I guess the right thing to do would be making
walking off the ledge faster :-).

I agree that when vspeed remains negative, this would break jumping.
But I guess the real issue is to properly reset it, This might help
with the getting stuck on top of an object issue above as well.

And vspeed never getting less than -0.4 also appears like a bug to me.
Although I guess it might not be a good idea to let it grow
indefinitely. Otherwise we might see some odd bouncing around after
hitting the ground :-).

Kai



reply via email to

[Prev in Thread] Current Thread [Next in Thread]