News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Why the pillar height is limited seven?

Started by Lus1531, December 10, 2016, 01:57:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lus1531

For some days,
I have created a very steep map from height map, for playing and demand of Japanese community.
When I was going to build bridge at deep ravine, the simutrans returned error "bridge is too high for its type!".

I changed the executable. It based 120.1.3.
Change "bridge_reader.cc" line 143, "besch->max_height = 7" to besch->max_height = 31".
Well, I can build the bridge, but the pillar is drowing only seven heights.

I reed source code, but I don't found a reason.  Why don't draw?
BattleSimutrans project(Japanese)
In japanese,"Lus" is spelled "ラス".

DrSuperGood

Quote
I reed source code, but I don't found a reason.  Why don't draw?
Looking at the code I tend to think it is a limit with the renderer as the code to make the pillars for bridges ignores that constant entirely and instead makes pillars based on the height difference between the bridge level and the natural ground under it. Unless this is something stupidly large, probably even impossible due to other limits, there is no chance an overflow or underflow has occurred.

I think it only looks a certain number of objects above a ground when deciding what to render. This is why airplanes cannot fly very high in a straight line and instead hug the terrain to some extent, often glitching in the process and sometimes failing to render entirely.

Performance and implementation reasons were cited why the limit exists, for airplanes at least. As far as I am aware there is no quick fix solution to it.

AP

#2
What we need is some kind of suspension bridge...

There are physical limits to the height of piers that modern engineers can build so its logical the game reflects this. The Millau viaduct's tallest is 244m (they taper from a 27x17m base see link p6). In general terms slenderness ratios over 8:1 get trickier but clearly they've pushed those to 14:1 with some clever design.






Dwachs

This is a limitation in the code, which is pretty difficult to overcome.
Parsley, sage, rosemary, and maggikraut.

prissi

I am rather surprise that the bridges shows up. When scrolling to the bottom edge of the screen, such a high bridge may partly vanish too.

Ters

Quote from: prissi on December 10, 2016, 09:01:03 PM
I am rather surprise that the bridges shows up. When scrolling to the bottom edge of the screen, such a high bridge may partly vanish too.

Can the fact that the bridge itself has its own "ground" have something to do with it? Or is the drawing somehow tied directly to the "ground-ground"?

DrSuperGood

Quote
Can the fact that the bridge itself has its own "ground" have something to do with it? Or is the drawing somehow tied directly to the "ground-ground"?
I am guessing its tied to the coordinates that are being viewed. It makes sense that only tiles within a certain projection of the centre of view are searched for stuff to draw.

Ters

Quote from: DrSuperGood on December 10, 2016, 11:32:01 PM
I am guessing its tied to the coordinates that are being viewed. It makes sense that only tiles within a certain projection of the centre of view are searched for stuff to draw.

But what difference is there between the tiles on the tops the mountains on either side, and the tiles of the bridge across? The only difference is that the former are "primary grounds/tiles", while the latter are "secondary grounds/tiles".

Dwachs

The bridge will be shown, if the ground under the bridge is on the screen (or at least close to the bottom border of the viewport).
Parsley, sage, rosemary, and maggikraut.

Ters

Quote from: Dwachs on December 11, 2016, 10:59:34 AM
The bridge will be shown, if the ground under the bridge is on the screen (or at least close to the bottom border of the viewport).

So it only looks at the "ground-ground", not the other "grounds" like "bridge-ground"? Which should cause the same effect for tunnels, just in the other direction.

DrSuperGood

Quote
Which should cause the same effect for tunnels, just in the other direction.
Except all tunnels are underground so invisible anyway. Sliced view/underground view must be used to see tunnels but it probably has different rules. One may notice that underground view has worse performance than surface or sliced view.

Ters

Quote from: DrSuperGood on December 11, 2016, 10:28:02 PM
underground view [...] probably has different rules. One may notice that underground view has worse performance than surface or sliced view.

That might be.