The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: kierongreen on September 04, 2008, 01:56:40 am

Title: [PATCH] Powerline Tunnels
Post by: kierongreen on September 04, 2008, 01:56:40 am
Note - newer patch version available - see below.

Consider this an alpha patch (i.e. not ready for incorporating into the trunk yet) - there are numerous issues!
-Deleting powerlines underground doesn't remove the tunnel they are contained in.
-Powerline images on the tunnel entrance can get added if tunnel nearby is altered (should never be shown)
-I've managed to get crashes occurring with deleting and recreating tunnels in underground mode.
-No doubt many more I haven't noticed

Code is probably horribly messy too as usual.

Also to consider - should there be a way of supplying power to factories from underground (maybe by building transformer underneath factory?).

You'll need to add an entry like this to pak/config/menuconf.tab):
#specialtools
...
toolbar[8][7]=tunnels(128)
...
(renumbering the other menu entries following)

Comments, suggestions, improvements welcome....
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on September 04, 2008, 02:55:47 am
Ah, interesting. It will be very useful for megalopolises where you want to supply energy to "in-city" factories.

It'd be interesting too if I could see a screen in underground view. 8) Sorry for my curiosity. ::)
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 04, 2008, 08:56:55 am
Ah, interesting. It will be very useful for megalopolises where you want to supply energy to "in-city" factories.
That's the idea...

It'd be interesting too if I could see a screen in underground view. 8) Sorry for my curiosity. ::)
Here's one - though it's nothing to write home about...
Title: Re: [PATCH] Powerline Tunnels
Post by: wipi35 on September 04, 2008, 09:18:10 am
I wonder if there is a place anywhere in the world where underground powerlines exist. Never heard of it.
Of course there are electric cables, underground and on the bottom of the sea, but that's a different item.
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 04, 2008, 09:26:59 am
I wonder if there is a place anywhere in the world where underground powerlines exist. Never heard of it.
Of course there are electric cables, underground and on the bottom of the sea, but that's a different item.
The current limitations of the simutrans code mean that way images below ground are the same as those above ground. Just think of them as cables despite looking like powerlines...
Title: Re: [PATCH] Powerline Tunnels
Post by: sojo on September 04, 2008, 09:36:38 am
Can wayobjects build over powerlines?

If yes. You can paint an wayobject and build it over the powerlines.
Title: Re: [PATCH] Powerline Tunnels
Post by: wipi35 on September 04, 2008, 11:22:51 am
Just think of them as cables despite looking like powerlines...

I'll remember when I'm going to use them.  ;)
Title: Re: [PATCH] Powerline Tunnels
Post by: whoami on September 04, 2008, 11:37:45 am
I wonder if there is a place anywhere in the world where underground powerlines exist.
They exist in big cities, where there is no space for them overground. For example, I saw a documentary about some in Berlin, where they reconnect the two halves of the city after its re-unification - their conductive core is made out of plastics(!), not metal.
Title: Re: [PATCH] Powerline Tunnels
Post by: wipi35 on September 04, 2008, 12:24:49 pm
They exist in big cities, where there is no space for them overground. For example, I saw a documentary about some in Berlin, where they reconnect the two halves of the city after its re-unification
I think they mentioned cables, not High Voltage lines.
their conductive core is made out of plastics(!), not metal.
Find it hard to believe,  conductive plastic exists but AFAIK the conductivity is abt 800 times lower than copper, so not applicable for high power applications.
Title: Re: [PATCH] Powerline Tunnels
Post by: Ashley on September 04, 2008, 12:48:19 pm
This is a very useful addition, since powerlines take up an entire tile supplying in-city industries is a somewhat destructive task. I'd definitely vote for having underground transformers, or being able to build a transformer above ground on top of an underground powerline.

Shame that pipelines never made it into the game, imagine the underground view filled with pipes, cables and underground railways...
Title: Re: [PATCH] Powerline Tunnels
Post by: whoami on September 04, 2008, 02:14:14 pm
Find it hard to believe, conductive plastic exists but AFAIK the conductivity is abt 800 times lower than copper, so not applicable for high power applications.
Maybe I misremember, or the journalists got something wrong.
Title: Re: [PATCH] Powerline Tunnels
Post by: prissi on September 04, 2008, 02:18:46 pm
When included, the transformer must be overground, imho. Because otherwise there would be no indication that power is supplied and letters will appear without apparent reason. YOu might built it into a slope though, to have a tunnel exit.

In reality (apart from wealthy central Europe) most high power lines are aboveground with or without house below them.
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 04, 2008, 05:50:10 pm
With regards transformers:
I've considered overground transformers - however additional logic with coding this means more headaches (namely that power networks would be linked to other networks on the same tile=more logic).
Underground transformers have the disadvantage (as pointed out by prissi) that they don't show if an industries powered or not. Additionally it might not be immediately obvious in underground view whether a tile is underneath a factory.

For the moment I'm going to concentrate on stabilising the core functionality before considering adding transformers - just thought I'd see what peoples opinion was so that if/when I add them I don't end up wasting time coding behaviour that's not wanted...


In the UK most powerlines in cities, towns and even villages are underground. You have to go out into the countryside before you see powerlines normally. Yes exceptions exist for high powerlines - but these would only directly supply large power intensive industries (e.g. steel mill, aluminium smelter) - petrol stations and chemists (naming two examples of in-town industries) are supplied underground.
That said underground powerlines will be expensive so use should be confined to when it is really necessary...
Title: Re: [PATCH] Powerline Tunnels
Post by: isidoro on September 05, 2008, 02:25:15 am
I like the idea very much.  One question, though: can these underground power lines cross underground ways at the same level?
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 05, 2008, 11:33:29 pm
Currently underground power lines can cross underground ways in the same way as on the surface (or did when I last checked) - this will most likely be disabled...

New patch version - all known issues solved (though I hadn't actually checked about ways crossing powerlines underground, there may be bugs here regarding deletion...).
Title: Re: [PATCH] Powerline Tunnels
Post by: robofish on September 06, 2008, 11:16:30 am
Currently underground power lines can cross underground ways in the same way as on the surface (or did when I last checked) - this will most likely be disabled...
Why should it be disabled? As powerlines aren't that big i think reserving an underground layer just for them is a bit unnecessary. Also it might be cunfusing for new users.
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 06, 2008, 11:52:06 am
Well surface powerlines reserve a height level (you can't build them under bridges) so why shouldn't powerline tunnels reserve a height level also?
Title: Re: [PATCH] Powerline Tunnels
Post by: Václav on September 09, 2008, 11:05:24 am
Powerlines in underground? May it be way for electrification of places what are places after water - but more useful patch could for building powerlines across any wide water areas.
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on September 09, 2008, 11:40:00 am
I wonder if there is a place anywhere in the world where underground powerlines exist. Never heard of it.

Using towers? It is impossible. But powerlines using underground ducts, yes.
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 09, 2008, 07:59:14 pm
Powerlines in underground? May it be way for electrification of places what are places after water - but more useful patch could for building powerlines across any wide water areas.
There have been powerline bridges for a while now. Though they might not be in pak128 yet - I haven't really looked...
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on September 16, 2008, 12:42:10 am
A suggestion:

I thought of a special graphic for Powerline Tunnels. More precisely, powerline ducts. It wouldn't make any sense seeing towers in underground view.

I found a tunnel for electric cables in a construction site of underground train (metro) in São Paulo City/Brazil.

(http://www.metro.sp.gov.br/expansao/amarela/fotos_obras/novembro2005/images/fotonovembro55.jpg)
(http://www.metro.sp.gov.br/expansao/amarela/fotos_obras/novembro2005/images/fotonovembro56.jpg)
(http://www.metro.sp.gov.br/expansao/amarela/fotos_obras/novembro2005/images/fotonovembro57.jpg)

http://www.metro.sp.gov.br/ingles/index.asp
Title: Re: [PATCH] Powerline Tunnels
Post by: vilvoh on September 16, 2008, 08:40:40 am
Have I heard the word graphics?? ....:D....Now, talking seriously, it seems easy to paint. Some basic forms based on cubes. You even could do it transparent, so you can show the inside, that would consist of a bunch of wires. If you want to, I could try to paint something
Title: Re: [PATCH] Powerline Tunnels
Post by: Ashley on September 19, 2008, 01:48:37 pm
I think the problem at the moment is that the game doesn't support different graphics for underground ways verses above ground ones, would be a nice change if it did however (especially for tunnels in underground mode for road/rail etc.)

You could probably do it as a way-object, but masking the pylons would be an ugly hack to achieve this effect...
Title: Re: [PATCH] Powerline Tunnels
Post by: prissi on September 19, 2008, 09:07:37 pm
By the way, is this patch now considered ready for intergration?
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on September 19, 2008, 09:28:33 pm
I think the problem at the moment is that the game doesn't support different graphics for underground ways verses above ground ones

Please, don't stone me.  :o

What about a flag Underground=1 in dat file?
Title: Re: [PATCH] Powerline Tunnels
Post by: Ashley on September 19, 2008, 09:44:29 pm
Well given that you build underground ways using the tunnel icon, it might be better to just give tunnels a full set of way graphics of their own which hopefully could include a frontimage. That way tunnel graphics could be applied appropriately. It'd be very nice graphically to be able to have a different graphic for tunnel portals underground too, as well as a way to configure whether the default underground ground tiles were shown or not, to prevent having to mask them with the underground way image.

But that's just what I dream for :)
Title: Re: [PATCH] Powerline Tunnels
Post by: VS on September 19, 2008, 09:55:00 pm
Seconded - full set of level graphics (tunnels don't have slopes) would be great!
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 19, 2008, 10:47:16 pm
Quote
Seconded - full set of level graphics (tunnels don't have slopes) would be great!
I wouldn't ****ume that tunnels will never have slopes.....

Quote
By the way, is this patch now considered ready for intergration?
The second version is stable (I haven't managed to crash it anyway). The main thing I got stuck on was the behaviour when powerlines crossed ways underground and when these were deleted. But that can be solved later.

Quote
Well given that you build underground ways using the tunnel icon, it might be better to just give tunnels a full set of way graphics of their own which hopefully could include a frontimage.
Seconded, the current system was basically a quick way of getting tunnels in without having to draw additional graphics.
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on September 20, 2008, 12:31:53 am
If there's no graphic for powerline tunnel... I found pipelines graphics.

I think some changes will make it perfect for powerline tunnel.

Title: Re: [PATCH] Powerline Tunnels
Post by: DirrrtyDirk on September 29, 2008, 05:08:03 pm
I wouldn't ****ume that tunnels will never have slopes.....

That little teaser went almost unnoticed... or are you serious?
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on September 29, 2008, 05:11:44 pm
That little teaser went almost unnoticed... or are you serious?
Serious. Work in progress.
Title: Re: [PATCH] Powerline Tunnels
Post by: DirrrtyDirk on September 29, 2008, 05:36:47 pm
Oh wow - now you got me drooling on my keyboard.  ;D
Title: Re: [PATCH] Powerline Tunnels
Post by: VS on September 29, 2008, 05:38:30 pm
Oh, wow.

I'd still like to remind everyone of the Locomotion rollercoaster-like hell with bridges, let's make sure Simutrans doesn't degenerate into that, too. Doesn't matter if it's under or overground...

On the other hand, it seems fair to let the users to decide how they want to play the game. I can remember thinking slopes "unfair" :D
Title: Re: [PATCH] Powerline Tunnels
Post by: prissi on June 02, 2009, 09:15:42 pm
Does by accident someone downloaded this patch with the matching graphcis?
Title: Re: [PATCH] Powerline Tunnels
Post by: IgorEliezer on June 28, 2009, 11:31:10 pm
BTW, the attachments are available at the 1st post, IF the patch had not been recovered.
Title: Re: [PATCH] Powerline Tunnels
Post by: The Transporter on February 22, 2010, 11:12:04 pm
What is the actual state of the patch?
Title: Re: [PATCH] Powerline Tunnels
Post by: prissi on February 23, 2010, 10:00:24 am
Needs lot of work and have some issues.
Title: Re: [PATCH] Powerline Tunnels
Post by: The Transporter on February 23, 2010, 01:47:00 pm
Ok, Thanks a lot
Title: Re: [PATCH] Powerline Tunnels
Post by: kierongreen on February 23, 2010, 09:04:41 pm
It was more or less ok to go in trunk, but that was over a year ago. I'd have said then that it could have gone in and issues would have been sorted out in time. Now I'd imagine that it'd take a fair bit of work to bring it up to latest revision.