News:

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

Make it possible for tunnels to be built fully underground (no portals)

Started by Nazalassa, August 20, 2025, 04:26:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

As of simutrans 124.3.1, when one wants to build an underground tunnel one must begin by building a tunnel portal somewhere: this is because tunnels must start on slopes or already-existing tunnels. In some cases however, this can be annoying if the infrastructure is intended to be fully underground (e.g pneumatic tubes or subway line).
This patch allows some tunnels to be built without needing to start from an existing tunnel tile. To benefit from this, a tunnel must specify it in its dat-file with the new Allow_empty_start=1 parameter. Tunnels that don't specify it do not change their behaviour and require a tunnel tile or a slope to be built (as usual).

If I was unclear: say we have a tile A, a tile B and a tile C underground, the tile A is on a tunnel and the tiles B and C are empty. It is currently possible to build a tunnel from A to B (or C), but not from B to C (as both are empty). The patch allows tunnels to specify whether, in that situation, the game should allow to build them from B to C or not.

underground-tiles.gif

As a "bonus", the patch removes the tunnel tool's tooltip when not above a valid tile. (Previously it was not removed when the cursor e.g went over the black tiles of sliced underground view).

The patch may be a bit overkill as it adds one new dat-file parameter for tunnels, and thus bumps the tunnel pak's version number.
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.

prissi

I don't think this should require a new tunnel type.

But this looks like it would also allow building tunnels in the air (at least from a script or through a two-tile straight cliff). I have to check it when I am back in Japan this weekend.

Nazalassa

Quote from: prissi on August 21, 2025, 06:58:09 AMI don't think this should require a new tunnel type.

But this looks like it would also allow building tunnels in the air (at least from a script or through a two-tile straight cliff). I have to check it when I am back in Japan this weekend.

Note, this does not add a new tunnel type, it only adds a new parameter for tunnel descs that say whether they need a start tile or not.

I have not fully tested it and I already found a problematic situation, so I will try to test it more in the next few days and fix those bugs.
Making paksets since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.