FS#2302 - Improved breakdowns

Attached to Project: OpenTTD
Opened by Swallow (Swallow) - Monday, 15 September 2008, 16:56 GMT
Last edited by andythenorth (andythenorth) - Wednesday, 16 August 2017, 11:20 GMT
Type Patch
Category Vehicles
Status Closed
Assigned To andythenorth (andythenorth)
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 22
  • Jacob Deuchar (JacobD88) (2013-10-24)
  • HMage (HMage) (2013-09-20)
  • Mark Hawrylak (Bolt) (2013-09-18)
  • A. Taylor (Leftie) (2013-09-04)
  • Milos (Milsa) (2013-07-06)
  • maz (mag103) (2012-04-01)
  • Marián Kyral (mkyral) (2012-03-19)
  • lugo (lugo) (2011-12-09)
  • NG (NG) (2011-09-20)
  • Ben (Sc00by22) (2011-08-05)
  • A Tejesember (Tejesember) (2011-02-18)
  • Angelo Locritani (alocritani) (2010-12-15)
  • Emisja (Emisja) (2010-09-13)
  • private_paula (private_paula) (2010-08-16)
  • Ed (muzzy) (2010-08-03)
  • Pereyaslov Konstantin (perk11) (2010-07-28)
  • Someone (eliberatorM) (2010-07-27)
  • Bigos (Bigos82) (2009-09-27)
  • Silviu G (kkmic) (2009-01-27)
  • Sébastien Brissaud (sbr) (2008-11-05)
  • Swallow (Swallow) (2008-10-14)
  • Jose Soler (Terkhen) (2008-10-09)
Private No


This patch improves breakdowns. It features different types and severities of breakdowns, multiengine support and load-dependant breakdown chance. Currently it is train-only. For more information see the forum post:

Patch is against r 14286
This task depends upon

Closed by  andythenorth (andythenorth)
Wednesday, 16 August 2017, 11:20 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Flyspray clean up: more than 5 years old, and not obvious what should be done with this next, so closing. If this offends, discuss with andythenorth in irc. Thanks.
Comment by Yorick (yorick) - Wednesday, 17 September 2008, 15:17 GMT
I notice a problem when you have, for example, 10 engines, the train breaks down 10 times as much, and every broken down engine is reported as if the whole train is broken. Also the emergency stops and mechanical failures happen 10 times as much.
Comment by Swallow (Swallow) - Tuesday, 30 September 2008, 20:25 GMT
Attached is the newest version of this patch

You have a valid point here I think. Originally my intention was that the breakdowns which affect multiengine trains less (low power) would balance the increase in emergency stops and mechanical failures. I have done some quick testing, and it seems trains with many engines are indeed stopping too much because of breakdowns. I think I will therefore change the behaviour of emergency stops, so they happen only to the front engine. This should alleviate the problem somewhat. I'm not sure though, as I need to do some more playtesting first.
Comment by Swallow (Swallow) - Wednesday, 01 October 2008, 18:49 GMT
The attached diff disables emergency stops for all train engines except the first one. This should significantly reduce the problem of multiengine trains stopping too often. It also fixes a bug; the reliability of non-front engines now properly decreases when improved breakdowns is off.
Comment by Swallow (Swallow) - Tuesday, 14 October 2008, 20:18 GMT
Let's keep this up to date a bit...

Attached is version 2.3
Comment by Swallow (Swallow) - Monday, 20 October 2008, 19:49 GMT
Fix some minor issues regarding disasters
Comment by Yorick (yorick) - Monday, 20 October 2008, 19:50 GMT
Comment by Swallow (Swallow) - Monday, 20 October 2008, 19:50 GMT
Damn, forgot to attach the file. This is beginning to look like an awfully long list of replies-to-self ;-)
Comment by Sébastien Brissaud (sbr) - Tuesday, 28 October 2008, 17:35 GMT

Attached is an updated version of this patch. Based in r14542 it includes some minor fixes:
- hack languages files: append " - {STRING1}" to STR_885C_BROKEN_DOWN. Clean fix should add a new entry for all type of broken states.
- add a 'default:' clause to the switch in the initialisation routine in AfterLoadGame().
- add a cast to uint64 when performing v->breakdown_chance in train_cmd.cpp.
- in vehicle.cpp a reduced breakdown chance is defined for multiheaded trains but isn't used. Use it to check vehicle breakdown.
Comment by Swallow (Swallow) - Tuesday, 04 November 2008, 20:07 GMT
Thanks for your update, especially the fix in vehicle.cpp which really affected functionality.
I implemented your changes and some other fixes in version 2.4, although I kept the language files in a separate patch, see the forum thread.

Comment by Sébastien Brissaud (sbr) - Sunday, 05 April 2009, 18:56 GMT
Updated patch to r15954. The only change made come from r15308 regarding km-ish/h -> mph conversions for 'low speed' breakdowns.
Fixed languages files are in the second patch.

EDIT: there is a typo in the patches names: s/19504/15954/
Comment by Bigos (Bigos82) - Friday, 25 September 2009, 23:30 GMT

Comment by Bigos (Bigos82) - Tuesday, 20 October 2009, 13:09 GMT
Comment by Bigos (Bigos82) - Friday, 23 October 2009, 23:11 GMT
Last 2 files had some errors... Now its should be ok.
Comment by maz (mag103) - Sunday, 01 April 2012, 12:18 GMT
This patch must be in the trunk in the future
Comment by Milos (Milsa) - Thursday, 29 August 2013, 23:04 GMT
Please add this patch to trunk.