Chunnel V23 r27765
Moderator: OpenTTD Developers
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
EDIT not relevant
Cannot recreate your small tunnel situation.
please explain in more detail.
Cannot recreate your small tunnel situation.
please explain in more detail.
Last edited by HackaLittleBit on 11 Feb 2009 10:19, edited 1 time in total.
Re: Chunnel v1 r15422
We already have crossing tunnels in trunk since long time; only thing is that it's considered a cheat option. This patch should definately not change this, if the author wants to have any chance for trunk inclusion.Wolf01 wrote:If tunnel entrances are enough distant I don't know why crossing tunnels should be forbidden, if they don't make your trains exit the tunnel from a wrong exit (try to build a tunnel 'inside' another with the same method you used, if you can) I think they might be allowed, but the entrance must be at least 2-3 tiles away from the intersection (so parallel tunnels should be forbidden)
This is what I mean (side view) IMO this might open the path to other nice junctions etc, and if we might get crossing bridges too it should be the same thing, with the top bridge longer than the bottom bridge
The point is (what I reported above and hackalittlebit already fixed) that it was possible with some dirty tricks abusing this patch for making crossing tunnels without having activated the crossing tunnels cheat.
---
If you'd like to have crossing tunnels available in multiplayer (i.e. changing it from a cheat to an advanced setting), this would be a thing for a seperate patch. Keep in mind though that it was decided to make this a cheat for a reason - it's totally unexplainable how you can have two really short tunnels crossing. So just moving it from cheats to advanced settings won't do the trick - you'd have to implement something to make sure the entrances of the tunnels are sufficiently far from each other.
Wouldn't this be a topic for a patch by you, wolf?

edit: just now read your post, hackalittlebit, answering in a minute
Re: Chunnel v1 r15422
new post to answer hackalittlebit's post:
uhm, I haven't said anything about trains crashing, or did you just test that for yourself?
here's the "small tunnel problem" in steps to create:
Step1: create this kind of terrain and build large undersea tunnel (with the newest version, you have to create that little island in the middle beforehand) Step2: create this small tunnel => the two tunnels are crossing each other.
Strangely, building the small tunnel suddenly leads to me being able to raise some land in positions where it should be prohibited by the large (undersea) tunnel! Before building the small tunnel, I was forbidden to raise there, but now it suddenly works!
uhm, I haven't said anything about trains crashing, or did you just test that for yourself?
here's the "small tunnel problem" in steps to create:
Step1: create this kind of terrain and build large undersea tunnel (with the newest version, you have to create that little island in the middle beforehand) Step2: create this small tunnel => the two tunnels are crossing each other.
Strangely, building the small tunnel suddenly leads to me being able to raise some land in positions where it should be prohibited by the large (undersea) tunnel! Before building the small tunnel, I was forbidden to raise there, but now it suddenly works!
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
Wolf the situation of a tunnel in between a tunnel is not possible (at this moment). Train would come out of wrong entrance.
You can however build a bridge in between.
You can however build a bridge in between.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
Ok was able to reproduce it
Jee your really a champ.
Going to have a look at that now
see yah
EDIT see yah TOMORROW and many thanks HackaLittleBit
Jee your really a champ.

Going to have a look at that now
see yah
EDIT see yah TOMORROW and many thanks HackaLittleBit
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
Ok Roujin did most of your requests.
Pls check for more bugs.
Regards
HackaLittleBit
Known issues: The moment the passing_water switch is on more suitable terrain is required.
Having a look at that now.
Pls check for more bugs.
Regards
HackaLittleBit
Known issues: The moment the passing_water switch is on more suitable terrain is required.
Having a look at that now.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
Ok I think I solved all pending issues.
No known issues anymore
Thanks everybody for their help and suggestions.
EDIT: Still some inconsistencies
will keep you informed
No known issues anymore
Thanks everybody for their help and suggestions.
EDIT: Still some inconsistencies

will keep you informed
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v1 r15422
Ok I think I solved all pending issues.
Please tell me if your not happy with the feature or if changes should be made
Again a special thanks to Roujin
Regards HackaLittleBit
Please tell me if your not happy with the feature or if changes should be made
Again a special thanks to Roujin
Regards HackaLittleBit
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v9 r15456 Cheating impossible
Removed the possibility to dynamite water above underwater tunnel.
regards HackaLittleBit
regards HackaLittleBit
Re: Chunnel v9 r15456
Hi hackalittlebit!
Thank you for implementing this
I have not tested the patch yet, but if it works fine I think it is a good addition to the possibilities of the game
I suppose these tunnels behave like ordinary tunnels, but how difficult will it be to give them some extra specifications? They really need to be balanced towards the bridges, and ideally, it should be possible to alter the specs via newGRF. For realism, trains entering the tunnel should go down some levels. This will make trains slow down when going up on the other side, so bridges will be better where they can be built. Maybe it can even be done graphically, so that you see that trains go down when entering a tunnel?
Thank you for implementing this

I have not tested the patch yet, but if it works fine I think it is a good addition to the possibilities of the game

I suppose these tunnels behave like ordinary tunnels, but how difficult will it be to give them some extra specifications? They really need to be balanced towards the bridges, and ideally, it should be possible to alter the specs via newGRF. For realism, trains entering the tunnel should go down some levels. This will make trains slow down when going up on the other side, so bridges will be better where they can be built. Maybe it can even be done graphically, so that you see that trains go down when entering a tunnel?
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v9 r15456
Hi Dimme;
You see I listened to your suggestions in signals in tunnels V7 r15294http://www.tt-forums.net/viewtopic.php?p=754341#p754341.
All these patches I make just for one purpose and that is to get some kind of signals - in - tunnels patch into trunk.
The reason I made this one is just to give some extra playing dimension.
I like to look at trains on single track (and bringing them back by tunnel).
At this moment I would like people to test it in order to submit this one to trunk asap.
I don't think I should make major changes at this moment to this patch.
It looks nice like this and that it fits in the overall game philosophy.
There is another reason for this patch and that is in the future being able to connect various maps together like model railroaders are doing now also.
With a tunnel it should be possible to overcome the synchronization problems( hide train, transfer train etc.)
Regards HackaLittleBit
You see I listened to your suggestions in signals in tunnels V7 r15294http://www.tt-forums.net/viewtopic.php?p=754341#p754341.
All these patches I make just for one purpose and that is to get some kind of signals - in - tunnels patch into trunk.
The reason I made this one is just to give some extra playing dimension.
I like to look at trains on single track (and bringing them back by tunnel).
At this moment I would like people to test it in order to submit this one to trunk asap.
I don't think I should make major changes at this moment to this patch.
It looks nice like this and that it fits in the overall game philosophy.
There is another reason for this patch and that is in the future being able to connect various maps together like model railroaders are doing now also.
With a tunnel it should be possible to overcome the synchronization problems( hide train, transfer train etc.)
Regards HackaLittleBit
Re: Chunnel v9 r15456
I must say I really like your patch. The tunnels fits beautifully in my southern UK game as a replacement for my severn bridges at Bristol
. Like you said, it fit's with the design philosophy of openttd it is a logical addition to the current tunnels.

Re: Chunnel v9 r15456
what i could wish for is this, and it's _something_ similar...
- Attachments
-
- hope.PNG (74.24 KiB) Viewed 9363 times
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v9 r15456
If certain combination's would be disallowed it's no big deal.what i could wish for is this, and it's _something_ similar...
- Attachments
-
- possible.png (103.06 KiB) Viewed 9329 times
Re: Chunnel v9 r15456
Sure, no problemhackalittlebit wrote:Hi Dimme;
You see I listened to your suggestions in signals in tunnels V7 r15294http://www.tt-forums.net/viewtopic.php?p=754341#p754341.
All these patches I make just for one purpose and that is to get some kind of signals - in - tunnels patch into trunk.
The reason I made this one is just to give some extra playing dimension.
I like to look at trains on single track (and bringing them back by tunnel).
At this moment I would like people to test it in order to submit this one to trunk asap.
I don't think I should make major changes at this moment to this patch.
It looks nice like this and that it fits in the overall game philosophy.
There is another reason for this patch and that is in the future being able to connect various maps together like model railroaders are doing now also.
With a tunnel it should be possible to overcome the synchronization problems( hide train, transfer train etc.)
Regards HackaLittleBit

Just trying to be constructive in order to get this patch in trunk. To show the opportunities. But you're right, it is probably best not to make it too big anyway. There are plenty of possibilities to alter the behaviour in later patches, and people can choose to play with it or not.
I'd really like to see this one in trunk

Regards Dimme.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Chunnel v9 r16135
update and build only changes was the STR_ERROR
For Community Integrated Version http://code.google.com/p/civopenttd/
- nicfer
- Director
- Posts: 529
- Joined: 03 May 2005 20:50
- Location: Somewhere in a country called Argentina
Re: Chunnel v9 r15827
Would be cool if you could build tunnels by selecting first the starting tile then the finishing one, but that could lead to unwanted situations like skipping the crossing briges restriction or similar. Similar things could be done with bridges but it would not be possible because of the graphics. At least until someone makes a modular bridges patch, aka RCT style, but then again there's the wormhole stuff again.
Sorry for my english I am argentinian
TTO don't crashes in Windows XP; XP crashes TTO
Formerly known as UnderBuilder.
MyMiniCity
TTO don't crashes in Windows XP; XP crashes TTO
Formerly known as UnderBuilder.
MyMiniCity
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Chunnel v9 r15827
V 10 is on the frist post but you need to change lines in terraform_cmd.cpp
Code: Select all
Index: src/terraform_cmd.cpp
===================================================================
--- src/terraform_cmd.cpp (revision 15829)
+++ src/terraform_cmd.cpp (working copy)
@@ -303,9 +303,10 @@
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}
/* Check if tunnel would take damage */
- if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
+ if (IsTunnelInWay(tile, z_min * TILE_HEIGHT)) {
_terraform_err_tile = tile; // highlight the tile above the tunnel
- return_cmd_error(STR_ERROR_EXCAVATION_WOULD_DAMAGE);
+ if (direction == -1) return_cmd_error(STR_ERROR_EXCAVATION_WOULD_DAMAGE);
+ if (direction == 1) return_cmd_error(STR_ERROR_MUST_DEMOLISH_TUNNEL_FIRST);
}
/* Check tiletype-specific things, and add extra-cost */
const bool curr_gen = _generating_world;
Index: src/tunnel_map.cpp
===================================================================
--- src/tunnel_map.cpp (revision 15829)
+++ src/tunnel_map.cpp (working copy)
@@ -41,18 +41,14 @@
bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
{
TileIndexDiff delta = TileOffsByDiagDir(dir);
- uint height;
-
- do {
+ for (;;) {
tile -= delta;
if (!IsValidTile(tile)) return false;
- height = GetTileZ(tile);
- } while (z < height);
-
- return
- z == height &&
- IsTunnelTile(tile) &&
- GetTunnelBridgeDirection(tile) == dir;
+ if (GetTileZ(tile) != z) continue;
+ if (!IsTunnelTile(tile)) continue;
+ if(dir == GetTunnelBridgeDirection(tile)) return true;
+ return false;
+ }
}
/**
Index: src/tunnelbridge_cmd.cpp
===================================================================
--- src/tunnelbridge_cmd.cpp (revision 15829)
+++ src/tunnelbridge_cmd.cpp (working copy)
@@ -504,7 +504,9 @@
} else {
tunnel_in_way_dir = (TileY(start_tile) < (MapMaxX() / 2)) ? DIAGDIR_SE : DIAGDIR_NW;
}
-
+ if (!_cheats.crossing_tunnels.value && IsTunnelInWayDir(start_tile, start_z, tunnel_in_way_dir)) {
+ return_cmd_error(STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY);
+ }
end_tile = start_tile;
/** Tile shift coeficient. Will decrease for very long tunnels to avoid exponential growth of price*/
@@ -513,18 +515,33 @@
int tiles = 0;
/** Number of tiles at which the cost increase coefficient per tile is halved */
int tiles_bump = 25;
+ /** Tunnel under water flag */
+ bool passing_water = false;
for (;;) {
end_tile += delta;
if (!IsValidTile(end_tile)) return_cmd_error(STR_TUNNEL_THROUGH_MAP_BORDER);
end_tileh = GetTileSlope(end_tile, &end_z);
- if (start_z == end_z) break;
+ if (start_z == end_z && IsTunnelTile(end_tile)) return_cmd_error(STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY);
+ if (end_z > start_z || end_tileh == InclinedSlope(ReverseDiagDir(direction))) passing_water = false;
+
+ if (IsTileType(end_tile + delta, MP_WATER) && !IsWaterTile(start_tile - delta) && end_z == 0) {
+ if (GetWaterTileType(end_tile + delta) == WATER_TILE_CLEAR ||
+ GetWaterTileType(end_tile + delta) == WATER_TILE_COAST) passing_water = true;
+ }
+
if (!_cheats.crossing_tunnels.value && IsTunnelInWayDir(end_tile, start_z, tunnel_in_way_dir)) {
return_cmd_error(STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY);
}
+ if (start_z == end_z && !passing_water) {
+ /* Don't allow tunnel inbetween existing tunnel */
+ if (IsTunnelInWayDir(end_tile, start_z, direction)) return_cmd_error(STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY);
+ break;
+ }
+
tiles++;
if (tiles == tiles_bump) {
tiles_coef++;
Index: src/water_cmd.cpp
===================================================================
--- src/water_cmd.cpp (revision 15829)
+++ src/water_cmd.cpp (working copy)
@@ -355,6 +355,9 @@
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP);
}
+ /* Don't allow water to be cleared above underwater tunnels */
+ if (IsTunnelInWay(tile, 0)) return_cmd_error(STR_ERROR_ANOTHER_TUNNEL_IN_THE_WAY);
+
/* Make sure no vehicle is on the tile */
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
For Community Integrated Version http://code.google.com/p/civopenttd/
- Sensation Lover
- Transport Coordinator
- Posts: 338
- Joined: 26 Feb 2009 09:17
- Skype: Aron Bogdan Silviu
- Location: Torino, Italy
- Contact:
Re: Chunnel v10 r16237
hi all,
can someone provide even a working ziped Open TTD folder with the under water tunnel and signals simulation on bridges and tunnels please for those like me who don't understand nothing of patching even if you draw an explicit scheme of how to do it. Pretty Pleeeeease!
can someone provide even a working ziped Open TTD folder with the under water tunnel and signals simulation on bridges and tunnels please for those like me who don't understand nothing of patching even if you draw an explicit scheme of how to do it. Pretty Pleeeeease!

I was in:
Austria,Belgium,Brazil,China,France,Germany,Hungary,Indonesia,Italy,Luxemburg,Malaysia,Mexico,Netherlands,Norway,Panamà,Poland,Romania,
Saudi Arabia,Singapore,Slovenia,Spain,Switzerland,Thailand,U.K.,Ukraine,U.S.A.
Austria,Belgium,Brazil,China,France,Germany,Hungary,Indonesia,Italy,Luxemburg,Malaysia,Mexico,Netherlands,Norway,Panamà,Poland,Romania,
Saudi Arabia,Singapore,Slovenia,Spain,Switzerland,Thailand,U.K.,Ukraine,U.S.A.
Who is online
Users browsing this forum: Ahrefs [Bot] and 26 guests