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

User avatar
Vaulter
Traffic Manager
Traffic Manager
Posts: 185
Joined: 21 Dec 2004 05:35
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Contact:

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by Vaulter » 30 Jul 2013 23:09

maybe i've tested it poorly but
trains just doesn't break at all.
all settings are in place.

KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by KeldorKatarn » 13 Jan 2014 07:46

Please note that any daylength patch might cause the breakdowns to happen a lot less, since the breakdown is only handled PER DAY,
Maybe that's the issue.

McZapkie
Tycoon
Tycoon
Posts: 1176
Joined: 18 Jan 2014 18:10

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by McZapkie » 19 Jan 2014 12:39

At the beginning, I would like to welcome all and congratulate the authors of this patch.
Most of players has "Breakdown vehicles" option switched off until now.

I like idea of this patch, because it fits with my idea of diversification of reliability_decay parameter of particular vehicles.

By now, in most vehicle set, AFAIK, this parameter is set to default 20.
We have plenty of vehicles now, sometimes with virtually no difference of power, speed, costs.

But let us treat reliability_decay parameter to make distinction between, let say, for example, tank locomotive and tender locomotive.
Because time ticks in the game are rather abstract concept of time, let treat visit in the shed not only like plain repair, but more generally asservicing
- including need to water/coal/fuel refilling.
In this terms, tank engine with higher reliability_decay (let say 25) have just smaller range than bigger tender locomotive (for example 15) ,
but should cost less, in comparison to long range locomotive with similar traction parameters.

This idea should work fine especially with this Improved Breakdowns patch, where most of a breakdowns are power loss etc, not a critical mechanical breakdown.

Just imagine, small tank engine with heavy train travelling so far without visit in shed - coal and water is almost exhausted, so they must travel at reduced power speed. If you want to use cheap tank locomotive, use it as it should be used - for local/light trains. Or build additional sheds. Or just buy the better and expensive one.
More diversification - more fun with decisive process.

Diesel locomotives of course should have much higher range (lower reliability_decay 8...15) than steam locomotives, thus some sheds are obsolete.
Lowest reliability_decay, ~5 (but high purchase and running cost *) belong to electric locomotives - no need to visit in shed for fuel refilling, only for preventive inspection/repairs. But you need to pay for converting railroad to electrified one.

Once more - I mean high reliability_decay not in terms of fast mechanical degradation, but in terms of efficient moving range without need of servicing in shed.

There is small flaw of above approach is, that purchase and running cost modification balance should be inactive, if the game settings "Vehicle Breakdowns" is turned off.
By now, i included manual switch in my experimental set, to switch off/on the cost to performance ratio modificator,
but I have a simply question:
is it possible to get value of "Vehicle Breakdowns" setting at the GRF level?
Sorry for naive question, I'm a beginner in GRF coding.

Regards,
Maciej.

*)real electric locomotives are not as much cost efficient as people think, they energy efficiency itself is high, but including efficiency of energy production and transfer and adding traction maintenance cost, there is nothing ridiculous in increased running cost of electric - balanced in low reliability drop.
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension, V4 CEE train set.
Addicted to freeciv longturn.

User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by skippern » 19 Jan 2014 22:27

I really like the idea of this patch, but have not been able to test it in any way

I hope this will be part of Trunk, as the current breakdowns are not much fun to play with.

Also idea, for ship breakdown, there could be a minusculous chance that a breakdown results in catastrophic event (loss of cargo, loss of ship), with loss of cargo the vessel jetisons the cargo, or for other reasons cargo is lost, but the ship is saved and arrives at destination empty (maybe need to visit depot first before loading?), loss of ship is exactly that, and could result in debri (ship wrack, wrack debri) left where the ship was lost. This debri can potentially block passage of other vessels, but should be removable.
Skippern
OpenTTD Mac user

mtm2207946034
Engineer
Engineer
Posts: 14
Joined: 30 Mar 2015 20:04

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by mtm2207946034 » 04 Apr 2015 21:17

It's a long time since the patch has been updated. There have been several changes in trunk.

I have updated the patch and tested it. To my knowledge the patch behaves like before.
Attachments
ImprovedBreakdowns-v2.5.3-r27210.patch
Patch updated to current trunk (about release 1.5.0).

Warning: The patch breaks savegame compatibility. Savegames with the patch cannot be loaded by normal releases.
(61.81 KiB) Downloaded 45 times

mtm2207946034
Engineer
Engineer
Posts: 14
Joined: 30 Mar 2015 20:04

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by mtm2207946034 » 22 Aug 2015 01:59

Due to an error (crash reported in http://www.tt-forums.net/viewtopic.php?f=33&t=73469: found and solved by JGR), I updated the patch:
Attachments
ImprovedBreakdowns-v2.5.4-r27389.patch
Error solved and patch updated to current trunk (r27389)
(61.48 KiB) Downloaded 49 times

User avatar
JGR
Tycoon
Tycoon
Posts: 1973
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by JGR » 11 Sep 2015 22:17

Fairly minor this time, but I found another issue. Power and speed reduction breakdowns leave smoke effects which persist for an excessively long and random time after the vehicle has gone, because the animation counter is not initialised, and the smoke is only shown at all for 1 in 32 power/speed reduction breakdowns. Also the NewGRF engine flag EF_NO_BREAKDOWN_SMOKE is ignored.
Possible fixes are at here and here.
Sorry for heaping bug reports on you, and thanks for your work on this patch.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

User avatar
JGR
Tycoon
Tycoon
Posts: 1973
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by JGR » 27 Sep 2015 23:12

I've been doing a bit of testing/debugging and it seems that this patch is not multiplayer-safe.
breakdown_chance is updated in a non-deterministic way which can make a server un-joinable if it pauses waiting for clients at the wrong moment. A possible fix is here.
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github
Dad-Coder since April 2018

mtm2207946034
Engineer
Engineer
Posts: 14
Joined: 30 Mar 2015 20:04

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by mtm2207946034 » 26 Nov 2015 13:58

Thanks JGR for submitting the fixes. I detected the persisting smoke long ago - but I never got deep down into the code to solve this issue.
It took me some time to understand your changes about the desyncs. As I reconstructed now, setting breakdown_chance is widely distributed over the code, due to different functions called in specific modes only (Improved Breakdown enabled, acceleration mode, type of vehicle).
ImprovedBreakdowns-v2.5.5-r27389.patch
The new patch contains the fixes of JGR, updated to current trunk:
- Does not create persistent smoke any more.
- Fixed desyncs due to repeated and inconsistent calculation of breakdown chance.
There is no noticeable behavioral change, although the breakdown chance might have differed temporary.
(63.2 KiB) Downloaded 38 times

OokamiChan
Engineer
Engineer
Posts: 7
Joined: 23 Nov 2015 18:15

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by OokamiChan » 27 Nov 2015 04:18

After getting some mechanical failures one of my train had a effectiv speed of 8 then 4 km/h and before it reached the depot it had all 40 trains on that line after it.
This did happen more times. So I got a bit annoyd of the low speeds so I looked up where max speed is set on mechanical failure and added som code so that the lowest speed is 28 km/h.
It's well marked if any one else what to change the lowest max speed.

Regards
OokamiChan
ImprovedBreakdowns-v2.5.6-r27389.patch
(63.49 KiB) Downloaded 59 times

mtm2207946034
Engineer
Engineer
Posts: 14
Joined: 30 Mar 2015 20:04

Re: Patch: Improved Breakdowns v2.4 (r14563)

Post by mtm2207946034 » 25 May 2019 22:09

This is another update of the patch to current head revision. I fixed the displayed velocity of road vehicles during mechanical breakdown, which should be 0.
I kept the minimal speed of trains being 28 km/h after mechanical breakdowns (even if this happens only after several mechanical breakdowns without service in a depot).
ImprovedBreakdowns-v2.5.7-c1d26d8884f92443b7fa94380881f794a402bba4.diff
Changes:
- Does not show velocity > 0 during mechanical breakdown of road vehicles
(67.73 KiB) Downloaded 22 times

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests