Invisible Bridge bug

Thu Oct 23, 2003 6:06 pm

I just saw this in 007LTSD E4M2: Some invisible bridges in a sector that had a floor height change were not at their correct z-position. At least the bridge at position -896,1024 was affected by this. There are probably more.


While checking this I noticed a small anomaly: Stepping up on an invisible bridge behaves differently from stepping up a normal stair. On a normal stair the view shifts upward with a constant speed. With an invisible bridge (and probably any other thing you step on) the speed with which the view shifts slowly decreases.

Re: Invisible Bridge bug

Fri Oct 24, 2003 8:40 am

Graf Zahl wrote:While checking this I noticed a small anomaly: Stepping up on an invisible bridge behaves differently from stepping up a normal stair. On a normal stair the view shifts upward with a constant speed. With an invisible bridge (and probably any other thing you step on) the speed with which the view shifts slowly decreases.

Yeah, like if you walked up a slope. Confirmed. (I have known this for long but not considered a bug. Probably the normal stair stepping should be made more soften -- lke stepping onto invis bridges -- too?)

Re: Invisible Bridge bug

Fri Oct 24, 2003 9:34 am

Graf Zahl wrote:While checking this I noticed a small anomaly: Stepping up on an invisible bridge behaves differently from stepping up a normal stair. On a normal stair the view shifts upward with a constant speed. With an invisible bridge (and probably any other thing you step on) the speed with which the view shifts slowly decreases.


I did some additional checking and found the cause for this.

Code:
            if (onmo->z + onmo->height - z <= 24*FRACUNIT)
            {
               if (player && player->mo == this)
               {
                  player->viewheight -= onmo->z + onmo->height - z;
                  player->deltaviewheight =
                     (VIEWHEIGHT - player->viewheight)>>3;
               }
               z = onmo->z + onmo->height;
            }

Unlike stepping up a stair the code above adjusts deltaviewheight every tic although it has been set previously. As a result the view movement speed gradually decreases. When I added an additional check for (deltaviewheight!=0) to the inner 'if' the problem was gone.

Fri Oct 24, 2003 11:03 am

They're all at z-height 112, and I didn't get that problem in 2.0.47 when I tried it - looks like yet another bridge bug between ZDoom versions (they seem to behave differently with every new version that comes out). Some of the bridges have radii that cut into walls and sectors at different heights, but I fixed all the bugs caused by them ages ago and none of these cause any trouble in 2.0.47 (but I'm always fixing new ones when I play with a new version).

Fri Oct 24, 2003 12:27 pm

My guess is the bridge is raised as a result of the instantly lowering sector nearby. When this happens the engine checks all things in the vincinity of the altered sector and adjusts their heights. The new code which checks for things to stand on might consider an overlapping bridge as the actual floor for this one and raise it. IMO this has to be fixed because it makes it impossible to put overlapping bridges in moving sectors.

Fri Oct 24, 2003 8:37 pm

The bridges were "standing" on each other. Fixed.