Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Aug 20, 2018 12:45 pm

All times are UTC




Post new topic  Reply to topic  [ 89 posts ]  Go to page 1 2 3 4 5 Next
Author Message
 Post subject: Chunnel V23 r27765
PostPosted: Mon Feb 09, 2009 2:44 am 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Chunnel patch.

Wat it does.
Enabeling building tunnels crossing water.

Features.
Only on tile level 0 it is possible to use.
Tunnel building tool switches automatically to chunnelmode when water encountered.
Any kind of coast tile can be used.
Tunnels over water can cross each other.

Limitations: Oil rigs can not be constructed on top of chunnel, nor can the be passed by chunnel.

Happy Tunneling.


Attachments:
Chunnel.png
Chunnel.png [ 98.23 KiB | Viewed 7910 times ]
chunnel_trunk_27765_v23.zip [28.33 KiB]
Downloaded 147 times

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Last edited by HackaLittleBit on Mon Mar 06, 2017 6:53 pm, edited 29 times in total.
Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 10:28 am 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
not bad, not bad at all! :)

Nice idea to use this corner case for undersea tunnels. It doesn't make sense to build a tunnel that ends right in front of water anyways, so I don't think anyone will miss that situation...

Oh and it was good practice to seperate undersea tunnels from the "tunnel-like-you-want"-tunnels you had in your last patch. :)
But there's still two seperate features in this patch that could be seperated - "build undersea tunnels" and "display exit in viewport when holding ctrl while building a tunnel".

Two seperate patches for two features will each have a higher chance on trunk inclusion than two features in one patch. ;)

edit: testing your patch...

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 12:47 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
So... after some testing I've got some things to mention.

Firstly, the viewport popup should really not happen on only pressing Ctrl. Ctrl+Click: okay. Only Ctrl: no-no. For example, I got extremely annoyed by it when I tried to take a screenshot using Ctrl+S, while selecting the tile I wanted some tunnel built (see screenshot below), so one can see the selection.
(and as I said before, it's better to put those two features in two different patches)

Secondly, there is some inconsistency in when you can build a tunnel under water, and when not.
Compare screenshot #1 and screenshot #2 for a situation where trying the tunnel from one end will allow the undersea tunnel, but from the other end will result in a tunnel ending at the water edge. It seems that your patch doesn't handle diagonal water edges very well...

Also see screenshot #3 for an overview where the desired undersea tunnel can be built and where not, in my setup.
The green dots are where I could build the desired tunnel, the yellow and red dots are where it did not work. The yellow dot is probably due to a slightly different problem (the water being only 1/2 tile wide there) than the red dots (diagonal water edge at the nearer side), so I colored it different.


---
Oh, and found another problem, that may be a conceptual problem:
It is possible to raise any tile in the stretch where the tunnel is going undersea, but not to lower it anymore.
This also enables you to make impossible constructions like this (screenshot #4 in next post).

... and finally, it enables you to make crossing tunnels without enabling the crossing tunnels cheat. (screenshot #5 in next post)

I am not sure how to address these last issues...


Attachments:
chunnel #1.png
chunnel #1.png [ 64.53 KiB | Viewed 28755 times ]
chunnel #2.png
chunnel #2.png [ 63.67 KiB | Viewed 28766 times ]
chunnel #3.png
chunnel #3.png [ 61.33 KiB | Viewed 28766 times ]

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 12:48 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
screenshots #4 and #5


Attachments:
chunnel #4.png
chunnel #4.png [ 57.33 KiB | Viewed 28768 times ]
chunnel #5.png
chunnel #5.png [ 64.14 KiB | Viewed 28744 times ]

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 12:55 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Thanks Roujin

Am checking your post now.
will hear of me later.

Split patch in two see above

regards.

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 1:17 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Ok the issue of Ctrl
Changed it into V + Ctrl
V is standard viewport.
when viewport open Ctrl fixes on end tile.
Made this feature to avoid loosing crazy amounts of money while building wrong tunnel.

Will come back to you regarding other issues.

HackaLittleBit.


Attachments:
viewport _V_plus_Ctrl.patch [2.37 KiB]
Downloaded 318 times

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end
Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 1:37 pm 
Online
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7091
Ctrl with other actions is used for too many "magic" functions in the game, i think it is a very bad idea to make it do something on its own.

at best, you could use Ctrl+V to open a viewport at the "target" place of the tunnel.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 1:43 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Quote:
Secondly, there is some inconsistency in when you can build a tunnel under water, and when not.
Compare screenshot #1 and screenshot #2 for a situation where trying the tunnel from one end will allow the undersea tunnel, but from the other end will result in a tunnel ending at the water edge. It seems that your patch doesn't handle diagonal water edges very well...


Check this line in the code it says it all
if (IsWaterTile(end_tile + delta) && !IsWaterTile(start_tile - delta)) passing_water = true;
so shoreline is not considered a water tile.
I could make it more flexible the code but I think that it is in a way allready futuristic and if people want to make an tunnel under water they have to prepare the shore line.


Quote:
This also enables you to make impossible constructions like this (screenshot #4 in next post).

Whats wrong there am I not allowed to make a tunnel under island?
About this raising and lowering land I'll come back to you.

Screenshot 5
Am not able to reproduce that situation.
Are you shure you switched off the tunnel_cheat?

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 2:44 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Ok about this diagonal building I fixed that.
see patch and foto

regards

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 3:12 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Here's how I did the crossing tunnels in three steps:

(screenshot taken with the old version of your patch, but just tested the new one (v3) and it still works)


Attachments:
chunnel bug #1.png
chunnel bug #1.png [ 47.63 KiB | Viewed 28565 times ]
chunnel bug #2.png
chunnel bug #2.png [ 54.27 KiB | Viewed 28567 times ]
chunnel bug #3.png
chunnel bug #3.png [ 49.69 KiB | Viewed 28548 times ]

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 3:25 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Thanks a lot Roujin

Know exactly where to look.

Code:
bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
{
   TileIndexDiff delta = TileOffsByDiagDir(dir);
   uint height;

   do {
      tile -= delta;
      if (!IsValidTile(tile)) return false;
      height = GetTileZ(tile);
      if (IsTileType(tile, MP_WATER)) height += 1;  // Underwater tunnels
   } while (z < height);

   return
      z == height &&
      IsTunnelTile(tile) &&
      GetTunnelBridgeDirection(tile) == dir;
}


while (z < height); here it is!!
need to have a good look at this procedure will take some time

regards HackaLittleBit

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 4:34 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Sun Oct 10, 2004 12:11 am
Posts: 468
Can I suggest that underwater tunnels be more expensive than normal tunnels?

_________________
Melt with the Shadows,
Embrace your destiny...


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 7:20 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
Thief^ wrote:
Can I suggest that underwater tunnels be more expensive than normal tunnels?


Not necissarily.

At least IRL, mined tunnels are the most expensive, regardless if subterraneous or underwater. OTOH, in flat waters, "floating assembly" of a tunnel is usually much cheaper than having to use sophisticated and expensive tunnel drilling machines in hard rock zones.

Nevertheless, it´d be an interesting feature to be able to set cost of tunnels differently from newgrfs.

regards
Michael

_________________
Image


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 9:19 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Latest update of patch
Solved most of the problems encountered by Roujin.
Problems remaining:

Terra forming downward not allowed over tunnel upward allowed(Is that a problem?)

Now the cost of creating the tunnel through water is cheaper than through land.
I suggest to keep these costs the same. although don't know how to do that.

Regards

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 9:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
hackalittlebit wrote:
Terra forming downward not allowed over tunnel upward allowed(Is that a problem?)

It's not understandable, that you cannot restore the previous condition, should you have accidentially made sea into land. So, I think, it's something which needs taken care of.

An evil person could use this to totally sabotage your shipping routes without you having the possibility to undo it.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 9:58 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Got it Will have a look at it

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 10:10 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
hackalittlebit wrote:
Latest update of patch[...]

nice, here's some more testing by mr. extreme-bug-finder ;)

Quote:
Solved most of the problems encountered by Roujin.

very short tunnels can still bypass the no-crossing-tunnels limitation (see screenshot)
(the long tunnel again was an undersea tunnel, then filling up some land and building the very short tunnel; finally filling up the remains of the sea 8))
Attachment:
chunnel vst.png
chunnel vst.png [ 43.64 KiB | Viewed 28126 times ]



Quote:
Terra forming downward not allowed over tunnel upward allowed(Is that a problem?)
[...]


I'd say it is, because it does not make sense: imagine there's a sea and you build a tunnel through it. You can then raise a piece of land where the tunnel is supposed to be. But then you cannot flatten it again? For what logical reason would that be?
Plus it destroys the image of a floating tunnel, that is used when building such an undersea tunnel.

The problem if you want to enable both raising and lowering is, then you have to enable lowering everywhere, that would mean tunnels being complete wormholes. No more "can't lower land here: tunnel in the way", crossing tunnels by default, heck why not introduce the arbitrary tunnels again then?
So the only way to go would be disallowing both raising and lowering. Luckily, there is also a logical explanation for it: we just say those undersea tunnels are of the "floating tunnel" kind. This of course explains why it's forbidden to raise a tile above the undersea part of the tunnel: the tunnel is floating in the water there, so it's in the way if you plan to raise the land there.
As a bonus, imo it would even give a logical explanation for the following discrepancy:

Forbidden: raise land in the middle of a sea tunnel
Attachment:
chunnel disc_1.png
chunnel disc_1.png [ 48.1 KiB | Viewed 28130 times ]


Allowed: destroying the tunnel, raising the land in the middle of the sea, building the tunnel again
Attachment:
chunnel disc_2.png
chunnel disc_2.png [ 49.31 KiB | Viewed 28127 times ]


The explanation for this would be (again using the idea of floating tunnels) that floating tunnels are used in the second picture from coast to coast, then a little peace of normal land tunnel, then again a floating sea tunnel from coast to coast. This cannot be archieved just by filling up some land when there is already a floating sea tunnel through the whole sea (image 1).


---
Uhm, are my ideas still understandable? :lol:

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 10:19 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Ok Here the reply to planetmaker
No more terra forming over undersee tunnels
Now going to have a look at your message Roujin
EDIT: Think it should not be possible anymore now.

regards

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Last edited by HackaLittleBit on Mon Feb 09, 2009 10:22 pm, edited 1 time in total.

Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 10:21 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
hackalittlebit wrote:
Ok Here the reply to planetmaker
No more terra forming over undersee tunnels
Now going to have a look at your message Roujin

regards


with that, you basically already did what I said in the second (larger!) part of my last post. nice!

so the only thing remaining is the bug with a very short tunnel being allowed where it shouldn't be.

edit: tested new version 5 and noticed two more small things
I hope you're still regarding this as valuable input, and I am not just annoying you :)

1) the error message when raising land over an undersea tunnel is a little wrong.. it's mentioning an excavation, while you're actually filling up land. I think you should just add a new string (something like "filling would damage undersea tunnel")

2) small discrepancy between two situations:

Allowed (automatically lowers one edge to build a tunnel exit there):
Attachment:
chunnel disc2_1.png
chunnel disc2_1.png [ 31.91 KiB | Viewed 28069 times ]

Disallowed (or rather, disregarded and algorithm continues search until it finds an already suitable place for tunnel exit):
Attachment:
chunnel disc2_2.png
chunnel disc2_2.png [ 38.44 KiB | Viewed 28056 times ]

_________________
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage


Last edited by Roujin on Mon Feb 09, 2009 10:38 pm, edited 1 time in total.

Top
   
 Post subject: Re: Chunnel v1 r15422
PostPosted: Mon Feb 09, 2009 10:36 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Apr 24, 2004 10:43 am
Posts: 2003
Location: Venezia - Italia
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)
Attachment:
tunnels_crossection.PNG
tunnels_crossection.PNG [ 1.78 KiB | Viewed 28082 times ]


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

_________________
ImageImage
ImageImage
ImageImage
newgrf tests, see: newgrf test topic, my patches: Wolf01's Hire Point
Italian TTD Forum
Wiki Page


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 89 posts ]  Go to page 1 2 3 4 5 Next

All times are UTC


Who is online

Users browsing this forum: Gliptal and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.