Chunnel V23 r27765
Moderator: OpenTTD Developers
Re: Chunnel v10 r16237
Here it is. Chunnel is r16237 and signals on tunnel r16305. It should work well, I hope.
It's built for win32.
It's built for win32.
- Attachments
-
- 16305_tunnels.zip
- (2.33 MiB) Downloaded 434 times
- Sensation Lover
- Transport Coordinator
- Posts: 338
- Joined: 26 Feb 2009 09:17
- Skype: Aron Bogdan Silviu
- Location: Torino, Italy
- Contact:
Re: Chunnel v10 r16237
thanks a lot!!!
i'll tell you how it works
have a nice weekend!!!

have a nice weekend!!!
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.
- Sensation Lover
- Transport Coordinator
- Posts: 338
- Joined: 26 Feb 2009 09:17
- Skype: Aron Bogdan Silviu
- Location: Torino, Italy
- Contact:
Re: Chunnel v10 r16237
It's not working just fine but much more!!!!!!!!! Thank you very very much! I hope this would merge to trunk soon! very good job!!!!
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.
Re: Chunnel v10 r16237
While checking a bug reported in TPPP I was able to make the game crash with a binary including only Chunnel v10 r16237. To recreate it, download "The Netherlands by Purno" scenario and try to build a chunnel near Amsterdam without lowering land for its exit, as seen in this screenshot:
I am attaching the crash.log file and the chunnel patch updated to r17097 (the same crash happens in this version). If required I can upload the crash.dmp file too.
I am attaching the crash.log file and the chunnel patch updated to r17097 (the same crash happens in this version). If required I can upload the crash.dmp file too.
- Attachments
-
- chunnel_v10_r17097.diff
- (3.95 KiB) Downloaded 286 times
-
- crash.txt
- (7.68 KiB) Downloaded 259 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Chunnel v10 r16237
Are there any patches for signals on bridges/tunnels? EDIT: Just noticed it
. These two patches would be a great combination for what I have planned in my game, and possibly a cheaper option. Tacking it on to my personal build might be the problem... Will the two patches work with r16816?
Which is cheaper, raising land by one level from the sea or building an undersea tunnel of the same length?
As for this, I'm sorry if this has already been asked, but how close is this to trunk? Do the devs like it?
Sorry for all my questions, and thanks!

Which is cheaper, raising land by one level from the sea or building an undersea tunnel of the same length?
As for this, I'm sorry if this has already been asked, but how close is this to trunk? Do the devs like it?
Sorry for all my questions, and thanks!

Re: Chunnel v10 r16237
I have updated both patches a few times: check TPPP svn revisions and grab the correct ones for the OpenTTD revision you want.
Raising land in sea is way more expensive than building a tunnel.
You can get an idea of how close to trunk inclusion is a patch reading the patch thread / flyspray task.
Raising land in sea is way more expensive than building a tunnel.
You can get an idea of how close to trunk inclusion is a patch reading the patch thread / flyspray task.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Chunnel v10 r16237
Is this true for Chunnels/Signals in tunnels and bridges?Please note that some of these patches contain changes that alter their features to allow them to work along with other patches.
The cost saving might mean I get my little project done more quickly, so it'll be very useful! Thanks for your help, I'll tell you how it goes once I get my separate problems with cargodist sorted.
Re: Chunnel v10 r16237
You should ask questions related to TPPP at its own thread (answer me there about this topic). Right now there's no altered patches at TPPP and the ones which were altered where only GUI related. Anything else is not changed at all.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v10 r16237
Ok thank everybody for bug reports.
I was able to reproduce it and during this week I will have a look at it.
Regards HackaLittleBit
P.S. Purno forgot to put the city Haarlem on that "Netherlands scenario".
I was able to reproduce it and during this week I will have a look at it.

Regards HackaLittleBit
P.S. Purno forgot to put the city Haarlem on that "Netherlands scenario".

- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v10 r16237
Ok bug fixed.
Added safety check for the map edges.
Did not test very much but it should work
See first post
P.S. Thanks Terkhen
Added safety check for the map edges.
Did not test very much but it should work

See first post
P.S. Thanks Terkhen
Re: Chunnel v11 r17206
I just tested it. The crash does not happen anymore, but the game slows down *a lot* when I try to build a chunnel in the same conditions that previously produced the crash. Is that normal?
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v11 r17206
Terkhen wrote:I just tested it. The crash does not happen anymore, but the game slows down *a lot* when I try to build a chunnel in the same conditions that previously produced the crash. Is that normal?
I am at work and can´t compile here!
Code is not really optimized.
But quick look at code a little change could make a difference
Change this code into
Code: Select all
if (IsValidTile(end_tile + delta) &&
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;
}
Code: Select all
if (end_z == 0 &&
IsValidTile(end_tile + delta) &&
IsTileType(end_tile + delta, MP_WATER) &&
!IsWaterTile(start_tile - delta)) {
if (GetWaterTileType(end_tile + delta) == WATER_TILE_CLEAR ||
GetWaterTileType(end_tile + delta) == WATER_TILE_COAST) passing_water = true;
}
If I have some time I will look if I can do some more optimalisation.

Re: Chunnel v11 r17206
The problem is less intense with these changes, but it is still there. The diff is attached here. Don't worry, optimize it when you have time 

- Attachments
-
- chunnel_optimize.diff
- (4.11 KiB) Downloaded 236 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Chunnel v11 r17206
terkhen can you have a look with this change?
thanks 
Code: Select all
if (passing_water == false) {
if (end_z == 0 &&
IsValidTile(end_tile + delta) &&
IsTileType(end_tile + delta, MP_WATER) &&
!IsWaterTile(start_tile - delta)) {
if (GetWaterTileType(end_tile + delta) == WATER_TILE_CLEAR ||
GetWaterTileType(end_tile + delta) == WATER_TILE_COAST) passing_water = true;
}
}

Re: Chunnel v11 r17206
It keeps the same with that change.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Chunnel v11 r17206
Hey hackalittlebit, I was wondering if you could shed light on the following posts:
Hey,
I added the patches 'Chunnels' and 'Signals in Bridges and Tunnels' to my running game which already had 'extra-large-maps patch' and 'cargodist'. I have been testing the new addition and have noticed something very peculiar.
Later in the game I planned on constructing a gigantic landbridge to connect two continents on the map. I did a cost estimation and I got roughly £400,000,000. I did this again after installing the new patches and this dropped to under £100,000,000. A tunnel, however, cost £600,000,000 (despite being told that underwater tunnels were cheaper than raising land).
Could someone please shed light onto this situation?
Thanks.
AND:
I recompiled (with a slightly older nightly) with just maps patch and chunnels. The landbridge costed £100,000,000 or so and the tunnel cost just under £500,000,000.
Thanks!
Hey,
I added the patches 'Chunnels' and 'Signals in Bridges and Tunnels' to my running game which already had 'extra-large-maps patch' and 'cargodist'. I have been testing the new addition and have noticed something very peculiar.
Later in the game I planned on constructing a gigantic landbridge to connect two continents on the map. I did a cost estimation and I got roughly £400,000,000. I did this again after installing the new patches and this dropped to under £100,000,000. A tunnel, however, cost £600,000,000 (despite being told that underwater tunnels were cheaper than raising land).
Could someone please shed light onto this situation?
Thanks.
AND:
I recompiled (with a slightly older nightly) with just maps patch and chunnels. The landbridge costed £100,000,000 or so and the tunnel cost just under £500,000,000.
Thanks!
Re: Chunnel v11 r17206
The cost for building tunnels don't increase lineally with distance. This means that, since tunnel cost increases faster than raising land cost (which increases lineally with distance) there's a point in which a tunnel is more expensive than raising land. The best solution for your problem will be to build smaller but still large bridges / tunnels.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Chunnel v11 r17206
Hmm... I never thought of that. Thanks!
EDIT: Do you have a formula as to the cost of tunnels?
EDIT: Do you have a formula as to the cost of tunnels?
Re: Chunnel v11 r17206
Check CmdBuildTunnel function, in tunnelbridge_cmd.cpp. I don't know if the formula is in "natural language" somewhere.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Chunnel v11 r17206
So what is the starting price for one tile? From there, I take it that this:
/** Tile shift coeficient. Will decrease for very long tunnels to avoid exponential growth of price*/
int tiles_coef = 3;
/** Number of tiles from start of tunnel */
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;
is what to work things out with.
/** Tile shift coeficient. Will decrease for very long tunnels to avoid exponential growth of price*/
int tiles_coef = 3;
/** Number of tiles from start of tunnel */
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;
is what to work things out with.
Who is online
Users browsing this forum: No registered users and 10 guests