Sign in to follow this  
OBW

Walking faster on bridge (going up) than flat road [Fixed]

Recommended Posts

So I walked up my new bridge and expected to go slower than I did, but instead I started walking faster.
I consider this a bug, some may not agree with me.

 

Here is a image of the speed walking on a bridge (1x4, 78 slope up):
http://imgur.com/NUoDcUE

And here is a image of the speed walking on flat cobblestone road:

http://imgur.com/zc4uO8F

Share this post


Link to post
Share on other sites

That's already listed in the bridge bug issues as it was found during the test server testing.  Thanks for your additional report which I'll include with the bug.


Share this post


Link to post
Share on other sites

D'oh! Sorry, didn't know it was already reported. Thanks.


 


Nice to know my bridge doubles as a skateboard launch ramp though.


 


EDIT: Posted in wrong thread. Oops. Oh well, they're cross-referenced anyway. :P


Edited by Ostentatio

Share this post


Link to post
Share on other sites

Everything has already been said - but not by everyone. So I add my account here too: yes I can confirm that not only walking but also driving a cart uphill on a bridge goes faster than down or on flat ground.


Share this post


Link to post
Share on other sites

Pretty sure this is just caused by the combination of bridges always being treated as flat ground, and because it treats bridges as either planks, cobble, or slabs depending on the type, all of which give you max speed.

 

If you're going 20km/h horizontally forward, then go onto a bridge where the slope will not affect your speed, you will continue traveling forward horizontally at 20km/h, but also have vertical movement because the bridge is sloped, resulting in the speed you go in whichever angle the bridge takes you to be greater than what it would normally be horizontally.

 

Example:

7TNrOUw.png

 

According to OP's specific example, he was going 11.4 km/h horizontally, and 12.7 km/h diagonally on the bridge.  This would mean that the vertical component of his movement must've been about 5.6 km/h.  The horizontal as compared to the vertical is 11.4/5.6 = 2.03, and he's bounded by the road of the bridge, so the bridge is roughly twice as long as it is tall. He stated that the bridge was 78 slope tall and 4 tiles long.  According to the wiki, 40 slope is 4m, and each tile is 4m.  This means that the bridge was 16m long and 7.8m tall, yielding a ratio of 16/7.8 = 2.05, roughly equivalent to what we found earlier, and confirming that this is the reason for his increased speed. 

 

In the code:

    protected byte getTextureForTile(final int xTile, final int yTile, final int layer, final long bridgeId) {
        if (bridgeId > 0L && this.world.getServerConnection().getServerConnectionListener() != null) {
            final BridgeData hd = (BridgeData) this.world.getServerConnection().getServerConnectionListener().getStructures().get(bridgeId);
            if (hd != null) {
                for (final BridgePartData bpd : hd.getBridgeParts().values()) {
                    if (bpd.getTileX() == xTile && bpd.getTileY() == yTile) {
                        if (bpd.getMaterial() == BridgeConstants.BridgeMaterial.WOOD || bpd.getMaterial() == BridgeConstants.BridgeMaterial.ROPE) {
                            return Tiles.Tile.TILE_PLANKS.id;
                        }
                        if (bpd.getMaterial() == BridgeConstants.BridgeMaterial.BRICK) {
                            return Tiles.Tile.TILE_COBBLESTONE.id;
                        }
                        return Tiles.Tile.TILE_STONE_SLABS.id;
                    }
                }
            }
        }
        if (layer == 0) {
            return this.world.getNearTerrainBuffer().getRawType(xTile, yTile);
        }
        return this.world.getCaveBuffer().getRawType(xTile, yTile);
    }
    
    public float getTileSteepness(final int tilex, final int tiley, final int clayer) {
        if (this.getBridgeId() > 0L) {
            return 0.0f;
        }

All you gotta do is actually calculate slope for the bridge instead of just returning 0 for flat and this would be corrected.  Probably need to change this in server/common too or you might end up desynced with the server depending on how it handles movement.

Edited by Alexgopen
  • Like 2

Share this post


Link to post
Share on other sites

Nothing new old bug from day 1    i told about it 10 times when all was on test server

Share this post


Link to post
Share on other sites

This has been working on the test server for a few days now so I imagine we'll see a fix soon.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this