[MOD 0.16 - 1.0] Realistic Electric Trains

Topics and discussion about specific mods
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

Oh, I see. Yes, that's intended too: The poles have a relatively large buffer which is filled automatically when building them to avoid draining the power grid. Try driving a little longer, eventually it'll run out of power.
I know it's somewhat unrealistic, but I think it's better than having a brownout in a starter base due to building an electric rail system which is technically not in use yet.

Maybe I'll try to "enable" the pole only when it is connected to a power source, but I think it is not as big of an issue to put that much work into.
User avatar
JaJe
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Wed Feb 27, 2019 6:48 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JaJe »

In this case there's no reason to ever connect overhead line poles to any power input to prevent wasting energy on trains...If I have 10 locomotives then 1.2MW trains x 10 = 12MW energy free trains.
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

Sorry to crush your dreams, but the trains are not actually energy free. As I said, the poles have an energy buffer, currently set to almost 20MJ. This is required for the planned higher-tier locomotives that have a much higher energy output. Yes, you can drive an Advanced Electric Locomotive for free for about 16 seconds for each pole. But after that, it won't work anymore until you connect the power grid.

Depending on how crazy the energy demands of the top level locomotives will actually be, I'll probably reduce the buffer size though.

Still, this is in my opinion a way better approach than draining a base's energy supply (Think early game steam power) with energy that is only buffered indefinetly. 20MJ is quite a big amount.

I'd love to do this without ridiculous buffers like that, but I doubt it is at all possible with the Factorio API. I'll take a look though if I can disable poles that aren't connected to the grid.
User avatar
JaJe
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Wed Feb 27, 2019 6:48 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JaJe »

I understand, I tried to run on circle for a few minutes till the train started having power issues. I was thinking at least why not nerf a bit the buffer? allow trains functioning for 5-10 seconds at maximum and then you're forced to connect to the grid
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by MasterBuilder »

Forgive me if I'm wrong. I only just found this and don't have the time to convert the megabase I'm currently designing.
Exited to try this out though. Finally electric trains done right.

Have you considered giving them a tiny buffer to start and increasing it with research when the player unlocks the higher tiers? (Assuming there's research for higher tiers.)
That might solve the problem of the cheaty buffer. (Also assuming you can change the buffer size with research.)

Personally, I'd rather it not come with an initial charge. Having enough power to change it initially is part of the challenge that is Factorio. (Mods can create options now, so making the initial charge state an option is also another way to go.)
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

Changing the buffer size with research is unfortunately impossible, because it is fixed in the entity prototypes when the game starts.

Honestly, if it was possible I'd get rid of the buffer too, but I can't due to how the electric system works.

And I'm pretty sure I won't remove the initial charge for the simple reason that all the charge you put in initially essentially goes to waste, as you either never remove the pole or simply not drain it before removing. Having 2.4MJ (yes, its less thab before) go to waste for every single pole you place is in my opinion well beyond reasonable.

Also, the only "bad" thing you can do with it is charge up a train maybe four to eight times until it stops working and you need to connect power anyway.
leoch
Fast Inserter
Fast Inserter
Posts: 136
Joined: Fri Dec 16, 2016 9:37 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by leoch »

But why do you need to put a buffer in the power pole? The Induction Charging mod is able to charge player/vehicle equipment grids directly from ordinary power poles. Combined with the Electric Vehicles mod (the .16 one at least; haven't tried the latest) this allowed pretty good electric trains in 0.16 already. I think you could do the same here, only using your new power poles for near-continuous coverage making the batteries unnecessary?

You could potentially even add a pantograph to the train equipment grid for the power transfer.
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

leoch wrote: Mon Mar 11, 2019 3:23 pm The Induction Charging mod is able to charge player/vehicle equipment grids directly from ordinary power poles
If I understood the code of that mod correctly then no, it uses a hidden buffer as well: There is a "shadow" entity always teleported to the player's position that buffers energy to insert into the player's power armor grid.

Looking at that mod's code gave me an idea though.. It might not work at all, but if it does, it could "remove" the buffer or only use it if it's actually needed. I'm not sure, I need to think about that after I my last exam on wednesday.
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

Hey guys,
I've released another update!
I managed to get rid of the energy buffer in the poles, they'll now consume a tiny amount of power before they become activated and power locomotives.
Furthermore, this update adds the modular locomotive, an end-game variant that can be upgraded with modules to become way faster, or more efficient, whatever you need.

I'm looking forward to feedback and suggestions, especially regarding the balancing of the modules. Maybe the exact values need some tweaks to be viable.
Have fun!
Marcel40625
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jan 22, 2018 10:39 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by Marcel40625 »

Hey there,

is it just me, or is there no difference between the trains in terms of max speed and max health?
All 3 trains have 1000hp and drive around 170km/h with 3 loco and 8 waggons.

or have i done something wrong?
robot256
Filter Inserter
Filter Inserter
Posts: 874
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by robot256 »

Some wagons have much lower speed limits, and a train will never go faster than the slowest wagon in the train. Can you try it with just the locos? I definitely see a speed difference even with stock wagons attached.
Marcel40625
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jan 22, 2018 10:39 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by Marcel40625 »

even only the loco´s drive 174km/h ... https://img.fly-host.eu/jOD47

i must meantion, i changed the config a bit so the 3rd loco has more power but i dont think this has something todo with the max speed or?

Code: Select all

--config.lua

local ticks_per_update = settings.startup["ret-ticks-per-update"].value


function store(power)
	return power / 60 * (ticks_per_update + 5)
end

config = {
	pole_max_wire_distance = 16,

	pole_supply_area = 8,

	-- Refills the buffer until the next update
	pole_flow_limit = 4800000,
	-- Pole enable buffer (1kJ)
	pole_enable_buffer = 1000,
	-- Pole maximum deficit (9.6MJ)
	pole_max_deficit = 9600000,


	-- When a locomotive exceeds the soft cap, it might lose power temporarily 
	-- when multiple similar locomotives are powered by a single pole, e.g. when
	-- they pull the same train. (4.8MW)
	power_soft_cap = 4800000,
	-- When a locomotive exceeds the hard cap, it cannot be powered by the grid
	-- at all. (9.6MW)
	power_hard_cap = 9600000,



	-- Locomotive Mk 1 (600kW, like vanilla)
	locomotive_power = 600000,
	locomotive_storage = store(600000),
	-- Locomotive Mk 2 (1.2MW, two times vanilla)
	advanced_locomotive_power = 1200000,
	advanced_locomotive_storage = store(1200000),
	-- Modular Locomotive (1.8MW, three times vanilla)
	modular_locomotive_base_power = 2800000,
	modular_locomotive_storage = store(2800000)
}

function toW(value)
	return string.format("%dW", value)
end

function toJ(value)
	return string.format("%dJ", value)
end
robot256
Filter Inserter
Filter Inserter
Posts: 874
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by robot256 »

What version of the game are you running, and do you have any other mods installed? With just Vanilla + Realistic Electric Trains, the top speeds I have are 259, 311, and 373 km/h for the three tiers of locomotives (with no locomotive modules installed). If something is changing the air resistance or friction numbers, that could make the actual max speed lower.
Marcel40625
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jan 22, 2018 10:39 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by Marcel40625 »

running latest v.0.17, latest version of your mod (with changed config)

other Mods:
Image

edit: train tech is for infinite breaking force research
edit2: and im using normal waggons atm, not the stainless steel
EDIT3: okay nvm ... it was the train tunnels mod ... sorry for bothering you :)
User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 248
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by mrudat »

How about having overhead train signals?

You could have a power pole entity that has a single graphic for all rotations (and a single wire location), and have different graphics for the signal so that the indicator sits over the top of the rails?
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

I'd love to do that, but unfortunately, signals are hardcoded to be on a render layer below trains. Thus, unless everyone wants terrible graphical glitches, this won't work.
rcp27
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Wed Apr 26, 2017 3:34 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by rcp27 »

I’ve been looking for a realistic electric trains mod, specifically one that does overhead wires rather than batteries, and definitely will give this a go. Something I’d be interested in seeing that might be an interesting extension plan would be a cargo wagon with an equipment grid that can be powered from the electrified line. I can come up with lots of ideas for gameplay possibilities with this sort of thing, like laser defense wagons or personal roboport style construction wagons.
JAetherwing
Inserter
Inserter
Posts: 34
Joined: Sat Dec 29, 2018 2:51 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by JAetherwing »

Congratulations, you just guessed the topmost item of my todo list for this mod.
Unfortunately, I really don't have a lot of time at the moment, but I'll try to come back to this as soon as possible.
avek
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun May 05, 2019 1:13 pm
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by avek »

If you have time, could you please add support for Transport Group mod by Schallfalke?

All it does is a new separate tab for all vehicles and vehicle-related items (like rails). The change should be trivial, like using this at the start of items.lua:

Code: Select all

-- Add electric train subgroup
local train_group = "logistics"
if mods["SchallTransportGroup"] then
	train_group = "transport"
end

data:extend{{
	type = "item-subgroup",
	name = "electric-trains",
	group = train_group,
	order = "e-a"
}}

data:extend{{
	type = "item-subgroup",
	name = "electric-train-modules",
	group = train_group,
	order = "e-b"
}} 
Paul17041993
Inserter
Inserter
Posts: 36
Joined: Fri Nov 25, 2016 4:26 am
Contact:

Re: [MOD 0.16, 0.17] Realistic Electric Trains

Post by Paul17041993 »

BTW; there's still the PR pending that fixes the trains being broken in the current version;
https://github.com/Scarabytes/FactorioR ... ns/pull/15
Please be sure you've googled your question before asking me about code... :T
Post Reply

Return to “Mods”