Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Dec 10, 2018 9:54 am

All times are UTC




Post new topic  Reply to topic  [ 76 posts ]  Go to page Previous 1 2 3 4 Next
Author Message
 Post subject: Re: Water Tunnels
PostPosted: Tue Jan 26, 2010 2:19 pm 
Offline
Engineer
Engineer

Joined: Tue Jan 26, 2010 1:59 pm
Posts: 1
Hi,
After reading this i had to register and get something of my chest.

I drove once throu one of those channal tunnels and its an amazing mysterius experience. Going int that black hole and echoing your machine from the walls. That was a tunnel of the Rhine rone channel.
A quite big one at it too.

also here a list with other channel tunnels http://en.structurae.de/structures/ftype/index.cfm?ID=2099


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 3:13 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
How feasible are canal tunnels nowadays?

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 3:34 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7226
there is no technical reason that prevents water tunnels, but the graphics will glitch horribly, because ships are just too big.

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


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 3:40 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
Eddi wrote:
there is no technical reason that prevents water tunnels, but the graphics will glitch horribly, because ships are just too big.

With the release of FISH I wonder and it is up to players to decide which ships to send through a tunnel in the end.

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 3:50 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 22, 2005 7:31 pm
Posts: 6371
Location: Wakefield, West Yorkshire
Orko wrote:
I drove once throu one of those channal tunnels http://en.structurae.de/structures/ftype/index.cfm?ID=2099

I've been on a tour through one of the ones near me It really is a very weird, almost surreal experience being on a tunnel in a boat. Nothing but the echoes of your engine, and the pitch black around you. Would be great if this was ever put into OpenTTD, and definately a feature i'd use. The possible clipping, well i've got used to it. Sadly the devs say its impossible to fix, at least not without rewriting everything or something. But, I wouldn't put off making such a feature based upon a bit of clipping.

_________________
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 6:44 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Aug 07, 2004 11:56 am
Posts: 1867
Skype: squirejames5
Location: Stoke-on-Trent
I have thought before that canal tunnels would be handy, but as Jolt says I figured there would be issues with ship size and I also (probably wrongly) thought that since I had some up with an idea and no-one had apparently mentioned it yet, it must be impossible to do else someone far cleverer and far more talented than myself would have already done so :)

I never have any good ideas first you see :)

Would it be possible to make ship sprites go translucent like train sprites can when they enter tunnels? Would that perhaps resolve the clipping thing a little, since you wouldn't see which bits were clipping through terrain and which bits weren't?

_________________
Image


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 8:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Jul 12, 2011 12:09 pm
Posts: 1534
Location: St Ives, Cambs, UK
SquireJames wrote:
Would it be possible to make ship sprites go translucent like train sprites can when they enter tunnels? Would that perhaps resolve the clipping thing a little, since you wouldn't see which bits were clipping through terrain and which bits weren't?

I think the problem is that ship sprites are often larger than a tile, so the front starts poking 'through' the terrain behind the tunnel mouth before the rear of the ship has finished moving into the tunnel. So making the front invisible in time to avoid clipping would lead to the rear of the ship 'vanishing'.

Of course, I could be completely wrong as usual... :roll:

_________________
Temporary Permanent signature filling text. Content coming soon delayed indefinitely! Oh, and I have a screenshot thread now...
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer buiding robots.
Author of an incredibly boring stickied post about NewGRFs.


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 9:13 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Aug 07, 2004 11:56 am
Posts: 1867
Skype: squirejames5
Location: Stoke-on-Trent
Well, hence me suggesting translucent :) Like the "Fake Subway" set, or normal trains when they enter a tunnel. Sort of grey and and shadowt

_________________
Image


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 11:07 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7226
that is not at all what happens when a train enters a tunnel...

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


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Sun Jan 06, 2013 11:30 pm 
Offline
Tycoon
Tycoon

Joined: Sun Dec 16, 2007 10:24 pm
Posts: 1651
Location: Idaho, USA
Eddi wrote:
that is not at all what happens when a train enters a tunnel...

I believe there's a patch (also included in Chill's PP) that has the behavior described: http://dev.openttdcoop.org/projects/cli ... nnels.diff

_________________
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Mon Jan 07, 2013 3:02 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Aug 07, 2004 11:56 am
Posts: 1867
Skype: squirejames5
Location: Stoke-on-Trent
Ah that would be it. Thanks supercheese.

_________________
Image


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Mon Jan 07, 2013 11:52 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
Eddi wrote:
that is not at all what happens when a train enters a tunnel...

Please, spare us the details :mrgreen: .

How up to date is that diff in regards to 1.3.0?

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Tue Jan 08, 2013 4:44 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Eddi wrote:
there is no technical reason that prevents water tunnels, but the graphics will glitch horribly, because ships are just too big.


Well, since there there is a request for it and I thought I could after long time get into OpenTTD coding again, I wrote a patch. Searching yielded an old patch that did this already, but as that one is quite old I decided to rewrite it from scratch instead of trying to update it.

I made two versions of the .diff, one just uses the road sprites (gui, cursor, 48 tile sprites) for everything, the other adds new sprites, which would require a modified base graphics set with new sprites added.
I made some shoddy sprites based on the opengfx road tunnel sprites and the water tile, but I wasn't able to create a modified opengfx with these sprites added in the appropriate locations. Maybe some graphics wizard could jump in and help me out here? Attached are the sprite sheets with sources (gimp .xcf). The GUI sprites are supposed to be added at the end of SPR_OPENTTD_BASE (after the recently added delete buttons), the tile sprites got their own section after SPR_RAILTYPE_TUNNEL_BASE. See sprites.h in the newsprites-diff.


Anyway, here's a screenshot using the version which uses the road sprites. As predicted there's glitches due to the size of the ship.
Attachment:
water tunnels test 1.png
water tunnels test 1.png [ 84.32 KiB | Viewed 1082 times ]


And here's the diffs. You can use the newsprites one, but it will show a warning that sprites are missing and tunnels will look glitchy.
Attachment:
File comment: Version using road sprites.
watertunnel_v1_roadsprites_r24893.diff [15.85 KiB]
Downloaded 33 times

Attachment:
File comment: Version using new sprites (requires modified base graphics set which does not exist yet).
watertunnel_v1_newsprites_r24893.diff [18.42 KiB]
Downloaded 30 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: Water Tunnels
PostPosted: Tue Jan 08, 2013 4:49 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
... and here's the sprites. If someone could make a modified OpenGFX with these added, or even make proper ones that line up with canal tiles, would be greatly appreciated.

Everything's in the zip, added the pngs extra for viewing convenience only.


Attachments:
OpenTTD watertunnel sprites.zip [78.39 KiB]
Downloaded 29 times
watertunnel.png [33.34 KiB]
Downloaded 2 times
watertunnel_gui.png
watertunnel_gui.png [ 1.33 KiB | Viewed 1077 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: Water Tunnels
PostPosted: Tue Jan 08, 2013 5:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 22, 2005 7:31 pm
Posts: 6371
Location: Wakefield, West Yorkshire
That's pretty nice. Although, the sprite glitch isn't exactly overly annoying, really.

_________________
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Tue Jan 08, 2013 6:10 pm 
Offline
Tycoon
Tycoon

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1884
Well, this screenshot doesn't really convey the whole truth of these graphical problems...

First, the passenger ferry is pretty small, larger ships will obviously show through the ground longer/more.
Also at the point where the vehicle becomes invisible, quite a bit of the ship is still outside, so that sudden vanishing is (much more) noticeable compared to buses / train wagons. Of course that can't be seen on a screenshot. But you can imagine.. on the screenshot with the ferry I think I captured the last frame before the ship becomes invisible.

edit: I lied. The ferry goes in quite a bit more before vanishing. So the vanishing thing isn't that big of a problem, but the "showing through the ground" is worse than as seen on my previous screenshot. I will provide a new screenshot shortly.

edit2: these screenshots show the last frame shown before the ship disappears, for the passenger ferry, and the cargo ship (afaict the biggest ship in OpenGFX), respectively.


Attachments:
water tunnel glitch ferry.png
water tunnel glitch ferry.png [ 78.39 KiB | Viewed 1054 times ]
water tunnel glitch cargo ship.png
water tunnel glitch cargo ship.png [ 79.66 KiB | Viewed 1054 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: Water Tunnels
PostPosted: Tue Jan 08, 2013 7:04 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
Perhaps a stupid suggestion but will it work if you extend the water tunnel graphics to the tile immediatly behind the tunnel entrance? I.e. extend it with a flat green tile.

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Tue Jan 08, 2013 7:15 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9062
Location: Sol d
Hyronymus wrote:
Perhaps a stupid suggestion but will it work if you extend the water tunnel graphics to the tile immediatly behind the tunnel entrance? I.e. extend it with a flat green tile.


That of course will look great, if it's a rail tile, a house tile or an industry tile. Or even a water tile. ;-)

@Roujin: nice to see you back :-)

Wrt tunnels: wouldn't it make sense to implement for water tunnels straight the way we draw newgrf rail tunnels which allow separate drawing of ground, rail, portal and slope. Of course ground and rail would in this case be the water tile - but portals and slope could be a separate sprite which do not contain the water itself. And it could contain an overlay sprite (analogue to rail) which would allow to simulate shaddow on the water.

_________________
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: Water Tunnels
PostPosted: Tue Jan 08, 2013 8:02 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
planetmaker wrote:
Hyronymus wrote:
Perhaps a stupid suggestion but will it work if you extend the water tunnel graphics to the tile immediatly behind the tunnel entrance? I.e. extend it with a flat green tile.


That of course will look great, if it's a rail tile, a house tile or an industry tile. Or even a water tile. ;-)

@Roujin: nice to see you back :-)

Wrt tunnels: wouldn't it make sense to implement for water tunnels straight the way we draw newgrf rail tunnels which allow separate drawing of ground, rail, portal and slope. Of course ground and rail would in this case be the water tile - but portals and slope could be a separate sprite which do not contain the water itself. And it could contain an overlay sprite (analogue to rail) which would allow to simulate shaddow on the water.

As I wrote, perhaps a stupid suggestion (still curious whether it would solve the issue though).

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
 Post subject: Re: Water Tunnels
PostPosted: Tue Jan 08, 2013 8:31 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Hyronymus wrote:
As I wrote, perhaps a stupid suggestion (still curious whether it would solve the issue though).


It sounds like it will cause problems. It might prove easier to experiment with ways to not blit the whole ship. Eg. maybe the portal can define a clip rect for the ship? Assuming the portal is large enough that you can let the one of the two vertical borders of the clip rect go through the portal.

In the upscaled screenshot below, I've added a clip rect in pink that should be able to cut away the part of the ship that is show up after the tunnel portal. However, I haven't had a look on the NE/NW directions which might be more troublesome. But if the graphics are designed such that a clip rect can be placed either with a vertical or horizontal border cutting through portal, that trick may solve this issue.

The issue with ships disappearing before they have fully entered the tunnel is however not solved by adding a clip rect.


Attachments:
ship-tunnel-clip-rect.png
ship-tunnel-clip-rect.png [ 49.07 KiB | Viewed 1012 times ]

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 76 posts ]  Go to page Previous 1 2 3 4 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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.