News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Pipelines

Started by Banksie_82, February 02, 2009, 03:06:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DrSuperGood

Pipelines could be made into an important gameplay feature, but they would have to be implemented correctly so as to require effort to use similar with other transport types (except aircraft, which are currently broken in that they are just too simple to use).

Unlike normal transport which moves packets of goods between destinations in convoys, a pipeline would be a tunnel which moves goods at a certain rate from source to destination in a continuous flow. One could model this by "filling up" the pipeline representing the quantity in transit and then getting a steady flow out every tick.

So that skill is required, pipelines would suffer from various semi-realistic physical constraints. The longer the pipeline the slower the flow out is. If you are pumping up hill the slower the flow is. Turns slow flow as well, with right-angle turns being very bad. To raise flow you need to place pumps along the pipeline, which will cost you. Further more pipes are limited to a maximum flow which they can carry (pressure) meaning that you cannot just bunch all pumps at one end of the pipe and need to spread them where needed. Each pipe needs a origin and termination, and does not support multiple. Transfers can be used to split pipes (eg 1 termination and then 2 pipe origins). This means that for dual flow you will need 2 separate pipe lines.

Pakset wise the mechanics would apply to fuels (oil pipe line) and bulk (conveyor belts, often used in mining). As time progresses you will get access to bigger or more efficient pipes and pumps. The pipes themselves should have reasonable maintenance cost but are practically invariant in tunnel, bridge or surface form. Construction costs should be quite high (tunnel level, if not more). Potential profit from a pipeline is lower than with trains or road, especially since it will only ever ship in one direction.

Yona-TYT


@DrSuperGood... I agree with you, this can be a very important feature for Simutrans, in fact I really like the idea.  :thumbsup:
It could also consider water services to industries or even for cities, something that looks interesting.

vzrenggamani

i am forgot about denied request / extension , sorry

SIMUTRANS INDONESIA WEBSITE  <<< Indonesia Simutrans Addons Center And Web
HOPE YOU UNDERSTAND MY ENGLISH

Leartin

Pipelines and Conveyer Belts can be very interesting, after all there is a whole game based on them (Factorio)

But would they fit in Simutrans?
With vehicles, if there is no complete connection, no goods are provided. Goods are only provided for a specific destination. There is some logic about how many goods are on the way.
With pipelines, you could have it so no oil is provided unless there is at least one complete connection, but since you try to "fill" each pipe tile before the next starts filling, you can't really have each liter of oil have a specific destination. I mean, you could, but that would be a memory issue, as you would not only need to keep track of the filling of each pipe tile, but also update them each time, wheras if each liter of oil is the same, filled pipes can be largely ignored and new oil just appears on the first non-full pipe-tile, until it appears at the consumer.
This also means that there is no way a consumer could keep track about how much oil is on the way, which might mess with consumers that get deliveries from both pipeline and vehicles.

By the way, I disagree that pipelines should be tunnels. While tunnels should be an option like with every other way, it's better to have them above ground as they might look ugly and need space, which are both incentives not to use them to some, but not all players (=diversity)
Another thing would be that pipeline pumps usually use a lot of energy, so one could make it a nessecity to supply electric energy to each pump. This would further complicate them, but also supply some network-ish use, since the electric lines serve a double function.


I guess either way, since DrSuperGood can program, he can program pipelines to the game. It can't hurt, since paksets would not be required to use them. Might just be a new waytype usable for walls that don't connect to railways, if nothing else ;)

Ters

Quote from: Leartin on January 22, 2016, 06:55:50 AM
With vehicles, if there is no complete connection, no goods are provided. Goods are only provided for a specific destination. There is some logic about how many goods are on the way.
With pipelines, you could have it so no oil is provided unless there is at least one complete connection, but since you try to "fill" each pipe tile before the next starts filling, you can't really have each liter of oil have a specific destination. I mean, you could, but that would be a memory issue, as you would not only need to keep track of the filling of each pipe tile, but also update them each time, wheras if each liter of oil is the same, filled pipes can be largely ignored and new oil just appears on the first non-full pipe-tile, until it appears at the consumer.
This also means that there is no way a consumer could keep track about how much oil is on the way, which might mess with consumers that get deliveries from both pipeline and vehicles.
Simutrans would likely deal with oil in larger units than liter, such as cubic meter (as pak64 does). This still means that a 320 m3 oil tanker can carry oil destined for 320 different consumers in Simutrans today. However, all units of cargo destined to the same place are merged into one to make processing and storage of the data more efficient. If each pipe tile works the same as a vehicle, except that it automatically transfers to the next at certain intervals when full. Dealing with splits and merges might be difficult, though.

Quote from: Leartin on January 22, 2016, 06:55:50 AM
Another thing would be that pipeline pumps usually use a lot of energy, so one could make it a nessecity to supply electric energy to each pump. This would further complicate them, but also supply some network-ish use, since the electric lines serve a double function.
Then we get the problem that you can't get oil to the oil fueled power plant which is needed to pump the oil to the power plant. Which is why power plants don't power railway electrification in Simutrans.

Leartin

Quote from: Ters on January 22, 2016, 07:10:05 AM
Simutrans would likely deal with oil in larger units than liter, such as cubic meter (as pak64 does). This still means that a 320 m3 oil tanker can carry oil destined for 320 different consumers in Simutrans today. However, all units of cargo destined to the same place are merged into one to make processing and storage of the data more efficient. If each pipe tile works the same as a vehicle, except that it automatically transfers to the next at certain intervals when full. Dealing with splits and merges might be difficult, though.
While a 320m³ oil tanker might have 320 different destinations, these 320 different destinations stay the same over the whole voyage. Depending on how much oil is in one pipeline tile, the amount of data stored might be about the same, but the amount of data constantly changing is different, since each pipeline tile always loads and unloads. Maybe that's not memory but performance, but it surely is an issue to think about.

Quote from: Ters on January 22, 2016, 07:10:05 AM
Then we get the problem that you can't get oil to the oil fueled power plant which is needed to pump the oil to the power plant. Which is why power plants don't power railway electrification in Simutrans.
Except that you can, obviously, since you can use oil fueled power plants even now, despite there not being any pipelines. You'd need to be very unlucky to start a game where the only power plant is oil-fueled in a pakset that deemed it unnessecary to include oil vehicles. And since pipelines are supposedly very expensive to build, you could not start the game with them anyway.
Also, you could just have pumps that get way more efficient with electricity, to the point where not powering them isn't viable, but they still work and can get the system running.

DrSuperGood

You model the entire pipeline as a single unit. Until the computed capacity is reached nothing flows out. After that the computed flow rate flows out. Goods get pulled and pushed from source to destination stop storages by the pipeline at the flow rate determined. Internally a list of where all the oil stored inside the pipeline is destined is maintained in case it ever has to be emptied (in which case pull them out in some fair way). Otherwise the pipeline acts as an immediate bridge between stops transferring wear packets at the determined flow rate. How it transfers the ware packets when congested to be fair is to be determined, but should flow rate suffice then packets to any number of stops would be transferred. So that oil to new destinations, arriving after the pipe is filled, can be stored in the pipe some sort of sharing algorithm is needed to empty out the current destinations and fill up a new one. An alternative is that your company has to buy all the oil in the pipeline, which has some very large cost as well (it no longer is in-transit, instead is standing volume which you substitute with oil at one side and remove oil claimed as the same at the other, aka a form of teleportation).

Quote
I guess either way, since DrSuperGood can program, he can program pipelines to the game. It can't hurt, since paksets would not be required to use them. Might just be a new waytype usable for walls that don't connect to railways, if nothing else ;)
Still working on power though, far too slowly I have to admit.

Leartin

#112
That "single unit" approach is what I meant, but that does not work too well if the oil has a destination. If you have a connection A->B which is already filled up, it would be filled with oil for B only. If there is another consumer C nearby B and you start a connection via train, if the oil has a destination, you'd need to wait until the newly provided oil has flown through the whole pipe. And since as the player, you don't have direct control on who the oil pump is providing for, it might be that at the moment C gets connected, it's prioritized over B and gets all the oil.
Since the ratio at which oil is provided to different destination can be different from moment to moment, you'd either have to work tile-wise where each tile is a bit like a vehicle, or you can store the contents of one end/intersection of pipes to the next, as a list in a specific order (5m³ to C, 3m³ to B, 7m³ to C, 2m³ to B,...) which es emtied at the top at the flow rate. Not sure if that's more efficient.

Either way, it would be a lot easier if you just drop the destination thing and fill up the pipeline as soon as it is buildt. At each End, you build a tank (similar to the power station - its a fill-tank or drain-tank depending on whether it's buildt at a producer or consumer)
As soon as there is a connection between A and B, A starts to provide Oil destined for B in it's tank, which gets teleported at flow rate to Bs tank, where B can drain it.

Of course there is a lot of oil "lost" in the pipeline which does not count towards in-transit, but does it need to? In-Transit is just a way to avoid people from building a massive storage depot a few meters away from a consumer with only a small connection between them, just so it counts as connected, to avoid filling the consumer. But really, the in-transit should take in consideration how swift the goods move, since you'll just need more goods in-transit if they move slower. With 3-5 km/h, oil pipelines are slower than an ox cart, so if you calculate how much in-transit should be allowed, you'll get big numbers. Plus game wise, you can't  abuse it. Since the oil in the pipelines has no destination, you can't sell it on the way, you can't build some station close to the consumer and have a bad connection for the last few meters, since then normal in-transit would come into effect, and if you build a spiral pipeline you would not earn any more money, since the oil does not even look up where it went, it teleports, thus always using a direct connection.

Edit:
Quote from: DrSuperGood on January 22, 2016, 01:44:42 PMStill working on power though, far too slowly I have to admit.

Aren't landlines just like pipelines, but with a very high flow rate?
If you actually consider creating pipelines for the game, I would recommend thinking about it right away. Since your proposal about pipelines is to make them interesting by not just being something easily buildt, you could probably use some of the same logic for electricity. While electricity would not slow down because it goes uphill, (which just means you'd need to not hardcode the different flow-losses) you could have different flow rates with different voltage, which need transformers between them (transfers - I think you'd need them between different pipe capacities as well)
I'm just throwing this out, since it was speculated before that pipelines could use the electricity logic, which was deemed too boring. This means electricity is currently too boring, and it might be good to find a more interesting implementation, just like with pipelines.

Edit 2:
Actually, instead of something called "transfers" in pipelines, you should place tanks. This is so each pipe teleports from one tank to the next at it's flow rate, and so you can look at different tanks at different splits and see where the contents are destined to go. It also plays well with the idea that each pipe is one-directional, since you'd place a pump at each tank to pump out of it. It does not play as well with electricity - though I don't even know if landlines are truly bidirectional.

Banksie_82


This was my original request, many years ago now. It's something I'd still like to see done and the way DrSuperGood describes it is how I always wanted it to work (not like electricity currently does). I believe the amount of variables, including height differences, losses due to bends and length, max pressure capacities, various pump sizes and efficiency curves and of course size of pipes, could make this quite an interesting feature. I also have in my head plenty of UI ideas and possible data feedback from the performance of the system, but that may be my inner nerd taking over.


From a physical/coding point of view you can indeed have multiple origins and destinations flowing through the same segment of pipe. Destination of each unit becomes a bit tricky, but if you assume the pipe is always full, then the consumer just needs to 'turn on the tap' when they want some. With a maximum flow rate being the lesser of what their upstream supplier(s) can provide or the pipe network capacity at that time step, based on what other uses are demanding and suppliers supplying at the same time, and where they are on the network.


This sort of thing isn't too dissimilar from my line of work IRL, so I'm very comfortable with the required equations/variables/maths to make it realistic. I'm more than happy to help where I can if anyone else wants to work on this, but my coding abilities only extend as far as excel, and I don't mean macros.

IgorEliezer

Oh, echoes from the past.

I think there's a fear that some players would stop using vehicles in favor of pipelines. Honestly, there will be a moment that your over-jammed train line no longer does the job and you have to switch your oil or ores transportation to something else, less ugly and convoluted. And by the way, you can't transport everything through ducts and conveyors. Most of goods in Simutrans simply don't fit in a duct-type way of transportation, people for example....

...unless we're talking about Jetsons. ;)


Ters

Quote from: IgorEliezer on January 24, 2016, 05:14:48 AM
Most of goods in Simutrans simply don't fit in a duct-type way of transportation, people for example....

Elon Musk disagrees, although there is arguably vehicles involved, if only to keep the passengers from suffocating.

Vladki

Warning - this is long post and full of new ideas :) No commitment to do it, just asking for opinions, if this may be the way to go?

It is nice to see the discussion about pipelines revived. On Czech forum I had encountered requests also for cable-cars (or funiculars) like this one: http://www.lanove-drahy.cz/fotogalerie/nld_kuncicefoto.htm or this https://en.wikipedia.org/wiki/Gondola_lift

I think these share some common features with conveyor belts and pipelines, and could be implemented as special type of way.
- the way is tightly bound with the used vehicles, their cargo type, capacity and speed. You cannot just change the gondolas to bigger ones. You have to change the ropes, build stronger pillars, install more powerful engines, ...
- stations, depots and engines are combined into one building, and are (usually) at the ends.
- there are no switches, crossings, etc. Just straight point-to-point connections. If necessary, one can do it by building a transfer station, where more lines meet.
- lines have limited length (rope length, pump power)
- can be elevated (cable-car), surface/underground (pipeline), surface/elevated (conveyor belt)
- all vehicles are in fixed distance and move synchronously, (un)loading is done quickly during the movement.
- the number of vehicles is given by the length of line. (2 vehicles per tile (there and back) - with capacity scaled with tiles/km in experimental)
- goods flow (mostly) in one direction - exception are passenger cable-cars/escalators - one-way line would mean allowing only empty vehicles in one direction
- downhill and uphill (partially) negates each other. If a line goes up and down hill in one stretch, the gondolas moving downhill, help to pull those going uphill. Similarly fluids flowing downhill help to suck the part going uphill, and if the outlet is lower than inlet, it will flow by itself (viscosity may affect this though). There will be defined power demands for straight, up, down (double/half) tiles, capped with maximum power of the engine. (Downhill could have negative power demand) If max power (or max distance) is reached, line has to be split in two - new pump.
- conveyor belts are clearly only for bulk goods, funiculars for bulk and passengers, and pipelines for fluids.
- fluids in pipelines can be abstracted as special vehicles - big drops moving there, and empty bubbles back.
- this will preserve the behaviour of goods transferred by other vehicles

So how it could behave in the game?
You open a new pipeline menu - you see a few ways. They have defined - type (surface, elevated, bridge, tunnel), subtype (cable-car, pipeline, conveyor belt, escalator), max capacity or weight per tile (km), max speed, max length, one-way or not, power/friction for up/down hill.
First you build the line, ideally you could connect surface/tunnel/bridge/elevated sections as usual, just limited by total length.
Then you build the end stations (and depots at the same time). Each subtype (cable-car, pipeline,...) will have its own station/depot.
Station part will behave as normal station - has defined capacities for pax/mail/goods, and could connect to other stations, have the same coverage as other stations.
Depot part will offer to buy a stationary engine/pump and gondolas. It may work as if building a train, but you will be allowed to build only one or two engines (one for each end) and so many gondolas as is the length of line. For pipelines and conveyors imagine that  gondola is a bubble or blob ;). There may be more types of engines and gondolas for each type, and the depot window will let you build only those that are suitable (max weight/capacity) for the built line. If the engine is underpowered could be show, just like with trains. Where applicable the gondolas could be of different type (pax/bulk). For pipelines / conveyors a switch for one specific cargo would be needed - cannot mix crude oil and gasoline in one pipe.
Then you just click start (no schedule needed) and see the gondolas appear on the line and move. In a pipeline you could see drops of oil moving. (So it won't be so boring). You could stop the line by sending it to depot. Perhaps a speed knob might be useful to avoid running half-empty.

IgorEliezer

Quote from: Ters on January 24, 2016, 08:56:28 AM
Elon Musk disagrees, although there is arguably vehicles involved, if only to keep the passengers from suffocating.
Yes I know that thing, but it's like a monorail with a vehicle running inside the "rail". But the concept of pipelines in this topic eliminates the use of vehicles.