The International Simutrans Forum

 

Author Topic: [Patch] Speed bonus has less effect the shorter the journey  (Read 4262 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
[Patch] Speed bonus has less effect the shorter the journey
« on: December 07, 2008, 02:29:50 PM »
This patch reduces the effect of the speed bonus (either positive or negative) on revenues the more local the journey. Below a certain distance (currently 16 tiles), it ignores the speed bonus entirely. Above a certain distance (256 tiles) it applies the speed bonus in the normal way. Between those two distances, it applies the speed bonus as a proportion of the difference between the lower and higher figure.

To compensate for any loss of revenue from using high speed bonus vehicles on short distance transport, there is also a local supplement to the speed bonus. This gives a certain fraction (0.75) of the speed bonus to all journeys of below the minimum distance (16 tiles) no matter what the vehicle, and a proportionate amount up to the maximum distance (256 tiles).

In this testing version, the values (16 tiles, 256 tiles, and 0.75 local supplement) are all hard coded. A final version ought have these values set in simuconf.tab. I have tested the patch, and it compiles, and does not cause Simutrans to crash.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] Speed bonus has less effect the shorter the journey
« Reply #1 on: December 07, 2008, 07:40:10 PM »
Update: I have now added code to enable the minimum distance (default: 16 tiles), the maximum distance (default 256 tiles) and the local bonus (default 75% - note that this is now a percentage) via Simuconf.tab, and I attach the relevant patch files, as well as a patch file for a sample simuconf.tab.

Note that, for some reason, I was unable to make a patch file from umgebung.h (Tortoise SVN came up with an error about inconsistent line endings), so I attach the complete file here for reference.

I have tested this patch: it does compile, it does not crash the game, and it does work as expected. I will undertake more extensive play testing for balancing when I have time, but that will involve re-doing speedbonus.tab first. I hope that this is helpful. Comments would be welcome.

Edit: It seems that I can only attach four files. Therefore, I have left out the simuconf.tab patch. Instead, here is the extra code that should go into simuconf.tab:

Code: [Select]
# Adjustment of speed bonus for local transport
min_bonus_max_distance = 16
max_bonus_min_distance = 256
local_bonus_multiplier_percent = 75

(Those numbers represent the default values. Balancing might indicate that different values are needed)
« Last Edit: December 07, 2008, 07:43:00 PM by jamespetts »

Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: [Patch] Speed bonus has less effect the shorter the journey
« Reply #2 on: December 07, 2008, 07:41:57 PM »
Please do not double post - edit your last post if less than 24hours have passed and nobody else replied in between. Thank you.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] Speed bonus has less effect the shorter the journey
« Reply #3 on: December 07, 2008, 07:43:19 PM »
Please do not double post - edit your last post if less than 24hours have passed and nobody else replied in between. Thank you.

Sorry.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: [Patch] Speed bonus has less effect the shorter the journey
« Reply #4 on: December 07, 2008, 08:15:42 PM »
you know, you can patch everything at once? Would make it a little easier for testers.

One comment: I think you are acting against the purpose of the speedbonus, which is making replacemnet of obsolete vehicle more neccessary. Why should it be ok to run hoerse carriages on short lines, but need the newest on longer lines?
« Last Edit: December 07, 2008, 08:21:05 PM by prissi »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: [Patch] Speed bonus has less effect the shorter the journey
« Reply #5 on: December 07, 2008, 08:54:05 PM »
Quote
you know, you can patch everything at once? Would make it a little easier for testers.

I did try to do this, but I couldn't get it to work. I looked at the Tortoise SVN documentation, but couldn't find the answer there, either. (The problem might have been connected to that header file not working properly - any idea what would have caused that? If I manage to get it working, I will re-upload the single patch file. Forgive me: I am rather new to SVN)

Quote
One comment: I think you are acting against the purpose of the speedbonus, which is making replacemnet of obsolete vehicle more neccessary. Why should it be ok to run hoerse carriages on short lines, but need the newest on longer lines?

Yes, I am aware of the issue in relation to obsolete vehicles on local lines. This would need another patch to increase the maintenance cost of obsolete vehicles (either, the simple way, multiplying the maintenance of all obsolete vehicles by a percentage read from simuconf.tab, or, the more complicated but, if feasible, better way, applying a sliding scale of increased maintenance costs for obsolete vehicles depending on how obsolete that they are, but I am not sure yet that there is an easy way in the code of discovering how obsolete that something is). I am currently looking into producing just such a patch now.

The reason that I think that this patch plus a patch to increase the maintenance cost of obsolete vehicles is preferable to the straightforward speed bonus system as it stands now is because, as discussed here, the consequence of the current system is insufficient incentive for players to differentiate between local and long-distance vehicles when setting up lines. It seems that the speed bonus has two functions: firstly, as you point out, to penalise truly obsolete vehicles, and secondly to incentivise the use of more powerful, faster, more comfortable vehicles (which usually have a higher maintenance cost, thus leading to interesting decisions as to which vehicles to use).

With this patch and increased maintenance costs of obsolete vehicles, the idea is to separate out those two functions, removing from the speed bonus the function of disincentivising obsolete vehicles, to be replaced by the increased maintenance costs, and instead, give the speed bonus the function of incentivising faster and (where applicable) more comfortable vehicles for long-distance travel. The player would then have just as much disincentive as now (or perhaps even more, depending on how the values are set) to use obsolete vehicles, but would also have an incentive, which the player does not currently have, to pick appropriate vehicles for local transport, since the vehicles balanced for local transport will tend to have a higher capacity and/or lower maintenance cost, but a lower top speed than those balanced for long distance transport. If the speed bonus is of little relevance for local transport, players will pick local vehicles based on capacity and cost, rather than speed, which both increases the number of interesting decisions that a player has to make, and also makes the game more realistic.

Finally, of course, if any player does not like this new code, it can easily be effectively disabled by setting the min_bonus_max_distance and max_bonus_min_distance to 0 in simuconf.tab.