News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Thought for long term code cleanup: separate tunnels/bridges from ways...

Started by neroden, May 25, 2013, 07:07:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vladki

I have an idea, that could solve some of the questions above and backwards compatibility as well.

Most of the tunnels and brick/stone viaducts are kind of "convertible". Their speed and weight limits are high, tracks have ballast, and can be converted from railroad to road and vice versa. Such bridges and tunnels would have to specify a list of allowed waytypes (road, track, tram_track, narrowgauge), and any way of given waytypes could be built on them. The graphics would be empty - just the bridge or tunnel structure without the way. Speed and weight limits have to be checked for both way and bridge (tunnel) and the lower will apply for the whole thing. These bridges/tunnels would be built "empty", and a way would have to be built on top of them later.

Other type is non-convertible - e.g. wooden or steel bridges with track directly mounted to the structure without ballast, or tube tunnel that is too small for anything else that tube trains. These bridges and tunnels would have to specify the only way that is allowed on top of them, and the way could be built automatically. At the moment tunnels already specify a way that is displayed in underground mode, so all current tunnels could behave as non-convertible for backward compatibility.

For non-convertible (and backwards compatible) bridges I would suggest that the graphics include the tracks as they do now, and the way itself would be an invisible high-speed track. The track would have to be coded similarly to tube tunnel track, so that it cannot be built by player. For compatibility - if a bridge does not specify the way, this special one will be assumed. Top speed and weight limits would be limited by the bridge itself, not the way.

So, what do you think about this?