Page 1 of 1

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

Posted: Thu Jun 01, 2017 7:16 pm
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

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

Posted: Thu Jun 01, 2017 7:25 pm
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.

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

Posted: Thu Jun 01, 2017 7:30 pm
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).

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

Posted: Thu Jun 01, 2017 8:39 pm
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.

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

Posted: Fri Jun 02, 2017 11:38 am
by kovarex
This is a game mechanics of all the burner-energy source based entities. The same thing was discarded for furnaces.