Request: Clarify the formulas on Page Locomotive

Anything related to the content on our wiki (https://wiki.factorio.com/)

Moderator: Bilka

Post Reply
scooter010
Inserter
Inserter
Posts: 22
Joined: Tue Apr 30, 2019 6:09 am
Contact:

Request: Clarify the formulas on Page Locomotive

Post by scooter010 »

https://wiki.factorio.com/Locomotive wrote:train_speed = max(0, abs(train_speed) - train_friction_force ÷ train_weight)
train_speed = train_speed + (10 × number_of_locomotives_in_moving_direction × fuel_acceleration_bonus ÷ train_weight)
train_speed = train_speed × (1 - air_resistance_of_front_rolling_stock ÷ (train_weight ÷ 1000))
From the mathematical point of view, the formulas doesn't make sense. The same variable on both sides make no sense.

I'm pretty sure, that these formulas will be run on every tick to set the new value for train speed for each train, but thats not clear out of the wiki page.
The value for "air_resistance_of_rolling_stock" and "train_friction_force" aren't explained anywhere. E.g. does the summed up friction also uncludes additional friction for bends?

Bilka
Factorio Staff
Factorio Staff
Posts: 3127
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Request: Clarify the formulas on Page Locomotive

Post by Bilka »

scooter010 wrote:
Fri Jan 17, 2020 2:50 pm
From the mathematical point of view, the formulas doesn't make sense. The same variable on both sides make no sense.
It makes sense from a programming view:
https://en.wikipedia.org/wiki/Augmented_assignment wrote:x = x + 1

This means "find the number stored in the variable x, add 1 to it, and store the result of the addition in the variable x."
train_friction_force is explained on the page. I added a note on where to find air resistance and noted how the game does the calculations.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Wiki Talk”