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....
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. ::)
Quote from: IgorTekton 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.
That's the idea...
Quote from: IgorTekton on September 04, 2008, 02:55:47 AMIt'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...
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.
Quote from: 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.
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...
Can wayobjects build over powerlines?
If yes. You can paint an wayobject and build it over the powerlines.
Quote from: kierongreen on September 04, 2008, 09:26:59 AM
Just think of them as cables despite looking like powerlines...
I'll remember when I'm going to use them. ;)
Quote from: wipi35 on September 04, 2008, 09:18:10 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.
Quote from: whoami on September 04, 2008, 11:37:45 AM
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.
Quote from: whoami on September 04, 2008, 11:37:45 AM
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.
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...
Quote from: wipi35 on September 04, 2008, 12:24:49 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.
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.
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...
I like the idea very much. One question, though: can these underground power lines cross underground ways at the same level?
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...).
Quote from: 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...
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.
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?
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.
Quote from: 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.
Using towers? It is impossible. But powerlines using underground ducts, yes.
Quote from: VaclavMacurek 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.
There have been powerline bridges for a while now. Though they might not be in pak128 yet - I haven't really looked...
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
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
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...
By the way, is this patch now considered ready for intergration?
Quote from: Timothy 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
Please, don't stone me. :o
What about a flag
Underground=1 in dat file?
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 :)
Seconded - full set of level graphics (tunnels don't have slopes) would be great!
QuoteSeconded - full set of level graphics (tunnels don't have slopes) would be great!
I wouldn't assume that tunnels will never have slopes.....
QuoteBy 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.
QuoteWell 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.
If there's no graphic for powerline tunnel... I found pipelines graphics.
I think some changes will make it perfect for powerline tunnel.
Quote from: kierongreen on September 19, 2008, 10:47:16 PM
I wouldn't assume that tunnels will never have slopes.....
That little teaser went almost unnoticed... or are you serious?
Quote from: DirrrtyDirk on September 29, 2008, 05:08:03 PM
That little teaser went almost unnoticed... or are you serious?
Serious. Work in progress.
Oh wow - now you got me drooling on my keyboard. ;D
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
Does by accident someone downloaded this patch with the matching graphcis?
BTW, the attachments are available at the 1st post, IF the patch had not been recovered.
What is the actual state of the patch?
Needs lot of work and have some issues.
Ok, Thanks a lot
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.
Is the work on this patch canceled?
It was never seen fit to include it despite it being stable. I will look at this and try to get it compiling again with latest trunk. My has changed since this was first made, namely underground slopes are completely functional now.
Issues regarding transformers were never resolved - to my mind at least initially this can wait and worked around.
kierongreen
the Simutransgame be need powerline Tunnels.
And undergrundtransformer need we too.
It´s not be cheap too install a powerline on a in a city laying factory.
Vilvoh
thank you that you want paint new grafics.
Actually, the reason this was not included was not as much the code but rather the issue of underground transformers. But this was one of there first oatches every published, so it might be very very broken by now.
It will be hugely out of date, hence I'll look at it again.
Now we have a sliced underground view it should be possible to place objects at a particular 3d point. In which case would requiring a transformer to be the layer directly underneath a factory be good? Then question is how to easily show factory is powered (or do you rely on factory information screen for this?
Thoughts...
Quote from: kierongreen on February 23, 2012, 12:02:58 AM
It will be hugely out of date, hence I'll look at it again.
Now we have a sliced underground view it should be possible to place objects at a particular 3d point. In which case would requiring a transformer to be the layer directly underneath a factory be good? Then question is how to easily show factory is powered (or do you rely on factory information screen for this?
Thoughts...
sounds good - its would be easy to check that power is connected by checking a factory is on or off - a small symbol would be good idea
Some time ago, I updated the patch and try to enhance it. I have to see, whether I can find it somewhere. The reason why I did no further work was that crossings of powerlines and ways underground would require a lot of code duplication.
Edit: Seems that I lost it :(
They shouldn't be supposed to cross underground, except on different levels (then no crossing anyway).
Or I didn't get what's the issue?
Powerline tunnels = underground cables. Why should they not be allowed to cross ways by eg going underneath?
Because "under them" means in the lower level, IMHO.
1) the way is already at the bottom of the file, going under means therefore going to the lower level.
2) cables for medium and high tension (15 kV or more), for industrial usage as we simulate in the game, are much better insulated than lower tension ones (110-220-380 V). Whereas the latter can share a tunnel with roads and tracks (but are not simulated here), the former are usually laid in service tunnels or in bare earth, and if they cross a road tunnel they need to be moved above or below it.
3) power lines don't suffer performance losses going up or down a slope, so keeping them on separated levels would simplify the code with no negative impact.
4) I can't imagine the graphics for underground cables crossing a road or a railway ;)
Underground transformers can be entirely omitted. Just build a normal one on surface, and bring the cable below it... No? :)
(I mean... whether transformers can be underground or not can become a separate question from cables.)
Seeing this topic it reminds me I have plan to paint cable set for transportation of electricity - but at first I need any idea what face to give it.
And of course, I don't think that underground transforming stations are needed. All what is needed is special transforming station for cables (really? it would be better but ... current ones may be used), own cables (only with basic tiles - like high wires have) and tunnel entrances.
This sounds good. Underground transformer oder underground connectingstations are realy helpfull in cities.
Progress report:
Underground power lines are now working (again) and slopes are also supported. Still to resolve issues regarding maintenance and costs on build/demolition, disabling underground way/powerline crossings which currently cause a crash and allowing underground transformers.
This sounds realy good! :D
Just an idea: transformers are presently standalone buildings.
Change them to stations, so that you can build them ON power line tiles (maybe hiding them), and underground transformers could be there easily!
Instead, if you let them the way you are, the ability to be built underground could later be applied to normal extension buildings as well...
Unfortunately, transformers are very much different from any building implementation-wise.
Maintenance issues resolved and underground powerline way crossings blocked. Transformers can now be built underground and linked but this is quite buggy at the moment so trying to get it stabilised before releasing a version.
Interesting news!
I still would say that the typical transformer should be only above ground. Those in simutrans are rather Those which connect whole cities to the grid and are almost ever overground, even with underground cables.
Yes and no.
They are overground, because they are old. Newer Station are build often in the Underground (Example: Frankfurt)
By allowing powerlines (and transformers) to be constructed underground players are given a choice for connecting industries:
On the surface can involve high initial costs demolishing buildings but relatively cheap costs for construction and maintenance of the power line.
Underground will (pakset dependent) have high costs for both construction and maintenance of powerlines. However by keeping the surface free for development this potentially increases passenger numbers and revenue. Also looks prettier if you feel that's worth the extra cash!
Real life is similar rural and less wealthy areas may well have surface power lines - in developed urban areas these are often buried.
Regarding voltages of powerlines and transformers - industries used in simutrans vary wildly from small shops which are likely to use little more than domestic supply, through to oil refineries that would need a direct connection to a high voltage supply. My thoughts are that costs should be set so that economically speaking players to use surface connections except where absolutely necessary. If players choose to sacrifice some profit to preserve a town centre then they have the freedom to do that of course.
Adding a consideration: underwater tunnels are/must be the only way too connect the power grids of different continents, as the bridge span must be rather limited.
What's a continent? None of my maps have been anywhere near big enough to span multiple continents. They're hardly big enough to cover a single country.
Probably wrong word. I mean land masses separates by a large span of open sea. Islands would be a better word, but I wanted to differentiate the notion from that of smaller offshore islands. Anyway a power line bridge would look excessive for any span poof water larger than 6-8 tiles.
I'm very interesting to this idea. I want to purpose a adapted graphic of this powerline. Specially to transport energy through ocean or big lake.
on this sight, You can see a tubular powerline to transport energy, a relay on crossing line and a special transfprmer under a tile where is factory for example.
mEGa, I am sure that it would be great but also I think that it should not be so simple - regardless of it will be in underground and so nice face is not so important like if it would be surface utility.
Patch attached. Appears to be stable but surely needs more testing. I think I've removed any unintentionally included files in this patch.
Features:
*powerline tunnels can be built in similar manner to way tunnels, slopes are supported.
*transformers can now be placed on factories when underground mode is enabled - this builds a transformer below the factory tile selected if this is free
*to assist in locating factories in underground mode when transformer tool is selected factory outlines are shown, blue is unconnected power station, turquoise is connected power station, red is unconnected power consumer, orange is connected power consumer, green is active power consumer.
*underground powe llines can begin from underground transformers as well as existing underground power lines
You will need to add line to menuconf.tab in section specialtools after bridges(128). Be sure that numbers match those in your pakset and remember to renumber following entries in the special tools menu.
toolbar[10][7]=tunnels(128)
pak attached for 128 sizes, see top of thread for 64 sized image
Example dat:
Obj=tunnel
Name=PowerTunnel
waytype=power
cost=100000
maintenance=5000
intro_year=1950
menupos=-10
cursor=powerline-tunnel.1.3
icon=> powerline-tunnel.1.2
FrontImage[N]=powerline-tunnel.0.0
FrontImage[S]=powerline-tunnel.0.2
FrontImage[E]=powerline-tunnel.0.3
FrontImage[W]=powerline-tunnel.0.1
looks very nice out kierongreen.
Nice, I hope this can be included in Simutrans standard!
Thanks for this work! :D
I hope it will be part of Simutrans.
Nice work!
By the way, your idea about marking where the factories are underground would be marvelous if extended to the location of stations in sliced mode...
Excellent work! We have been needing this for quite some time. Is there any chance this patch will find it's way into the Nightly?
Also, i do not have a problem with the build cost, but maybe the maintenance cost is a bit high? Would something in the 1500-2800 range be more balanced?
Maintenance costs will be something that needs to be considered for each pakset. In pakBritain it looks like 5000 may be too much given this works out in my test game, even for one tile as approximately 10x the likely electricity income from a market.
So the pak you posted is for the 128 set. Did i overlook the 64 version? Being new i don't trust myself with makeobj lol
Quote from: Dorren on February 28, 2012, 09:37:03 AM
So the pak you posted is for the 128 set. Did i overlook the 64 version? Being new i don't trust myself with makeobj lol
Quotesee top of thread for 64 sized image
Quote from: Combuijs on February 28, 2012, 09:50:51 AMsee top of thread for 64 sized image
yes i saw that which is why i made the comment about makeobj. it is just the images, as it says. not the pak.
Is it possible to post a compiled version of simutrans, for testing?
My machine is linux so any compiled version would be linux only. Given that on linux many libraries can change I'm not sure how sensible it would be for me to release my own compiled testing version... Of course if anyone can build a testing release from nightly svn they would be more than welcome to do so and release it :)
I have attached a compiled (but not tested!) pak64 version of the powerline tunnels pak. Of course you will need a patched and compiled version of the simutrans executable to use this!
You have build a normal Powerline in the Underground at your Example from Post #66?
The Powerline-tunnel is only for connecting the Underground Line to the Overground Line?
Is a special Underground Powerline possible?
Underground powerlines use the same graphics as surface powerlines, currently at least. Using different graphics would require more code, as this is quite a large patch as it is I would rather it gets into the trunk first (if it ever does) before making it even larger.
To build underground powerlines you build a powerline tunnel on a slope in the same way you would a road or railway tunnel - holding down control will build just one tile rather than digging all the way through a hill. You can then edit the tunnel further by switching to underground mode and using the powertunnel tool, again, in the same way as you would edit a road or rail tunnel.
Quote from: kierongreen on February 29, 2012, 12:38:20 AM
Underground powerlines use the same graphics as surface powerlines, currently at least. Using different graphics would require more code, as this is quite a large patch as it is I would rather it gets into the trunk first (if it ever does) before making it even larger.
Can you elaborate? In the begin of tunnelbauer_t::baue_tunnel there is the code that loads the correct way object that is associated to the tunnel. Then one has to add some lt->set_besch(weg_besch) here and there. This should work ... Or are there more problems ?
Here is a bug report: Build powerline tunnel under factory then try to build transformer on top of powerline tunnel: The transformer is placed below the power line.
QuoteCan you elaborate? In the begin of tunnelbauer_t::baue_tunnel there is the code that loads the correct way object that is associated to the tunnel. Then one has to add some lt->set_besch(weg_besch) here and there. This should work ... Or are there more problems ?
At present tunnels do not support images to be used underground. Therefore I would need to add an additional wegbauer_t::leitung_tunnel_besch to define these images and code to set this from a particular way name (e.g. Name=PowerTunnelInside) I think.
This can be done naturally, but I'm more concerned about getting core functionality working, smaller patches like this can be made after...
QuoteHere is a bug report: Build powerline tunnel under factory then try to build transformer on top of powerline tunnel: The transformer is placed below the power line.
Thank you, revised patch is attached, only change is in simwerkz.cc, wkz_transformer_t::work at line 1379:
- if(!fab) {
+ if(!fab || gr->get_pos().z!=k.z ) {
Kieron, lately tunnels support a way=xxx parameter, where xxx is a way of same type.
You could ensure that multiple ways of waytype=power are possible and this parameter is read for power tunnels to, then it would be all matter of pakset choices.
Ok, this has been one week now; are there are changes that are required before this can be included in trunk, or is this being denied (in which case topic should be moved to appropriate board!).
Here is an updated version. I did some cleanup: replace dynamic_casts by gr->find<leitung>, powerline tunnel uses way parameter to get way images (as Fabio said).
I have another question: why are there these mark-dirty loops, when transformer is build / removed?
This patch is ready for inclusion imho.
Thank you. Dirty loops are because when the power state of a factory changes (either due to production changes or a transformer being built) the colour of the overlay tiles needs to change.
Patch updated: reworked the transformer tool to allow building transformers also in sliced underground view and to reduce code duplication. The overlay is now drawn always with dirty=true, no need to make these mark-dirty-loops.
There is one thing though: powerlines can connect through vertical walls to powerline tunnels. Intended? Imho this possibility should be removed.
Edit: Powerline tunnel take their images from the way pak indicated in the "way" parameter in the tunnel dat decription.
Thanks :) Yes I'm aware of the vertical slope tunnel connection. My feeling was to leave it in as it does no harm...
Personally I would still like to have a parameter to forbid transformer underground for pak sets to disallow supply of oil rigs and fish swarms; but on newer version I can of course forbid those indsutries to increase with power also.
ANd the vertical connection through a wall is imho an error.
I suspect that unless they are in shallow water transformers will not connect to water industries...
Revised patch for svn5547. Addresses concerns over transformers being built under water and power lines connecting through vertical slopes. Also fixes problem with existing simutrans code where power lines would similarly connect to power line bridges if at same height.
Changes:
dings/leitung2.cc:54
- if( lt ) {
+ if( lt && (gr->ist_karten_boden()==gr_base->ist_karten_boden() || (gr->ist_tunnel()==gr_base->ist_tunnel() && gr->ist_bruecke()==gr_base->ist_bruecke())) ) {
simwerkz.cc - in wkz_transformer_t::work
...
// underground: first build tunnel tile at coordinate k
if(underground) {
+ if(gr->ist_wasser()) {
+ return "Transformer only next to factory!";
+ }
+
if(welt->lookup(k)) {
return "Tile not empty.";
}
....
Edit: this is based on Dwachs 5528 patch
Ok, finally incorporated with an additional setting:
Using allow_undergroud_transformers=0 in simuconft.tab the usage of underground transformer can be disallowed (but default is allowing).
Many thanks prissi :)
:D :D Many,many Thanks to all!!!
Is it possible to create a own undergound Grafic for the Tunnel?
Currently it uses the normal Overground Grafic, and this looks not perfect in the Underground.
Does the power supply line tunnel possibly already function? :o
It is supported in nightly builds yes. However it will now need to be added to paksets which involves adding an entry to menuconf.tab as well as adding a powerline tunnel pak.
kierongreen
i will be test so soon!
Quote from: The Transporter on May 15, 2012, 03:50:07 PM
Is it possible to create a own undergound Grafic for the Tunnel?
yes, just like for all other types of tunnels.
Quote from: kierongreen on March 11, 2012, 01:03:37 PM
... Also fixes problem with existing simutrans code where power lines would similarly connect to power line bridges if at same height.
This change broke powerline bridges to vertical slopes (ie bridges ending on vertical slope). Not sure how to fix this...
Ouch hadn't considered that... Well a couple of options, 1) just revert this change, as I only changed it due to correcting problem with connections to tunnels, or 2) implement ribis for leitung, possibly making more mergers with the rest of the weg code in the proccess.
I tried to repair it in r5764.
Revert looks good.