User Tools

Site Tools


Sidebar



Minetest Forum
Content Database
Git Repository
Bug Tracker
Website

dev:proposals:fuel

This is an old revision of the document!


Table of Contents

Power

Fuel

Fuel is essential for any real train to run. However, Advtrains trains seem to run using some form of prepetual energy source. This is physically impossible in the real world.

To rememedy this problem, trains could run on fuel. In the real world, there are two main types of power sources: Electric and Combustible Fuel. Trains in Advtrains can work in any of three ways:

  • Electric Only
  • Combustible Fuel only
  • Hybrid

A train creator can specify the fuel type of the train with either fuel_type = “electric” or fuel_type = “combustible”. If this value is ommitted or invalid (which includes fuel_type = “hybrid”), the train is assumed to be hybrid.

If a train can run on electric, it checks the track below for a third rail, and if found, checks if it is electrified. If it is not, it comes to a rolling stop.

If a train can run on combustible fuel, it has a small inventory of fuel. The train will check the distance a given piece of fuel can give based of burntime times some factor (maybe 0.75) and then have this number multiplied by train efficency. A steam train might have an efficency of 0.3 whilst a diesel train has 0.7.

The train will drop “exhaust” onto the tracks for every 100 units of burntime. Exhaust can be turned to a lump of coal by using 9 exhaust for “exhaust powder”, using 9 exhaust powder for “exhaust powder block”, and using 9 exhaust powder blocks for 1 lump of coal.

If fuel of any train runs out, it will come to a rolling stop. The train will be unable to accelerate unless on a down ramp, in which case it will increase speed by 0.75 m/s for every block it falls. Brakes still function if neccesary. Once a train has stopped, it will report to chat the ID, position, and lack of fuel.

A third rail track will only be electrified if either:

  • advtrains.electricity_always_on = true in minetest.conf
  • A HV technic wire links to a “power station” connected to the track
  • A mesecons on wire is connected to the third rail and advtrains.allow_mesecons_power = true in minetest.conf

Third rail can only be powered for 250 metres. After this, the rail is unelectrified.

Multiple power sources (which are transmitting power) on the same stretch of third rail will cancel each other out and mean the third rail is unelectrified.

If a third rail does not terminate in a ramp, the electricity “runs” into the ground from the exposed edge and the third rail remains electrified.

Depending on a conf setting, people may be “electrocuted” within 10 m of an improperly-terminated third rai track (or their feet touch an electrified third rail). This only occurs if the player is not wearing insulating shoes (which can be defined in conf).

When a player is being electrified, their avatar becomes uncontrollable. They spasm in random directions, see red, and lose 2 hp per second. For every second spent being electrified, 4 random items in their inventory are cooked as if in a furnace.

If a stretch of track remains unelectrified for any reason shown above, it will report this reason with the location(s) which are causing the errors:

  • “POS, POS, and POS are power sources on the same third rail segment. Third rails are not electrified unless only one power source transmits power.”
  • “POS is an improperly terminated end for third rail. Place a ramp to terminate it properly (wear insulating shoes or you may be electrocuted).”

There are three new nodes for tracks:

  • Third rail ramp termination
  • Third rail
  • Two rail (standard)

For combustable fuel, for automatic refuelling, there is a refuel track. This track takes fuel from a below-track chest and moves as much as possible to the train.

The refuel track will automatically stop a train with space for fuel over it and transmit one stack of fuel every 2.5 seconds before sending it away with “SM” as an ATC command.

Maintenence

Note: If you are easily confused, don't read this section as i wrote it before my English improved

Trains do not run without problems. Tubes get blocked. Electric short-circuit, Power supplies break, and all forms of other things cause inconvinience.

What i propose is adding this to advtrains. Randomly, one of your rolling stock suddenly develops a problem and runs at 50-90% of its speed. To fix it, punch it with a repair tool, which leaves your inventory and makes the train work again at full speed. There is also a maintinince track, which works in the same way as a loading track but with repair tools.

For better identification, the coordinates of trains with problems can be found using a command and the broken trains make loud noises.


The following is taken from a reply to the email above.

  • How should the amount of fuel/electricity be calculated?
  • How should regenerative braking handle the situation with multiple (different) power sources (e.g. from the technic mod)?
  • In the case of refueling/recharging tracks, it should be possible for a train to wait until it is fully refueled or recharged.
  • The vehicle breakdown algorithm should take it into consideration that the maintenance tracks allow periodical maintenance of a train, which reduces the probability of a breakdown. This means that vehicles maintained more often should be less prone to vehicle breakdowns.
  • The quality of the maintenance (which corresponds to (e.g.) how much is checked for a train) should be considered. A primitive implementation could calculate this based on the time spent on the maintenance track (with a limit on the maintenance status).
dev/proposals/fuel.1673606485.txt.gz · Last modified: 2023-01-13 11:41 by 56independent