Railcraft

Railcraft

34M Downloads

Logging cause of death

purpleposeidon opened this issue ยท 3 comments

commented

Locomotives could record the times & locations of the following events, to be printed to the console, and perhaps available through an in-game mechanic, when a locomotive hits another locomotive, explodes, or runs out of fuel or water:

  • When it spawns
  • When it dies, what the cause was, and its direction/velocity of travel
  • When it is started/stopped
  • When the throttle is adjusted
  • When a player gets on/off the train
  • When the route is set (and what that route is)
  • When it is stopped at an unpowered locking track
  • When it passes over a powered locking track
  • When it passes over a switch track that is not actively switched
  • When it passes over a switch track that is actively switched
  • When it passes over a switch track in the returning direction
  • When it is deserialized
  • When it is serialized, before everything else (causing this event to be written to disk)
  • When it is serialized, after everything else (causing this event to NOT be written to disk. Well, not immediately.)
  • When it enters/leaves a signal block, the location of the signal lamp/relay, and the aspect of the signal block prior/after the train enters/leaves
  • When there is a coupling/decoupling, and the type of cart added
  • When it is refueled
  • When it enters a chunk
  • When it crosses a powered whistle track

I suggest storing the last N=10 events in addition to M=1 events of each type.

There's no need to give this information when a locomotive is destroyed by nominal means. Cacti, skeleton arrows, and other environmental hazards are a bit of an edge case; probably no logging needed in these cases.

This information should be logged to the console even if there's an in-game way of retrieving it. This stuff might be very helpful in tracking down bugs, maybe even those persistently annoying vanilla ones.

For making this information available in game, perhaps this: when a locomotive dies in a log-worthy way, it leaves behind a derailed locomotive corpse. (Gruesome! Shocking! NSFL!) Clicking on it with a magnifying glass & a blank unwritten book writes the logged information to the book. The locomotive might be salvageable for parts.

commented

It spans... Add it to debug?

commented

Love the idea of this.
A suggestion would be to extend it further ingame.
Placing a unwritten book in a slot in the locomotive could have it log it's travels without meeting it's demise.

commented

I agree this would be useful, not sure the feasibility of all the requested information though.