[0.15.16] Locomotive loses power in the tick fuel runs out

Bugs that are actually features.
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

[0.15.16] Locomotive loses power in the tick fuel runs out

Post by TruePikachu »

I was just doing some testing with a long, straight section of track and a circuit-network-based timer, in order to determine the relationship between prototype configuration values and train speed (and ultimately arrive at a formula for train speed over time for any combo of locomotives and cars). I noticed that over my 1,016-rail-segment test track (I've confirmed this measurement), a singular rocket-fuel-filled locomotive would take either 1,473 or 1,474 ticks to run the length at full speed (298.1 kph). A later test with a wood-fueled locomotive, not even on the test track (just in the pre-acceleration loop), indicated that the speed would drop every time a piece of wood was consumed.

I haven't slowed down the game clock to test, but my theory as to what's happening is basically

Code: Select all

if (loco.wants_to_accelerate) {
  if (loco.has_fuel_in_bar) {
    loco.subtract_fuel_bar()
    loco.accelerate()
  } else {
    loco.consume_fuel()
  }
}
In other words, it seems like a locomotive will either apply tractive effort or consume a piece of fuel; it won't do both.

EDIT: in code, s/move/accelerate/g
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [0.15.16] Locomotive loses power in the tick fuel runs out

Post by Ranakastrasz »

Same issue as.... Uhm... That other issue where boilers produce no power on the tick fuel runs out.


I assume its the same for furnaces, and burner assemblers, and probably burner generator equipment.


Just don't make fuel that burns for less than 60 ticks, and the error is small enough that no-one should notice unless they MATH EVERYTHING.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: [0.15.16] Locomotive loses power in the tick fuel runs out

Post by TruePikachu »

I figured that was the case, but I thought that bug was fixed...?

If it hadn't been, this might indicate a bug in the base burner-power class, though I'm not sure how easy it would be to fix without breaking other things (if it was coded in a "sensible" fashion, it would theoretically be an easy fix, but sensible does not imply correct).
User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2179
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: [0.15.16] Locomotive loses power in the tick fuel runs out

Post by Ranakastrasz »

I thought they were seeing that as a minor bug not worth fixing. If they DID fix it then they either missed this part, or something else caused it.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.15.16] Locomotive loses power in the tick fuel runs out

Post by kovarex »

This is a game mechanics of all the burner-energy source based entities. The same thing was discarded for furnaces.
Post Reply

Return to “Not a bug”