News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Half height bridge bug

Started by Vladki, March 15, 2015, 10:37:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

Hi, I'm trying devel-new branch and noticed that half-height bridges can be built over ways. Vehicles pass under  without problems, but the way on top of the bridge cannot be upgraded.
Savegame here: https://uran.webstep.net/~vladki/simutrans/test-bug.sve

jamespetts

#1
Thank you for the report: I should be grateful, however, if you could post bug reports in a new topic, one for each bug. I ask because I use the forum as a sort of bug tracker, so it is important to have this degree of separation. I have split this post into its own thread for this purpose.

Edit: I have managed to reproduce this. Can any of the Standard developers remind me where the part of the code is that checks whether a bridge is half height or full height so that I can track this down more easily?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

The only code is to check the z coordinate and check whether the pak enforce double height bridges over ways or not.

jamespetts

Thank you for the reply: that is most helpful. Is that in simtool.cc or bridgebuilder.cc?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

Neither. You just compare max_h for a tile (shoud be in simworld.cc) with the curent pos.z of the bridge. This is the current height of the bridge. And example is in the bridge builder too.

if you ignore slopes:
bridge->get_pos().z-welt->lookup_kartenboden(bridge->get_pos().get_2d())->get_pos().z>=welt->get_settings().get_get_way_height_clearance()

jamespetts

Splendid, thank you. I will look into this when I get a moment. That is most helpful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Looking into this, this is not actually a bug: Pak128.Britain-Ex had simply not defined way_height_clearance = 2. I have now amended that so that it does define way_height_clearance = 2, so it should no longer be possible to build single height bridges over ways.

Thank you for your report!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

wlindley

With the latest (as of 2015-08-09) source and pak128.Britain-experimental, I cannot figure how to actually make a rail or road bridge anymore.  The built-in city generator does, but it's not clear what combination of single- or double-height slopes and ways would be required to get a bridge built.  Help?

jamespetts

Building bridges is a little different to how it used to be, as you no longer need to (or, indeed, can) build a bridge starting from a way on a slope tile. Instead, a bridge should be dragged accross from the nearest non-slope tile on one side to the nearest non-slope tile on the other side.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

wlindley

Aha! That works, although it requires rather different construction planning. Thanks!