NML - Changing cargo amount in a vehicle

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Bad_Brett
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 01 Feb 2007 17:59
Location: Stockholm, Sweden

NML - Changing cargo amount in a vehicle

Post by Bad_Brett »

I'm pretty sure what I want to do isn't possible at the moment, but anyway...

Even though coal was much more efficient, american steam locomotives often used wood burners because coal was hard to come by. So my idea was to actually make this a part of the gameplay.

By default, early steam locomotives will use wood and water as fuel, but I want to make the player to be able to refit them to use coal (and later oil) as fuel instead. However, my idea is to create some kind of trade-off, such as:

Wood burner:
+ Only water is needed as fuel
+ Low running cost
- Lower speed
- Less power

Coal/oil burner:
+ Better speed
+ Better power
- Higher running cost
- Will suffer from reduced reliability and speed/power reduction if it runs out of fuel

So my idea was something like this:

- Locomotives can be refitted to carry a certain fuel, such as coal
- Fuel will eventually be consumed
- Stations and waypoints will serve as water towers
- The player will need to deliver Coal/oil to stations in order to keep the engine fueled
- Fuel should not be unloaded at stations, even if the station accept the cargo

Since there isn't a callback that let me control the amount of cargo and since I don't think any callbacks fire when you pass a waypoint, I guess this idea is not possible to implement (at the moment). But, I still wanted to check with you guys if you have any suggestions or ideas on how I can accomplish something similar? Perhaps I can change the cargo capacity instead of the amount of cargo and turn it back up when the locomotive arrives at a station?

Thanks in advance! :)

User avatar
2TallTyler
Engineer
Engineer
Posts: 120
Joined: 11 Aug 2019 18:15
Contact:

Re: NML - Changing cargo amount in a vehicle

Post by 2TallTyler »

Bad_Brett wrote:
26 Jul 2020 04:17
I'm pretty sure what I want to do isn't possible at the moment, but anyway...
I suspect you’re correct. OpenTTD isn’t designed to simulate this, and even if it were available I suspect many players would opt-out of having to build fuel distribution networks for every line.

This is a very small part of what you propose, but if you want to simulate frequent water stops you could set a high reliability decays requiring frequent trips to a depot to avoid breakdowns. But this doesn’t play well with OpenTTD world scaling where sometimes a map represents a single a city and sometimes that same map size is an entire continent. And depots don’t look anything like water towers.

You may be best off creating waypoints (or station tiles) which resemble water towers and scheduling trains to stop at them, putting the mechanics into the realm of imagination rather than a game which isn’t really designed for them. :)

mak
Engineer
Engineer
Posts: 116
Joined: 30 Sep 2015 13:16

Re: NML - Changing cargo amount in a vehicle

Post by mak »

Water Towers.... New GRF: DWE-Station Tiles- Industrial Te. :wink:

Bad_Brett
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 01 Feb 2007 17:59
Location: Stockholm, Sweden

Re: NML - Changing cargo amount in a vehicle

Post by Bad_Brett »

2TallTyler wrote:
26 Jul 2020 05:01
Bad_Brett wrote:
26 Jul 2020 04:17
I'm pretty sure what I want to do isn't possible at the moment, but anyway...
I suspect you’re correct. OpenTTD isn’t designed to simulate this, and even if it were available I suspect many players would opt-out of having to build fuel distribution networks for every line.

This is a very small part of what you propose, but if you want to simulate frequent water stops you could set a high reliability decays requiring frequent trips to a depot to avoid breakdowns. But this doesn’t play well with OpenTTD world scaling where sometimes a map represents a single a city and sometimes that same map size is an entire continent. And depots don’t look anything like water towers.

You may be best off creating waypoints (or station tiles) which resemble water towers and scheduling trains to stop at them, putting the mechanics into the realm of imagination rather than a game which isn’t really designed for them. :)
My idea was rather that wood should be used by default and that coal burners would be a rare thing to see. And it would encourage players to actually create networks and utilize more different vehicles.

Yeah, I think waypoints that just look like water towers will do. 😊

A more simple solution would be to make the running cost depend on the current coal price. Is there any way I can access the current cargo payment rates from a vehicle? I think that would be a nice variable to have.

User avatar
jfs
Tycoon
Tycoon
Posts: 1227
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: NML - Changing cargo amount in a vehicle

Post by jfs »

No you can't query the cargo payment rates from a vehicle. However the cargo payment rates are constant anyway, the only change as part of the inflation rate, if that feature is enabled.

LaChupacabra
Engineer
Engineer
Posts: 101
Joined: 08 Nov 2019 23:54

Re: NML - Changing cargo amount in a vehicle

Post by LaChupacabra »

Bad_Brett wrote:
26 Jul 2020 12:27
(...) it would encourage players to actually create networks and utilize more different vehicles.
It would be rather extortion, or even robbery. It would act like some mafia: "You have to deliver the fuel to the station, otherwise we will finish you... Your trains will start to break and you will lose all your money." :twisted:

Anyway I have some idea ... a bit twisted, but the effect would be pretty close. :)
  • Next to each station would be built a enterprise to supply the trains with fuel (it would be coal, water or whatever, but it would not be the same "coal" - only locomotives would accept it).
  • At the same time, these enterprises would accept the same cargo.
  • The train would load it at one station and unload it at the next, receiving a small fee for it, which would offset the high maintenance costs of locomotives.
  • The production of these enterprises would be limited
  • A train that does not load "fuel" still can go to the next station without any disturb, but the cost of the journey will be much higher, the higher the longer the route without fuel
  • Enterprises supplying fuel to stations could be supplied with appropriate raw materials that would increase productions of this enterprises.
  • Supplying the stations with fuel would be especially important at stations with more traffic and those from which trains depart for longer journeys.
  • It wouldn't be necessary for the player to supply each station, as those with less traffic would supply themselves. However, there would be a need to supply these main stations, especially those operated by fuel-consuming locomotives (high fuel capacity, high costs)
The disadvantages of this solution are the lack of range effect and payment on each stop which could be confusing. The second disadvantage could be solved by adding one more load: "costs" ("crew"?), Which would have negative transport rates and would offset the profit from transporting fuel - if there was not enough fuel, then when the train stopped at the station the cost would be visible . "Costs" would be produced by the same enterprises in always sufficient quantities.

Either way, there would be a useful mechanism for the decay of the load during transport, which would use, for example, a speed parameter + some multiplier. Failure would be the result of losing all load. The element of "fuel" not only for trains, but also for other vehicles could be an interesting alternative to ordinary breakdowns. :)
I am sorry for may English. I know is bed.

Bad_Brett
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 01 Feb 2007 17:59
Location: Stockholm, Sweden

Re: NML - Changing cargo amount in a vehicle

Post by Bad_Brett »

LaChupacabra wrote:
26 Jul 2020 17:47
Anyway I have some idea ... a bit twisted, but the effect would be pretty close. :)
  • Next to each station would be built a enterprise to supply the trains with fuel (it would be coal, water or whatever, but it would not be the same "coal" - only locomotives would accept it).
  • At the same time, these enterprises would accept the same cargo.
  • The train would load it at one station and unload it at the next, receiving a small fee for it, which would offset the high maintenance costs of locomotives.
  • The production of these enterprises would be limited
  • A train that does not load "fuel" still can go to the next station without any disturb, but the cost of the journey will be much higher, the higher the longer the route without fuel
  • Enterprises supplying fuel to stations could be supplied with appropriate raw materials that would increase productions of this enterprises.
  • Supplying the stations with fuel would be especially important at stations with more traffic and those from which trains depart for longer journeys.
  • It wouldn't be necessary for the player to supply each station, as those with less traffic would supply themselves. However, there would be a need to supply these main stations, especially those operated by fuel-consuming locomotives (high fuel capacity, high costs)
The disadvantages of this solution are the lack of range effect and payment on each stop which could be confusing. The second disadvantage could be solved by adding one more load: "costs" ("crew"?), Which would have negative transport rates and would offset the profit from transporting fuel - if there was not enough fuel, then when the train stopped at the station the cost would be visible . "Costs" would be produced by the same enterprises in always sufficient quantities.
That's actually not a bad idea. I'm definitely going to try this and see how it works out. :)
LaChupacabra wrote:
26 Jul 2020 17:47
Either way, there would be a useful mechanism for the decay of the load during transport, which would use, for example, a speed parameter + some multiplier. Failure would be the result of losing all load. The element of "fuel" not only for trains, but also for other vehicles could be an interesting alternative to ordinary breakdowns. :)
Yeah, I think it could lead to some interesting choices, such as:
- You CAN carry diamonds in a regular box car, but there's a small chance that train robbers will steal some the cargo
- You CAN carry oil in 75 year old tank car, but there's a small chance that it will leak and that you will lose some of the cargo
- You CAN carry food in an unrefrigerated car, but there's a chance that some of it will go to waste

To be fair, one could argue is that this mechanism already exists (in an abstract way) by lower profit and higher running costs. But I'm sure you could this callback could be used in tons of other ways that I haven't thought of. :)

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests