Duke4.net Forums: Incorrect getzrange(...) calculation while standing on sprite bridges in TROR areas - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Incorrect getzrange(...) calculation while standing on sprite bridges in TROR areas  "Can lead to player not being able to jump"

#1

Download the following map: Attached File  spritefloor_tror_bug.zip (1.32K)
Number of downloads: 149

The main area in the map consists of 2 TROR layers, one having its ceiling at -26624, while the other has its ceiling at -51200.
In this area you will find 4 floating sprite platforms, the highest of which is set at -15360. Next to it is a raised floor whose height is also at -15360.
Jump up the sprite platforms to the highest one. Once you are standing on this platform you will not be able to jump anymore -- however if you move onto the raised floor right next to it, you can jump.

In an adjacent room you will find the same 4 sprite platforms in a non-TROR area. Here you can jump on top of the highest platform no problem.

The problem here is a conditional check that occurs at line 5744 of player.cpp.
 // jumping
            if (!TEST_SYNC_KEY(playerBits, SK_JUMP) && pPlayer->jumping_toggle)
                pPlayer->jumping_toggle--;
            else if (TEST_SYNC_KEY(playerBits, SK_JUMP) && pPlayer->jumping_toggle == 0)
            {
                int32_t floorZ2, ceilZ2;
                getzrange(&pPlayer->pos, pPlayer->cursectnum, &ceilZ2, &dummy, &floorZ2, &dummy, pPlayer->clipdist - GETZRANGECLIPDISTOFFSET, CLIPMASK0);

                if (klabs(floorZ2-ceilZ2) > (48<<8))
                {
                    .......
                }
           }


Here the game computes whether there is enough room in the sector to allow the player to jump. It returns false once the player is standing on the highest sprite bridge in the TROR area.
This is because getzrange(...) returns the wrong value for ceilZ if the player is standing on a sprite bridge in TROR areas -- it returns the ceiling height of the lower TROR layer, -26624, rather than the height of the highest connected TROR layer, -51200.
The function works fine however if one is standing on a regular floor.

Similarly, there are also inconsistent values being returned if one moves over the transparent TROR grate. Jumping on top of the grate returns a floor height of 12288, which is much lower than the height at which the grate is really placed.
3

User is offline   Forge 

  • Speaker of the Outhouse

#2

could that also be causing this?:

View PostLazy Dog, on 20 September 2019 - 06:56 PM, said:

Some clipping in Hazard Disposal, happens if you jump while on the surface.



Note that i am still using 1.0 so i don't know if it's been fixed already, but couldn't find anything on the changelog.

0

#3

Still broken as of r8494.

View PostForge, on 24 September 2019 - 12:15 PM, said:

could that also be causing this?:

Not sure, standing below a spritefloor doesn't seem like it's related though.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options