Range for locomotives

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Range for locomotives

Post by Wahazar »

I suggest to add limited range feature to trains. This feature already exist for air planes and can be defined via newgrf.
The only difference is, that in case of station out of range, train would be not stalled but just limited speed penalty will be applied.
We can assume, that water/fuel is a range limiter, and because locomotives can be watered/refuelled on stations, range can be counted as MD from given station to the next one or depot.

The reason why such feature is needed, is a game balance.
Original steam trains have same length and no tenders.
Newgrfs based on real world trains have issue with overpowered tank locomotives.
Why use long locomotives, if short ones allow to attach one more car.
Another issue is infrastructure payment - why pay for more expensive electrified tracks if diesels can be used.
Limited range is an answer.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: Range for locomotives

Post by supermop »

McZapkie wrote:Another issue is infrastructure payment - why pay for more expensive electrified tracks if diesels can be used.
Interesting idea, that I've long pondered ways to address. Conceivably could also work by increasing running costs for time or distance past end of range, but that would be somewhat obscure to the player. I've considered this for RVs as a way to further nuance the difference between regular and electric buses etc. Range also then makes super-capacitor and flywheel buses interesting.
McZapkie wrote:Original steam trains have same length and no tenders.
Newgrfs based on real world trains have issue with overpowered tank locomotives.
Why use long locomotives, if short ones allow to attach one more car.
This is more a feature to throw some meat to rivet counters, but conceivably player could select what tender to buy with some freedom, longer and greater range or compact for denser train. Also would allow for the occasional diesel tender for very long routes.
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Range for locomotives

Post by acs121 »

I'll have to assume it's one good idea if using sets like 2cc Trains in NML. Often i use the first electrics, i don't even taste the first diesels (or do i...?)
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Range for locomotives

Post by michael blunck »

McZapkie wrote: I suggest to add limited range feature to trains [...] in case of station out of range, train would be not stalled but just limited speed penalty will be applied. [...] The reason why such feature is needed, is a game balance.
Problem would be how to calculate "range". Since we only have access to MD this would usually be inadequate in comparison to the real route taken.

Since there´s already prop02 (reliability decay speed) for vehicles, this could be used in connection with breakdown incidence. BTW, me wonders why this one isn´t available also with CB36 (change vehicle properties).


On another note, there are some more vars in TTD´s vehicle structure which could be (mis-)used for range calculation (might be problematic with OTTD´s larger maps):

Code: Select all

.target: 	resw 1	// 0eh: current target coordinates
.XY: 	    resw 1	// 26h: index into landscape array
One could also check reliability against traveltime or cargo transit time, considering the date of last maintenance:

Code: Select all

.cargotransittime: resb 1	// 3fh: number of days in transit from source
.reliability:   	resw 1	// 4eh: reliability (65535=100%)
.traveltime:  	  resw 1	// 70h: number of days travelling since last load/unload
92		           W	     // Date of last maintenance
and thus react accordingly in case a certain limit is exceeded.

regards
Michael
Image
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Range for locomotives

Post by Wahazar »

I was considering using reliability decay itself as a range limiter, unfortunately:
1. maximal reliability is highly randomised,
2. reliability is decreasing upon time, not distance (assume that idle fuel consumption can be neglected),
3. people often switch off breakdowns.
Additionally, there is no information about reliability decay rate in purchase window/sorting.

I'm aware that for vehicles other than plane, MD gives different values than a real vehicle path which is unpredictable, therefore in original post I suggested, that such vehicle should not be stalled like plane, but velocity/power penalty should be applied (if water/fuel is low, you don't put valve/pedal to the metal).
If MD between next station/depot is larger than range, there should be just warning in order list.
Is it possible to calculate actual range using motion_counter?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: Range for locomotives

Post by supermop »

McZapkie wrote:3. people often switch off breakdowns.
I've long felt that if breakdowns behaved more interestingly I would turn them on, so don't discount that possibility.

One thing I've always sort of wished for is splitting running cost into a few parts, like labor, mechanical upkeep, fuel, and some other token overhead amount, and then opening those parts up to be varied by GS or Newgrf. This might give a chance to balance for example diesels vs electric in interesting ways that scale differently. To simulate range, one could just start increasing the fuel cost beyond a certain point.
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Range for locomotives

Post by acs121 »

McZapkie wrote:3. people often switch off breakdowns.
Breakdowns are, like company buying, something that shouldn't even exist in OpenTTD. Maybe i exagerate a bit, but when using trains from map center (a.k.a the hugest town.s) to another big town at the other map end, you don't want to have 1356765123567887653 breakdowns between the two stops.

Please note i don't always use Vacuum Tubes. Starting in 1830, i start to build the highspeed line in 1910 and finish it in 1930, when the Schienenzeppelin (2cc Trains in NML) going at the fabulous speed of 230 kph is released. Using the Flo-Set (thx Flogeza, you're great), from 2007 onwards i use the TGV V150 (577 kph) - Vacuum Tube is reached in 2027 only.
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Range for locomotives

Post by Erato »

supermop wrote:One thing I've always sort of wished for is splitting running cost into a few parts, like labor, mechanical upkeep, fuel, and some other token overhead amount, and then opening those parts up to be varied by GS or Newgrf. This might give a chance to balance for example diesels vs electric in interesting ways that scale differently. To simulate range, one could just start increasing the fuel cost beyond a certain point.
1) What's GS?
2) Yeah but in the end, most things like labour, mechanical upkeep and fuel are things that are slowly accumulated, so we wouldn't really need a new system for that.

Increasing running costs are an interesting idea for simulating range, but I think having the power decrease would be a better idea, because that's not a problem money can solve. It's also a bit more realistic, as you can imagine that the train will eventually run more slowly to preserve energy. (or that people have to get out & push :P)
IIRC the slowest a moving train can/has to go is 2kmh, but I'm not sure and at this speed "it will cause major problems if you don't deal with it by, for instance, building a refuelling station, however that would work.

It's also important that there will be a parameter so players who play on larger maps won't be penalised significantly more than players on smaller maps.
No pics no clicks. Seriously.
ImageImageImageImageImageImage
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Range for locomotives

Post by Leanden »

GS is Game Scripts :)
Image
User avatar
supermop
Tycoon
Tycoon
Posts: 1104
Joined: 21 Feb 2010 00:15
Location: Fitzroy North - 96

Re: Range for locomotives

Post by supermop »

Erato wrote:2) Yeah but in the end, most things like labour, mechanical upkeep and fuel are things that are slowly accumulated, so we wouldn't really need a new system for that.
The idea with breaking the running cost apart is that certain parts could vary independently of one another. So you could think of things like, 'the fuel portion of the running cost increases drastically but the labor is the same for now', so those circumstances affect a steam train more than an electric one. One could also then possibly increase labor costs over time relative to mechanical costs, so that simple steam engine that has 3 men on the footplate is cheaper to run than the equivalent diesel in 1930, but much more expensive to run in 1960.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Range for locomotives

Post by michael blunck »

McZapkie wrote: Is it possible to calculate actual range using motion_counter?
Not really, since this is a 32 bit var. Starting from 0 when a new bought vehicle begins its first voyage and running up to 4,294,967,295. Then starting again from 0. I.e., it is never reset between, e.g. during a depot visit. (not to mention problems with cached values)
supermop wrote: The idea with breaking the running cost apart is that certain parts could vary independently of one another.
Anyway, in the end all those costs are being added.

regards
Michael
Image
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Range for locomotives

Post by Wahazar »

michael blunck wrote: Is it possible to calculate actual range using motion_counter?
Not really, since this is a 32 bit var. Starting from 0 when a new bought vehicle begins its first voyage and running up to 4,294,967,295. Then starting again from 0. I.e., it is never reset between, e.g. during a depot visit. (not to mention problems with cached values)
[/quote]
Let me distinguish two approaches:
1. vehicle range implemented as patch
2. vehicle range implemented using existing grf CBs and vars.
If I understand correctly, your comments concerning motion_counter are related with second approach?

I would rather prefer native patch, similar to existing range for airplanes, otherwise no range sorting would be supported.
So the question is, can be motion_counter used by vehicle range patch (or more precisely, is it possible to reset it when station/depot is visited, without breaking other stuff? Is anybody using its absolute value or just increments for animations?)
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Range for locomotives

Post by Gwyd »

I've been thinking about how this could be done via NewGRF, but I doubt it would work, at all.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Range for locomotives

Post by michael blunck »

McZapkie wrote: If I understand correctly, your comments concerning motion_counter are related with second approach?
Yes
McZapkie wrote: So the question is, can be motion_counter used by vehicle range patch (or more precisely, is it possible to reset it when station/depot is visited, without breaking other stuff? Is anybody using its absolute value or just increments for animations?)
It is usually read by train sets for locomotive rod animation. Incrementally, by using some of the counter´s bits.

regards
Michael
Image
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Range for locomotives

Post by Wahazar »

michael blunck wrote: It is usually read by train sets for locomotive rod animation. Incrementally, by using some of the counter´s bits.
I know, and in such case it doesn't matter if this counter is being reset after overflow or after any station/depo visit. I was curious, if it is used to calculate train (mile)age?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Range for locomotives

Post by michael blunck »

McZapkie wrote: in such case it doesn't matter if this counter is being reset after overflow or after any station/depo visit.
Yeah I think so too. Probably only a very minimal graphics "glitch" in the depot window when being reset to zero. BTW, "overflow" of that var won´t happen in any serious game.
McZapkie wrote: I was curious, if it is used to calculate train (mile)age?
Not that I know of. Indeed, I was unable to find any reference of it in the sources.

regards
Michael
Image
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 6 guests