Rivens Realistic Train Acceleration (based on cargo)


This mod makes train acceleration more realistic and depend on the amount of Cargo. (youtube demo included)

Tweaks
11 months ago
1.1
3.29K
Trains

g [closed] Locomotive acceleration power

2 years ago

Always wanted to have something like this mod in factorio, however, from my in-game testing it seems like this mod substitutes every locomotive's acceleration power (refered to as max_power in most files I looked at) with its locomotive pulling force. That makes any "more advanced" locomotives functionally no different to the basic one. This is something I think the mod would benefit greatly from improving. Is that within your scope?

2 years ago

I'm happy to look into it. Could you state which trains from which mods you are using so that I can test/tweak for your exact situation? Desired performance would be great to hear too, for me to have a reference.

2 years ago

I planned on using Battery-Electric Train (and maybe Better Train System) for a faster trains in the late game, for massive power consumption.
I came about this when I compared Battery-Electric Trains with the base locomotive, and there was no significant difference despite me slowly bumping the power of electric to 10 times the basic one. Then came the Better Train System ones which resulted in the same situation.
I feel like pointing out that while everything else is working splendidly, especially the functions that just multiply the weight of wagons themselves.

2 years ago

I planned on using Battery-Electric Train (and maybe Better Train System) for a faster trains in the late game, for massive power consumption (Considering that electric motors can achieve max torque even at 0 RPM).
I came about this when I compared Battery-Electric Trains with the base locomotive, and there was no significant difference despite me slowly bumping the power of electric to 10 times the basic one. Then came the Better Train System ones which resulted in the same situation.
I feel like pointing out that while everything else is working splendidly, especially the functions that just multiply the weight of wagons themselves.

2 years ago
(updated 2 years ago)

I currently make acceleration depend on the fuel's energy. Wood has 2MJ, coal 4MJ, solid fuel 12MJ, rocket fuel 100MJ, nuclear 1210MJ. You can see this increases on an exponential scale. When you take the log10(energy), we actually arrive at quite nice values, resp: 0.3, 0.6, 1.0, 2.0, 3.0. These are the values I used as acceleration multipliers per fuel type. The electric battery does not have significantly more energy, and thus does not yield more acceleration.

In physics, it makes zero sense to relate energy and acceleration: acceleration should be based on power. However, the locomotive.max_power prototype-value is not available at runtime, hence this workaround. I'll investigate if/how I can hoist the max_power propertype value to the runtime, so I can use that as yet another multiplier.

2 years ago

Do you want realism? I feel like a battery operated train would have higher acceleration from a stand still, but rather poor performance once the train gets going. They would be preliminary used for short hauls...? I just coded such behavior, but maybe it's not at all what you're looking for. If you could test v0.1.12 that would be great!

2 years ago

Love the idea, this is what I am looking for. v0.1.12 seemed completely broken, as in, no difference in acceleration between loaded and empty, electric and normal trains (unless I derped majorly). v0.1.13 seems to be working correctly, though. Great work.

2 years ago

v0.1.12 accidently had the line commented out that did... everything =D

2 years ago
(updated 2 years ago)

Hallo riven8192 ,
mich störte die Gleichmachung der Kraft einer Lokomotive auch sehr. So dass ich diesen Mod ausschaltete. Ich wollte für das erreichen von besseren Lokomotiven belohnt werden. Mit mehr Power. Das betrifft ja viele Mods die Lokomotiven bieten.
Könntest Du statt direkt die Power nur den Faktor gegenüber Vanille verwenden? Beispiel: so wie 1 = normal - 0.7 = editierbarer Beispielswert - 0.1 für sehr schwache Lokomotiven.
Das wäre echt toll. Wäre das auch in deinem Sinne Verso?

Hello riven8192,
I was also very bothered by the equalization of the power of a locomotive. So I turned this mod off. I wanted to be rewarded for getting better locomotives. With more power. This affects many mods that offer locomotives.
Instead of directly using the power, could you just use the factor against vanilla? Example: such as 1 = normal - 0.7 = editable example value - 0.1 for very weak locos.
That would be great. Would that also be in your sense Verso?

2 years ago

Ich meine damit, dass sich ein Faktor einfach obendrauf setzt. Also dass alle Lokomotiven einfach gegenüber Vanille um diesen Faktor schwächer sind, egal aus welchem Mod. So bleibt der ursprüngliche Mod-Power relativ erhalten.
Eventuell, kann man wählen zwischen direkter Powereingabe wie bisher, oder einer relativen Angabe - welche sich dafür einfach auf alle Lokolmotiven am Schluss der Berechnung darauf setzt.

What I mean by that is that one factor just adds itself. So that all locomotives are weaker by this factor compared to vanilla, no matter which mod. The original mod power is relatively preserved.
Possibly, you can choose between direct power input as before, or a relative specification - which is simply placed on all locomotive motifs at the end of the calculation.

2 years ago
(updated 2 years ago)

It's actually quite hard to find a balance. My mod radically changes train behavior, which impact a ton of mods that also adjust train behavior. The Factorio API does not allow me to retrieve all entity-prototype properties at runtime, as opposed to loading-time, like the 'max_power' property of a locomotive, so it's hard to figure out what mods intended to do, as most mods are kind of hacky in the way they achieve their results, which causes all kinds of oddities that effect other mods. There is no such 'factor' available for me to incorporate in the calculations. Maybe it's best to leave all non-vanilla locomotives behavior alone, as any tweak is bound to disappoint people. However, I pretty much have to change the weight of the cargo/fluid-wagons, for the vanilla trains to work, which by definition affects all train mods, regardless of whether I leave the locomotive untouched. It's a major pickle to get things right, and it simply may mean I have to disappoint a group of people, no matter what I do.

2 years ago

Ein paar Ideen,
Gibt es kein Event, der aufgerufen wird nachdem diese "Force" neu gesetzt wird? (-> dann könnte man dort den Faktor drauf tun - unabhängig von den abgeleiteten Mods)
Also kannst Du nicht die Eigenschaft "Max_Power" jeder Lokomotive bei ihrem Einsatz auslesen und dann mit dem Faktor darauf den Wert auf "Max_Power" zurückgeben?
Ist es schwierig das als letzter(Mod) diesen Faktor auszulesen?
Welche Eigenschaft überschreibst Du dann mit dem "Lokomotiv pulling Force". Wird dieser Wert nicht auf die einzelne Lokomotive-Klasse(Vanilla) gesetzt, sondern auf eine Basis Klasse?
Wie machst Du es mit den Frachtschiffen. Mir scheint so, dass der Force auch bei Ihnen wirkt -> darum die Frage nach der Basisklasse wo Du anwendest.
Ich bin C# Programmierer, vielleicht sollte ich mal in Lua Einblick nehmen und auch Mods basteln :-)

2 years ago

Ik zou het enorm waarderen als je je tot het Engels zou beperken. Dank je.

2 years ago
(updated 2 years ago)

I see an old Mod Interface Request (possibly written by riven) asking to be able to change locomotive power and braking force at runtime, which was rejected.

A new interface request asking only for the read-only prototype values to be made available is more likely to be accepted. I too would like to make handling modded locomotives possible!

New response