The International Simutrans Forum

 

Author Topic: [PATCH] Powerline Tunnels  (Read 34116 times)

0 Members and 1 Guest are viewing this topic.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
[PATCH] Powerline Tunnels
« 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....
« Last Edit: September 05, 2008, 11:35:19 PM by kierongreen »

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #1 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. ::)
« Last Edit: September 04, 2008, 02:58:09 AM by IgorTekton »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #2 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...

Offline wipi35

  • Devotee
  • *
  • Posts: 250
  • Imagination is more important than knowledge
  • Languages: NL,EN,GE,FR
Re: [PATCH] Powerline Tunnels
« Reply #3 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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #4 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...

Offline sojo

  • Devotees (Inactive)
  • *
  • Posts: 851
  • Maintainer pak96.comic
    • German home of Simutrans
Re: [PATCH] Powerline Tunnels
« Reply #5 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.

Offline wipi35

  • Devotee
  • *
  • Posts: 250
  • Imagination is more important than knowledge
  • Languages: NL,EN,GE,FR
Re: [PATCH] Powerline Tunnels
« Reply #6 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.  ;)

Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: [PATCH] Powerline Tunnels
« Reply #7 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.

Offline wipi35

  • Devotee
  • *
  • Posts: 250
  • Imagination is more important than knowledge
  • Languages: NL,EN,GE,FR
Re: [PATCH] Powerline Tunnels
« Reply #8 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.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: [PATCH] Powerline Tunnels
« Reply #9 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...

Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: [PATCH] Powerline Tunnels
« Reply #10 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10130
  • Languages: De,EN,JP
Re: [PATCH] Powerline Tunnels
« Reply #11 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.
« Last Edit: September 04, 2008, 02:23:08 PM by prissi »

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #12 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...

Offline isidoro

  • Devotee
  • *
  • Posts: 1137
Re: [PATCH] Powerline Tunnels
« Reply #13 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?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #14 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...).

Offline robofish

  • Devotees (Inactive)
  • *
  • Posts: 130
  • Languages: DE, EN
Re: [PATCH] Powerline Tunnels
« Reply #15 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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #16 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?

Offline Václav

  • Devotee
  • *
  • Posts: 3319
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: [PATCH] Powerline Tunnels
« Reply #17 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.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #18 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.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #19 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...

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #20 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/ingles/index.asp
« Last Edit: September 16, 2008, 12:48:28 AM by IgorTekton »

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: [PATCH] Powerline Tunnels
« Reply #21 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

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: [PATCH] Powerline Tunnels
« Reply #22 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...

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10130
  • Languages: De,EN,JP
Re: [PATCH] Powerline Tunnels
« Reply #23 on: September 19, 2008, 09:07:37 PM »
By the way, is this patch now considered ready for intergration?

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #24 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?

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: [PATCH] Powerline Tunnels
« Reply #25 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 :)

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [PATCH] Powerline Tunnels
« Reply #26 on: September 19, 2008, 09:55:00 PM »
Seconded - full set of level graphics (tunnels don't have slopes) would be great!

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #27 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 assume 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.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #28 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.

« Last Edit: September 20, 2008, 02:07:43 AM by IgorTekton »

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: [PATCH] Powerline Tunnels
« Reply #29 on: September 29, 2008, 05:08:03 PM »
I wouldn't assume that tunnels will never have slopes.....

That little teaser went almost unnoticed... or are you serious?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: [PATCH] Powerline Tunnels
« Reply #30 on: September 29, 2008, 05:11:44 PM »
That little teaser went almost unnoticed... or are you serious?
Serious. Work in progress.

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: [PATCH] Powerline Tunnels
« Reply #31 on: September 29, 2008, 05:36:47 PM »
Oh wow - now you got me drooling on my keyboard.  ;D

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: [PATCH] Powerline Tunnels
« Reply #32 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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10130
  • Languages: De,EN,JP
Re: [PATCH] Powerline Tunnels
« Reply #33 on: June 02, 2009, 09:15:42 PM »
Does by accident someone downloaded this patch with the matching graphcis?

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4101
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: [PATCH] Powerline Tunnels
« Reply #34 on: June 28, 2009, 11:31:10 PM »
BTW, the attachments are available at the 1st post, IF the patch had not been recovered.