Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Oct 23, 2017 11:37 am

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Mar 01, 2017 8:37 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 151
This patch is an attempt to simulate running costs for the parts of a train that do not specify any running cost.

It was suggested by me 4 years ago, that it was unfair for short trains to have the same running cost as that of a long train, when both are using the same engine model.

Download latest version (v6) here -> viewtopic.php?f=33&t=75982#p1193241
v6:
- increased the divisor range values from 0-64 to 0-255 to regain the granular fine-tunning which was lost with v5.
- reverted the formula back to v4 version, while still maintaining the desired effect of v5 for whenever the value is left as Auto, which is 2 times the value of max_train_length.

v4 formula:
final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / divisor

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.

v5:
- modified the formula slightly so that the default values are not so penalizing for very long trains which could make two trains with less wagons to be way too profitable than one train with the same number of wagons as those two trains together.
- moved the settings from under 'Vehicles' group to 'Accounting' group.
- now also refreshes train details/information tab window when the values of max_train_length are also altered.

v5 formula:
final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / (2 * divisor)

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.

v4:
- modified the formula so that the cost grows exponentially:

v4 formula:
final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / divisor

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.

v3:
- updated savegame version to resolve a conflict while patching against trunk r27778 and above.

v2:
1) Adds two game settings:
- an advanced setting for enabling or disabling this feature. Defaults to enabled.
- an expert setting for fine tunning this feature, with a divisor.

2) Savegame conversion for the two settings:
- treats it as disabled when loading from savegames without this feature.
- sets the divisor to auto when loading from savegames without this feature.
- stores the values regarding these two settings when loading from savegames generated by a build of this patch.

3) Displays running cost on the train detail information tab window, per part of the consist, for engines and wagons.


I believe my work is finalized with the release of v2. Though it fails to address the balancing issue at hand, I still like the added functionality it provides. It kept me motivated to finish this.

The formula is still very much the same as that of v1, but with the possibility to set a user defined variable, which I called of 'divisor'.
The divisor can be left at Auto, or a value from 1 to 64. When on Auto, it gets the value from max_train_length setting, which is the behaviour of v1.
A low divisor will increase the running cost, and a high divisor will lower the running cost.

v2 formula:
final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost / (2 * divisor);

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value, described above.
'final_cost' is the running cost of the entire train.

Screenshot valid for v3, v2:
Attachment:
Guntbourne Transport, 1951-01-20.png
Guntbourne Transport, 1951-01-20.png [ 99.18 KiB | Viewed 556 times ]


older versions (v2, v1)
[+] Spoiler
Attachment:


Attachment:

v1:
It's a work in progress. v1 is already functional, but the formula/equation that is currently in place to determine the total running cost of the entire train leaves a lot to be desired.

I am looking to improve it, or base it on something else, or a combination of other variables, to come up with a fair and balanced running cost for trains, for the vanilla set of vehicles OpenTTD includes by default.

v1 formula:
final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost / (2 * max_train_length);

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'max_train_length' is a game setting which defines the maximum length a train can be in the current game.
'final_cost' is the running cost of the entire train.

_________________
Formerly known as Samu


Last edited by xarick on Thu Oct 19, 2017 11:17 pm, edited 11 times in total.

Top
   
PostPosted: Fri Mar 03, 2017 10:32 am 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 151
I need to clarify why I believe the formula I came with, that is used on v1 leaves a lot to be desired:

a) you won't know the exact running cost of a single wagon unit during purchase, until you bring up the train details window and note that the running cost goes up each time a wagon is attached (EDIT: This was true for v1. With v2, you can find the running cost for each individual part under 'Information' tab, on the Train details window).

This information is obscure, as someone on IRC mentioned. It's not possible to display the running cost of a wagon on the purchase window, because it doesn't depend on itself, but on the train that is going to be attached to. Since it is unknown where the wagon is going to be attached before hand on the purchase window, I opted for not displaying the cost. All that you know is that the running cost will be in effect. It may end up misleading players.

It's also not possible to display a "running cost per wagon" on the train detail window as well, because some NewGRFs may actually specify a running cost for wagons. There are also NewGRFs that use varied wagon lengths. While vanilla wagons are always sized 0,5 tiles, these NewGRFs may actually use other sizes. EDIT: Actually, it was possible to display this, just managed to add it with v2.

b) it's not possible to balance vanilla trains by just nerfing them via running costs alone.

This was something I firmly believed 4 years ago, but today I can see that higher running costs alone isn't sufficient. The sheer amount of cargo that a single train can deliver greatly surpass those of ships and road vehicles.

Look at the following using this patch(v1, high running costs, medium construction costs, inflation off, default max_train_length):

Code:
                                          Capacity   Cost       Running Cost/yr    Speed
Kirby Paul Tank + Passenger Carriage * 13      520    £36,014    £2,373/yr       64 km/h
Chaney Jubilee  + Passenger Carriage * 13      520    £45,389    £5,695/yr      112 km/h
Ginzu A4        + Passenger Carriage * 13      520    £54,764    £6,644/yr      128 km/h
                       MPS Regal Bus * 17      527   £111,554   £10,863/yr       56 km/h
                       MPS Regal Bus * 34    1,054   £223,108   £21,726/yr       56 km/h


To match the passenger capacity of any of the 3 trains, I'd need about 17 buses.
And to match the delivery rate, specifically of Chaney Jubilee, which can go twice as fast as this bus model, I'd need about 34 buses.
Now look at the abysmal cost and running cost difference. And that is already with the patch applied. If I were to try to balance this by just the running cost formula, it would be very obtrusive in nature. I'd say the running costs would need to be at least 8-16 times higher than what they are, for this case scenario. This wouldn't be welcome. Imagine what infrastructure maintenance costs did for Airports, but for Trains. It would be similar.

_________________
Formerly known as Samu


Last edited by xarick on Sat Mar 04, 2017 7:44 pm, edited 2 times in total.

Top
   
PostPosted: Fri Mar 03, 2017 11:22 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Apr 24, 2004 10:43 am
Posts: 1967
Location: Venezia - Italia
I like the idea, but not how you want to implement it. Also it should be possible to disable for vanilla wagons, without touching the grf specified costs which should always be what the grf specifies.
Trains are a bit too cheap in early game, really.
But all you want to change is already possible with grfs, and if you don't like what a grf provides, you can make an addon/override.

xarick wrote:
I need to clarify why I believe the formula I came with, that is used on v1 leaves a lot to be desired:
a) you won't know the exact running cost of a single wagon unit, until you bring up the train details window and note that the running cost goes up each time a wagon is attached.

This information is obscure, as someone on IRC mentioned. It's not possible to display the running cost of a wagon on the purchase window, because it doesn't depend on itself, but on the train that is going to be attached to. Since it is unknown where the wagon is going to be attached before hand on the purchase window, I opted for not displaying the cost. All that you know is that the running cost will be there. It may end up misleading players.

Yup, it was me :P and I'm fine with what I said, this is the second point in order of importance so I don't like this change (see below how to resolve this).

Quote:
It's also not possible to display a "running cost per wagon" on the train detail window as well, because some NewGRFs may actually specify a running cost for wagons. There are also NewGRFs that use varied wagon lengths. While vanilla wagons are always sized 0,5 tiles, these NewGRFs may actually use other sizes.

And this is the first point in order of importance.
Wagons should calculate their own running costs with their own details, not consist details, so if you want to calculate with the length just use the single wagon length and sum the cost at every loop.
You can also put the formula in a function and use it in the UI to show the actual running cost for wagons which don't have it.
Not sure from where to take the base running cost? Start from the wagon purchase cost.
Try to keep it in line with the running cost factor (running cost / purchase cost) of the engines, I won't like to spend the same of replacing wagons every 4 years.

Quote:
b) it's not possible to balance vanilla trains by just nerfing them via running costs alone.

This was something I firmly believed 4 years ago, but today I can see that higher running costs alone isn't sufficient. The sheer amount of cargo that a single train can deliver greatly surpass those of ships and road vehicles.

Look at the following using this patch(v1, high running costs, medium construction costs, inflation off, default max_train_length):

Code:
                                          Capacity   Cost       Running Cost/yr    Speed
Kirby Paul Tank + Passenger Carriage * 13      520    £36,014    £2,373/yr       64 km/h
Chaney Jubilee  + Passenger Carriage * 13      520    £45,389    £5,695/yr      112 km/h
Ginzu A4        + Passenger Carriage * 13      520    £54,764    £6,644/yr      128 km/h
                       MPS Regal Bus * 17      527   £111,554   £10,863/yr       56 km/h
                       MPS Regal Bus * 34    1,054   £223,108   £21,726/yr       56 km/h


To match the passenger capacity of any of the 3 trains, I'd need about 17 buses.
And to match the delivery rate, specifically of Chaney Jubilee, which can go twice as fast as this bus model, I'd need about 34 buses.
Now look at the abysmal cost and running cost difference. And that is already with the patch applied. If I were to try to balance this by just the running cost formula, it would be very obtrusive in nature. I'd say the running costs would need to be at least 8-16 times higher than what they are, for this case scenario. This wouldn't be welcome. Imagine what infrastructure maintenance costs did for Airports, but for Trains. It would be similar.

This is because you are comparing apples with pears. Also you don't compare the cargo transported in a timespan but only the costs.
Trucks can be more effective than trains because of the reduced waiting time at stations, allowing for higher cargo throughput and better ratings. It's a total different way to transport cargo.

_________________
ImageImage
ImageImage
ImageImage
newgrf tests, see: newgrf test topic, my patches: Wolf01's Hire Point
Italian TTD Forum
Wiki Page


Top
   
PostPosted: Tue Mar 21, 2017 4:59 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 151
Attachment:

v3:
- updated savegame version to resolve a conflict while patching against trunk r27778 and above.

_________________
Formerly known as Samu


Top
   
PostPosted: Thu Oct 12, 2017 5:15 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 151
Attachment:

v4:
- modified the formula so that the cost grows exponentially:

final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / divisor

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.


Pricing table example (with high running costs, medium construction costs, inflation off, default max_train_length)
Code:
                                          Capacity   Cost    v4 Running Cost  1.7.1 Running Cost        Speed
Kirby Paul Tank + Passenger Carriage * 13      520    £36,014      £8,657/yr           £1,230/yr      64 km/h
Chaney Jubilee  + Passenger Carriage * 13      520    £45,389     £20,777/yr           £2,953/yr     112 km/h
Ginzu A4        + Passenger Carriage * 13      520    £54,764     £24,240/yr           £3,445/yr     128 km/h
'Dash'          + Passenger Carriage * 12      560    £45,023      £9,826/yr           £1,599/yr     120 km/h
Floss '47'      + Passenger Carriage * 13      520    £53,202     £22,508/yr           £3,199/yr     160 km/h
SH '40'         + Passenger Carriage * 13      520    £71,952     £30,423/yr           £4,324/yr     177 km/h
'T.I.M.'        + Passenger Carriage * 12      480    £85,648     £31,098/yr           £5,062/yr     241 km/h
'Millennium Z1' + Passenger Carriage * 12      590   £116,898     £31,098/yr           £5,062/yr     337 km/h
Lev3 'Pegasus'  + Passenger Carriage * 13      611   £153,202     £37,696/yr           £5,357/yr     482 km/h
Lev4 'Chimaera' + Passenger Carriage * 12      564   £171,585     £32,912/yr           £5,378/yr     643 km/h     
                       MPS Regal Bus * 17      527   £111,554     £10,863/yr                          56 km/h
                       MPS Regal Bus * 34    1,054   £223,108     £21,726/yr                          56 km/h
                Hereford Leopard Bus * 15      525   £114,840     £13,500/yr                          88 km/h
                Hereford Leopard Bus * 30    1,050   £229,680     £27,000/yr                          88 km/h
                          Foster Bus * 13      481   £106,639     £16,263/yr                         112 km/h
                          Foster Bus * 15      555   £123,045     £18,765/yr                         112 km/h
                          Foster Bus * 26      962   £213,278     £32,526/yr                         112 km/h
                Foster MkII Superbus * 15      600   £131,250     £25,305/yr                         127 km/h

_________________
Formerly known as Samu


Top
   
PostPosted: Thu Oct 19, 2017 10:32 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 151
Attachment:

v6:
- increased the divisor range values from 0-64 to 0-255 to regain the granular fine-tunning which was lost with v5.
- reverted the formula back to v4 version, while still maintaining the desired effect of v5 for whenever the value is left as Auto, which is 2 times the value of max_train_length.

final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / divisor

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.

Older versions (v5)
[+] Spoiler
Attachment:

v5:
- modified the formula slightly so that the default values are not so penalizing for very long trains which could make two trains with less wagons to be way too profitable than one train with the same number of wagons as those two trains together.
- moved the settings from under 'Vehicles' group to 'Accounting' group.
- now also refreshes train details/information tab window when the values of max_train_length are also altered.

final_cost = cost_at_this_point + cost_at_this_point * length_of_parts_without_cost^2 / (2 * divisor)

'cost_at_this_point' is the sum of running costs of the parts of the train that specify a running cost.
'length_of_parts_without_cost' is the sum of the length of the parts of the train that do not specify a running cost.
'divisor' as a user defined value.
'final_cost' is the running cost of the entire train.

_________________
Formerly known as Samu


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.