Patch: Improved Breakdowns v2.4 (r14563)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Patch: Improved Breakdowns v2.4 (r14563)

Post by Hirundo »

Breakdowns. For more than a decade they have been nothing but a source of annoyance for most players. Even with regular servicing, trains (and other vehicles) break down far too often, which inevitably results in major jams. Furthermore, all breakdowns have the same, unrealistic effect.

This patch aims to change all of this. As of version 2.0, it works for all types of vehicles. The patch has the following features:
  • Different types of breakdowns. Not all breakdowns are the same. Road vehicles, trains and ships suffer from these types of breakdowns:
    • Mechanical failure: The classic breakdown with black smoke. 10% chance. (Renamed from Critical to Mechanical failure, on YukonRob's suggestion. Thanks!)
    • Emergency stop: Someone pulled the emergency brakes. The train comes to a full stop, but it can quickly continue. This only happens to the front engine, with a 10% chance.
    • Lower maximum speed. As the name implies, the maximum speed is lowered. The lower the reliability, the lower the speed limit will be, although this is partially randomized. 30% chance.
    • Reduction in power. There is a 25% chance that power will be reduced by a percentage (10-90%, reliability-dependant) and a 25% chance that it is reduced to zero. Braking is unaffected. The effect is that the train simply has less HP than normal, or even no HP at all. Therefore trains accelerate more slowly or they even decelerate. A stopped train with 0% power won't move at all until the breakdown is over. Trains will not roll backwards down hills, though, as train drivers are smart enough to apply their brakes to avoid that :) (total chance: 50%)
    NB: The chance percentages listed here are for trains. For RVs and ships they are slightly different, see line 1065-1092 of the patch file.

    For aircraft the breakdowns are different. They have 3 types:
    • Reduction in speed, similar to the old breakdown but with a variable speed limit. 70% chance.
    • Forced service at the next airport. If the next airport does not have a hangar, go to the closest airport which has one. (20% chance)
    • 10% chance for an emergency landing, but only when the reliability is less than ~87%. In this case, the aircraft goes to the nearest airport (actually the nearest hangar) and attempts an emergency landing. There is a 2% chance that the aircraft will crash. To compensate, regular crash chance is decreased from 0,07% to 0,01%.
    Important note: If the aircraft can't find a hangar, it will crash. Fast planes will not try to land at small airports.
  • Full multiengine support for trains. Every engine in the consist can break down. This has some consequences for the GUI: The train details window now shows the average reliability and total number of breakdowns since last service. Per-engine information can be found in the information tab. (See picture below)
  • A rework of the original 'when to break down' algorithm. This means better randomization and a slightly reduced breakdown chance. This is shared by all vehicle types However, because breakdowns are no longer by definition a complete stop, their effects upon a (train) network are significantly reduced.
  • For trains, breakdown chance now depends on the load. An engine pulling a single car will break down less often than the same engine pulling a dozen cars. The breakdown chance of an aircraft is somewhat dependant on their maximum speed. To compensate for the fact that faster planes spend less time in the air, faster planes are more prone to breakdowns.
How to activate this patch:
Tick the box "Enable improved breakdowns" in the vehicles tab of Advanced settings. Realistic acceleration is no longer necessary, but recommended nonetheless.(Dev Note: Some parts, such as the breakdown chance algorithm and the GUI changes, cannot be switched off)

If anyone has a suggestion, bug report or anything else to say, please post. Since a patch like this can quite an impact on gameplay, feedback is very much appreciated.

Changelog
V1.1
- Fix: If without power, a train would not decelerate below 3 km/h.
- Fix: Trains would not break down at all with realistic acceleration disabled, if it had not been enabled before.
- Renamed 'Critical failure' to 'Mechanical failure' (Thanks, YukonRob! Me likes it :) )
- Clarified some stuff in the forum post. (in italic)

V2.0
- Feature: Support for all vehicle types.
- Feature: Realistic acceleration is no longer required
- Fix: Scrolling in the Information tab of the train details window did not work correctly.
- Other miscellaneous fixes and code changes
- Updated forum post to reflect all changes

V2.1
- Change: Non-front engines no longer have emergency stops. This should alleviate the problem of multiengine trains stopping too often somewhat.
- Fix: Reliability decreases for all train engines even if improved breakdowns are off.

V2.2
- Fix: Compatibility with previous versions was broken, causing stalled aircraft and incorrect breakdown chances.

V2.3
- Feature: Multiengine trains now have a reduced breakdown chance, depending on the number of engines
- Complete code check, resulting in many small improvements, changes and fixes.
- Win32 binary is now supplied. I used Tekky's language.patch, many thanks to him. (language updates are not included in the patch file itself, though)

V2.4
- Several small fixes by sbr (see flyspray)
- Fixed several minor issues, mostly regarding the behaviour when this patch is switched off.

EDIT: Flyspray task: http://bugs.openttd.org/task/2302
improved-breakdowns-v2.4-r14563.patch
Patch file
(58.04 KiB) Downloaded 1026 times
See this post for language.patch: http://www.tt-forums.net/viewtopic.php? ... 45#p741445
improved-breakdowns-2.4-win32.zip
Win32 binary
(2.91 MiB) Downloaded 866 times
Example screenshot
Example screenshot
Breakdowns.PNG (48.02 KiB) Viewed 37691 times
Last edited by Hirundo on 04 Nov 2008 20:03, edited 8 times in total.
Create your own NewGRF? Check out this tutorial!
User avatar
YukonRob
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 31 Jul 2007 00:58
Location: North of 63

Re: Patch: Improved Breakdowns (r14286)

Post by YukonRob »

Maybe 'Component' or 'Mechanical' vs Critical.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Improved Breakdowns (r14286)

Post by athanasios »

Me likes it!
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: Patch: Improved Breakdowns (r14286)

Post by Core Xii »

What exactly does 'reducing power to zero' mean? Isn't that the same as a classic breakdown?
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Patch: Improved Breakdowns (r14286)

Post by Eddi »

it means it's still rolling, but cannot accelerate (until the breakdown is over)

i'm not sure if that is really a good idea, because braking power is tied to accelerating power, so there's no way to stop the train without "magical brakes" in front of red signals
Jans
Engineer
Engineer
Posts: 32
Joined: 04 Sep 2008 12:25

Re: Patch: Improved Breakdowns (r14286)

Post by Jans »

The most trains have different brakes. Only high speed trains will quite have a problem.
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: Patch: Improved Breakdowns (r14286)

Post by zooks »

Swallow wrote:
A rework of the original 'when to break down' algorithm. This means better randomization and a slightly reduced breakdown chance. This is shared by all vehicles, so it applies to non-train vehicles as well.
how about "greatly reduced breakdown chance" :mrgreen:
That would make me play with breakdowns.
User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland

Re: Patch: Improved Breakdowns (r14286)

Post by Core Xii »

Eddi wrote:it means it's still rolling, but cannot accelerate (until the breakdown is over)

i'm not sure if that is really a good idea, because braking power is tied to accelerating power, so there's no way to stop the train without "magical brakes" in front of red signals
That's why I asked... If it means the train effectively cannot STOP... OMFG that would be catastrophic! :shock: Just imagine a heavy coal train climbing a hill with 3 other trains trailing behind it... BAM, breakdown! It slows down, and suddenly starts rolling backwards downhill! Hilarity ensues! :mrgreen:
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Patch: Improved Breakdowns (r14286)

Post by Zutty »

Cool! :D Is it only for trains?

What happens when a train loses all power? Does it roll until it comes to a stop or does it just keep moving at a very low speed? Do they roll back down hills?
PathZilla - A networking AI - Now with tram support.
AndiK
Engineer
Engineer
Posts: 53
Joined: 07 Dec 2004 18:34
Location: Grafing bei München (Munich)
Contact:

Re: Patch: Improved Breakdowns (r14286)

Post by AndiK »

Trains all over the world usually have an indirect pressure air brake that works even when the train loses all acceleration power. You'd even be able to release and reapply the brakes again until the air reservoir (if there is one) is empty. Anyway, there's always enough for the first braking procedure to stop the train.
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by Hirundo »

Update in first post.
Create your own NewGRF? Check out this tutorial!
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Patch: Improved Breakdowns (r14286)

Post by Eddi »

AndiK wrote:Trains all over the world usually have an indirect pressure air brake that works even when the train loses all acceleration power. You'd even be able to release and reapply the brakes again until the air reservoir (if there is one) is empty. Anyway, there's always enough for the first braking procedure to stop the train.
i was speaking about the game mechanics, not about real trains
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns (r14286)

Post by Hirundo »

Eddi wrote:
AndiK wrote:Trains all over the world usually have an indirect pressure air brake that works even when the train loses all acceleration power. You'd even be able to release and reapply the brakes again until the air reservoir (if there is one) is empty. Anyway, there's always enough for the first braking procedure to stop the train.
i was speaking about the game mechanics, not about real trains
Do not worry, the loss of power does not affect brakes. Acceleration and braking forces are indeed both tied to the power of the train, but the reduction is only applied when accelerating.
Create your own NewGRF? Check out this tutorial!
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1728
Joined: 30 Mar 2005 09:43

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by peter1138 »

Hmm, looks interesting, although I'm not too sure about the max speed being determined there. Are you able to move it else where so that it is called like the other train property functions, i.e. only when whatever it depends on changes?
He's like, some kind of OpenTTD developer.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: Improved Breakdowns (r14286)

Post by DaleStan »

Eddi wrote:
AndiK wrote:Trains all over the world usually have an indirect pressure air brake that works even when the train loses all acceleration power. You'd even be able to release and reapply the brakes again until the air reservoir (if there is one) is empty. Anyway, there's always enough for the first braking procedure to stop the train.
i was speaking about the game mechanics, not about real trains
Then the game mechanics are as broken as your shift key.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by Eddi »

My shift key is fine, it's just English capitalisation that I cannot get accustomed to.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by DaleStan »

What? Like the fact that we capitalize the first word of every sentence?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by Eddi »

Yes. Either do Capitalization of Words properly, or do not do Captialization at all.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by michael blunck »

Eddi wrote:[...]
Didn´t you propose to stick to orthography "rules" in that other thread?

regards
Michael
Image
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: Improved Breakdowns v1.1 (r14286)

Post by dihedral »

that was with regards to translations, not posting in a form

shift is an extra key to press and i too can hardly be damned to press that button unless i have no other choice!
as i also use an english keyboard layout, i cannot be damed to switch to german layout every time i need an umlaut, ae oe and ue are just 2 keys to press for that matter :)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest