FS#2302 - Improved breakdowns

Attached to Project: OpenTTD
Opened by Swallow (Swallow) - Monday, 15 September 2008, 16:56 GMT
Type Patch
Category Vehicles
Status New
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 22
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

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.