electric trains

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by eradicator »

ondrii wrote:
Wed Sep 12, 2018 8:55 pm
For electric locomotives it is easy like solar panels - number of running electric locomotives * energy consumption, just single calculation for all locomotives (within same electrical network).
That last bit is the problem. You can not simplify the check for every loco on every tick, in which network it currently resides. Just because most people just build one large network doesn't mean the engine can skip the check. (Also having power run through the rails would be wildly unrealistic and dangerous :p)

@Bob:
Accumulator cars too? Hm. I'd have thought that a train with accumulators (built-in or seperate carriage) that only recharges when stopped at a station would have at most the same overhead as fuel inserters. Do you remember the exact counter arguments for that (Except coding effort :p)?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by bobingabout »

eradicator wrote:
Thu Sep 13, 2018 10:09 am
@Bob:
Accumulator cars too? Hm. I'd have thought that a train with accumulators (built-in or seperate carriage) that only recharges when stopped at a station would have at most the same overhead as fuel inserters. Do you remember the exact counter arguments for that (Except coding effort :p)?
Well, I proposed that stations could recharge trains. They did say this was viable, but the big question was... Why? How is it significantly different than just using burner fuel to justify spending the required time on something that wouldn't be used in vanilla?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by eradicator »

bobingabout wrote:
Thu Sep 13, 2018 10:28 am
eradicator wrote:
Thu Sep 13, 2018 10:09 am
@Bob:
Accumulator cars too? Hm. I'd have thought that a train with accumulators (built-in or seperate carriage) that only recharges when stopped at a station would have at most the same overhead as fuel inserters. Do you remember the exact counter arguments for that (Except coding effort :p)?
Well, I proposed that stations could recharge trains. They did say this was viable, but the big question was... Why? How is it significantly different than just using burner fuel to justify spending the required time on something that wouldn't be used in vanilla?
"Significantly" different is difficult :D. It mainly saves you the trouble of requiring "refuel" stations all over the map (And that's quite a bit of infrastructure if you use lots of trains), and it fullfills the players need to "upgrade" trains to a less annoying stage :p. The main problem for moddability i see (as far as i've pondered implementing it myself) is that there's no good way to enforce that trains leave only when they're fully charged. I.e. there is no wait-condition "fully charged", while burner fuel can (i think? can it really? or is that maybe not a problem?) be emulated with a "coal = 150" type condition? (Or with "inactivity" condition).
I've also seen several requests in the direction of having lockable fuel slots on trains to abuse them for inputting itemified electricity that the player can't take out, which have all been rejected. And there is no condition to check LuaBurner.remainint_burning_fuel to stop a train from leaving undercharged.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

thriem
Inserter
Inserter
Posts: 24
Joined: Fri Mar 30, 2018 1:05 pm
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by thriem »

[quote=eradicator post_id=378667 time=1536860975 user_id=24632]
[quote=bobingabout post_id=378629 time=1536834481 user_id=1693]
[quote=eradicator post_id=378625 time=1536833364 user_id=24632]@Bob:
Accumulator cars too? Hm. I'd have thought that a train with accumulators (built-in or seperate carriage) that only recharges when stopped at a station would have at most the same overhead as fuel inserters. Do you remember the exact counter arguments for that (Except coding effort :p)?
[/quote]
Well, I proposed that stations could recharge trains. They did say this was viable, but the big question was... Why? How is it significantly different than just using burner fuel to justify spending the required time on something that wouldn't be used in vanilla?
[/quote]
"Significantly" different is difficult :D. It mainly saves you the trouble of requiring "refuel" stations all over the map (And that's quite a bit of infrastructure if you use lots of trains), and it fullfills the players need to "upgrade" trains to a less annoying stage :p. The main problem for moddability i see (as far as i've pondered implementing it myself) is that there's no good way to enforce that trains leave only when they're fully charged. I.e. there is no wait-condition "fully charged", while burner fuel can (i think? can it really? or is that maybe not a problem?) be emulated with a "coal = 150" type condition? (Or with "inactivity" condition).
I've also seen several requests in the direction of having lockable fuel slots on trains to abuse them for inputting itemified electricity that the player can't take out, which have all been rejected. And there is no condition to check LuaBurner.remainint_burning_fuel to stop a train from leaving undercharged.
[/quote]


Something else came to my mind - like an accumulator charge, an [C] signal with % of charge?

However, I am not quite experienced with modding either... but why "charge" trains in the first place? Trains are barely battery driven anyway - and I think of a way, where you have 1 entity which consumes electricity - the amount that trains need.

The most comfortable and beneficial thing would be, that you have separate/real substation, which put the current on rails - in both ways - so you have "electrical rails" without the need of placing poles along the rails. Just put another substation at the end and you can go on from there, and set up your mining drills or whatever...

To balance things out, a second tier of rails would be needed to come up with the costs of catenary - like +3 steel and +2 wire cost.

To be able to send logistic signals over the rails would be also nice to have - else you would have to run poles anyway and therefore nullify the benefit.
Image

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by bobingabout »

It can, and has been done with modding. If you want to simulate electrified trains in a mod, this is the process.

1. In a data phase, take a locomotive with a burner inventory of size 0. (Size 1 might work if you change it to a dummy fuel item category where no items exist.) You'll want to look for and track creation/destruction of these entities in a list in your scripts.
2. Add some kind of accumulator, or electrical interface entity as your interface to the railway. This needs to connect to the electricity grid to charge the locomotives.
3. Add a fake fuel item for your locomotive, it should have a power of however big you want the locomotive's buffer to be, and at least big enough to power the locomotive for a tick or two (or however many ticks you want to update your energy transfer script, or per locomotive if you opt for a spanning script).

4. Scripting. Set the "Currently burning" fuel type to whatever your dummy fuel item is. if electricity exists in your interface entity, remove energy from the entity buffer, and increase the locomotive's buffer by the same amount (until full)
Iterate through all trains. It will be a burner powered locomotive in reality, but will appear to run on electricity.

5. I'm fairly sure a mod that does this already exists.

https://lua-api.factorio.com/0.16.51/LuaBurner.html
That should be the interface on the locomotive.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by steinio »

You don't need a fake item.
Just Set energy to a random large value.

This script just refuels the locomotives forever:
https://mods.factorio.com/mod/Fusion4allTrains

Just check if an electric network is around.
Image

Transport Belt Repair Man

View unread Posts

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by eradicator »

steinio wrote:
Sat Sep 22, 2018 1:04 pm
You don't need a fake item.
Just Set energy to a random large value.
It is not possible to set remaining_burning_fuel to a value higher than currently_burning.fuel_value.
Additionally the GUIs fuel bar is scaled to fuel_value, so a fake item is in fact required for correct display of remaining charge.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by bobingabout »

steinio wrote:
Sat Sep 22, 2018 1:04 pm
You don't need a fake item.
Just Set energy to a random large value.
The "fake" item is as described here to make sure your buffer size is what you want it to be. See what Eradicator said.
eradicator wrote:
Sat Sep 22, 2018 1:59 pm
It is not possible to set remaining_burning_fuel to a value higher than currently_burning.fuel_value.
Additionally the GUIs fuel bar is scaled to fuel_value, so a fake item is in fact required for correct display of remaining charge.
On top of that, the fake category prevents you from sticking any other type of fuel in the slot, assuming you can't turn the slot of. This part might not be required.

This is why I've failed to do it in the past, I didn't realise you needed to set the "currently_burning" item first. And now that I know this, there's another mod that does it, which reduces my desire to try it myself.
Also I'm not a fan of the whole keeping track of entities, or rolling entity update scripts.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

YumYumFisch
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Feb 12, 2019 5:45 pm
Contact:

Electric Trains

Post by YumYumFisch »

I kinda like the idea of having electric trains.

I can understand those who want to solve the problem of supplying their trains with fuel and i like the feature that they drive faster, when you insert rocketfuel instead of coal.

But i was playing around with the idea of having Electric trains.

This would mean that you no longer need to fuel your trains although maybe your speedboost gets lost. (depending on how it gets implemented)

I can see two ways of electric trains getting implemented:

1. You have to craft electric loks. These loks can drive on the normal rails but a power pole needs to be placed so that it reaches the train. I dont like this idea that much as it would mean you have to place power poles (not the big ones) next to the track so the train does not stop.

2. You have to craft electric loks and electric rails. These electric loks can more or less drive on normal rails but they cant accelerate on them. The lok gets powered by driving on a powered rail. To power rails you need an object that connects the rail to your power system. The power gets distributed to connected power rails so you dont have to power each rail independantly. You could even add the speed feature: Next to the part of the rail that gets powered the speed bonus is highest. (Maybe about the speed boost of nuclear fuel or even a bit higher) With increasing range from the power source the speed boost decreases. By adding additional power converters you could achieve a constant high speed.

I would really like to see this feature in factorio but what do you think about it?

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Electric Locomotives & Other Rail Cars

Post by Koub »

[Koub] Merged into older topic with same suggestion.
Koub - Please consider English is not my native language.

Radiation
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Oct 25, 2019 12:46 pm
Contact:

Train evolution

Post by Radiation »

So I was thinking that it would be nice if trains had some kind of electric upgrade. Maybe make a research that gives you two new items to craft, an electric locomotive and an electric rail, with the added rules that an electric locomotive can only travel on electric rails and the electric rails must be connected to a power output.

This would , obviously, make the problem of train refueling disappear.

(Train refueling is annoying because you cannot check the amount of fuel in a train so to make sure that trains don't suddenly remain without fuel unnecessary stops are needed)

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train evolution

Post by Optera »

Train progression instead of fuel progression: https://mods.factorio.com/mod/TrainOverhaul
Electric Trains working well alongside with Train Overhaul: https://mods.factorio.com/mod/Realistic_Electric_Trains

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: electric trains

Post by Koub »

[Koub] Merging spree of "we want electric trains" topics.
Koub - Please consider English is not my native language.

bob152637485
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Feb 09, 2020 11:23 pm
Contact:

Addition of electric locomotives

Post by bob152637485 »

TL;DR
I would like to see electric locomotives added to the main game, similar to maglev trains in real life.

What ?
I feel that as game progression goes on, more and more applications seem to rely on electricity rather than burnable fuel. This is an aspect of the game I really enjoy, as I like the logistical challenge of increasing your power production. Locomotives are one of the few areas that still require a form of burnable fuel in the late game, and I feel there is room to create an electric variant for the end game.

What I suggest is to still keep all of the current train setup, but also create a second set specifically used for an electric train network. This can require very high level end game research, and can even be very expensive to implement(talking blue circuits here!). Below are just a few ideas that I have that I feel would go along with this quite well:

-A new locomotive designed to run off of electricity. Can be called "Maglev Locomotive" or something similar. Crafting recipe may involve a regular locomotive, some copper, and a good amount of blue circuits to create. Could still work with the normal cargo wagons, but without any of the speed benefits that are mentioned later on. Would only be able to get power from rails, as mentioned next.

-Special rails to supply power, only compatible with the electric locomotive(*see reasoning below). Crafting could include normal rails, some copper, and perhaps a single blue circuit. You could say that the rails would be similar to a power pole, but would only be able to "get" power from nearby poles rather than "send" it. Any connected rails would be part of one big network, and could receive its power from a single power pole(so long as the rails are all connected and continuous), but would not be able to provide power to another power pole. This makes it more like a building that demands power without transmitting it, and would still mean that power would need to be run parallel to your tracks to go where it is needed.

-Special cargo and fluid wagons to be used with the locomotive. These can take their non electric variant and a smaller amount of blue circuits than the locomotive to craft. They don't necessarily need to have a power demand in and of themselves, but would only work with the electric locomotive. Since it would be an upgraded version of the normal wagons, perhaps you could also increase the capacity of the wagons as well(make the cargo wagons have the same capacity as a steel chest, and the fluid wagons' capacity can be increased by an equal factor).

-FAST speed! In real life, maglev trains go hundreds of MPH. These trains could thus reasonably go at least as fast as nuclear fuel when fully powered, but could probably go even faster(500 MPH?), with a higher top speed and acceleration than their non electric variants. As with other electric components of the factory, can slow down and eventually come to a stop when power production is not adequate.

-Compatible train stops, rail signals, and chain signals. I personally don't see the need to create newer versions of these for the train system.

-LOTS of power requirements. Even though in real life maglev trains are quite energy efficient, such a train system would be very powerful in the game. While the crafting recipe should be quite expensive, I think it is reasonable to also have a larger power demand. I suggest that each rail segment each have a small power drain that is additive for each connected segment. In addition, the locomotive itself should have a much larger power drain at idle, and should increase its power demand based off of its speed and load(8 wagons at 500 MPH should demand twice as much power as 4 wagons at 500 MPH). If deemed fit, you may decide that it is better to have the wagons also demand a small amount of power. You also may choose to have a non linear power demand plot, either making more wagons less efficient or more and making acceleration either demand more or less power than steady state. Braking may also have a power demand as well.

-Lower locomotive pollution. Since it would be an electric train system, I think it is reasonable to remove the pollution that is generated from the normal locomotive.

*Upon further thought, I think it would be best to have the newer rails backwards compatible with the old ones, so that the normal locomotive can run on the new rails, but the electric locomotive can NOT run on the old rails. I say this because it would allow you to use an upgrade planner on the normal rails to convert them into the newer rails, and still allow your old train network to be fully functional until all of the rails are replaced and you are ready to build your new electric locomotive. The normal locomotive would have the same speeds as with the normal rails, and the electric rails would still have a power demand, even though it is not being utilized. If an electric rail segment does not have a power source yet, it will simply function as a normal rail for the non electric locomotives, and will cause an electric locomotive to stop dead in its tracks, as if it reached a gap in the rail system.
Why ?
I think that this will greatly change the game for most people. Not only would it introduce an extraordinary production challenge to set up the very expensive network and provide the needed power, but the speeds(and possibly capacity) of the train would be a great throughput improvement and reward for those willing to take up the challenge to implement it. Of course, there would be nothing preventing players from choosing to use the normal train network system, similar to how some players don't bother to play around with nuclear power in their factory. This would not only eliminate a need for burnable fuel in your trains in the end game, but just setting up the network to begin with may prove a nice change of pace in the end game where another challenge is always welcome.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: electric trains

Post by Koub »

[Koub] Merged into the Electric trains request.
Koub - Please consider English is not my native language.

opa_in_the_fab
Burner Inserter
Burner Inserter
Posts: 6
Joined: Tue Feb 02, 2021 6:21 pm
Contact:

electric trains

Post by opa_in_the_fab »

Add late game upgrade path for rails and trains:
electric rails and electric trains
What ?
Add late game upgrade path for rails and trains: electric rails and electric trains
Research item xyz to enable the production of electric rails and electric trains
Research costs (high, including space science pack) to ensure only available in late game
electric trains run by consuming electricity; getting rid of supplying trains with fuel
electric rails are part of the power grid; getting rid of placing electric poles along the rail lines
receipe for electric rails: tbd
receipe for electric trains: tbd
Why ?
at late game, removes the necessity to supply fuel to trains (which is a chore when having a really high number of trains & train stops)
at late game, usees the rail grid as power grid, instead of having to place lots of electric poles for large area power grids
(would nicely align with placing area-grapping laser turret walls lines along railways)

At late game, the focus of the player usually shifts to managing mega-bases.
Everything is researched. It is no longer about adding something new, but on making everything bigger.

The player then (usually) has already placed lots on non-electric rails, arready uses fuel powered trains, has placed lots of electric poles along rail lines.
So it would be nice to let the player focus on the then-relevant jobs (grapping areas, adding ressource areas to the network, ...)
instead still dealing with the old jobs which by then have become chores.

WHY do you think it increases the value of Factorio as a game?
adds one more resreach item
thus makes the game more interesting & complex
late game research item extends the game
gives motivation hunting through the research tree to reach that research item

Electric rails could be that-expensive to act as a late game ressurce sink.
Thus a motivation to extend the ressource gathering and increase the fab output.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: electric trains

Post by Koub »

[Koub] Merged into the Electric trains request.
Koub - Please consider English is not my native language.

Post Reply

Return to “Ideas and Suggestions”