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

Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: Patch: Improved Breakdowns v2.2 (r14432)

Post by Tekky » 06 Oct 2008 18:28

Swallow wrote:If this indeed fixes the multiengine issues, I will release it as an 'official' version, including a binary, as I'm planning to create these myself from now on. (so Tekky can spend more time playing and testing my patch ;) )
Hehe, I didn't want to imply that it takes me a long time to build the patches. I just wanted to say that I haven't been playing much OpenTTD lately. :-)

Swallow wrote:@Tekky
What you suggest is basically that for non-front engines, all breakdowns simply mean less or no power (the engine is 'shut off') While I considered this as an option, I decided to use the approach outlined above instead. This because the current setup treats all engines as equals, which is one of the main objectives of this patch. Your suggestion makes non-front engines of relatively minor importance, compared to the front engine. However, if this attempt seems to fail, I will seriously reconsider it.
Well, the basic question is, should a multi-headed train be more or less reliable than a single-headed train? I would say that a multiheaded train should be more reliable, because the worst-case scenario in a multi-headed train should be a failure that forces a shutdown of one engine. However, this would require a complete reworking of the current breakdown probabilities. Otherwise, a multiheaded train with three engines at 0% reliability will still be able to drive halfway normally, because most of the time, at least one of the three engines will be working.

I do agree with you that all engines should be treated equally. For example, in a train with two engines, the train should behave the same way if either engine has a failure.

User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Patch: Improved Breakdowns v2.2 (r14432)

Post by ostlandr » 08 Oct 2008 20:52

I haven't played with this patch yet, but if it works as advertised it will be great to play and very realistic.

Currently in the real world, a lot of short line and regional railroads are running fleets of worn-out, second hand locomotives. It is fairly common for a train to return from a run with one locomotive broken down. In fact, a few years ago even some Class 1 railroads (specifically Canadian National) were having motive power issues due to a sudden spike in traffic. They had to press older, less reliable units into service, and had these kind of problems. Now, if the roadmaster has given you "just enough" horsepower to haul the train, and one unit goes down, that leads to problems, and throws more load on the remaining units.

The most common breakdown for a diesel is "fails to load" where the locomotive won't send the full horsepower to the wheels due to some sort of electrical problem. Next most common might be overheating, which is dealt with by reducing the power output of the locomotive's prime mover. Either of these problems could also cause a locomotive to be shut down and produce 0% power. For multiunit diesel-electric locomotive consists, the OTTD style "sparks and smoke" breakdown is rare, but does happen. A broken wheel, brake failure, an engine fire, bad wheel bearing, etc. could cause an entire consist to be stopped until the disabled locomotive could be repaired or removed.
Just today I saw a string of Guilford Rail locomotives passing a crossing, and one of them was not making smoke and had the engine compartment doors open.
Who is John Galt?

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

Re: Patch: Improved Breakdowns v2.2 (r14432)

Post by Hirundo » 09 Oct 2008 21:55

@Tekky (and others)
The problem here is devising a solution what works equally well with 1, 2 or 20 engines in a train. The core issue is what to do with mechanical failures. These represent severe overheating, fires or problems with lubrication, brakes, wheels, bogies etcetera that all cause a complete stop. If these breakdowns are allowed to happen on all engines, trains with 10+ engines will always be a problem unless the breakdown chances are reduced (which I did) If these are not allowed on non-front engines, or not at all in multiengine trains, these trains become a sort of tanks that can continue in all circumstances, no matter how much black and grey smoke they emit. IMO if one has a train with many unreliable engines one needs to be punished for it, and in this case that won't really happen I think.

I may be exaggerating a little here but I hope my point is clear. Apart from the current approach of reducing the per-engine breakdown probability depending on the number of engines, there is no real way of balancing this, at least I couldn't find it. However, suggestions are still very much appreciated and they will be taken into consideration.
Tekky wrote:However, this would require a complete reworking of the current breakdown probabilities.
Do you have anything specific in mind here?
Create your own NewGRF? Check out this tutorial!

Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: Patch: Improved Breakdowns v2.2 (r14432)

Post by Tekky » 09 Oct 2008 23:46

Swallow wrote:problems with lubrication, brakes, wheels, bogies etcetera
These problems can occur on all types of wagons, not only on engines. So if you want to apply these types of failures, they should apply to every wagon (if you want the breakdown chance to be proportional to the length of the train) or to the train as a whole.

Swallow wrote:If these are not allowed on non-front engines
I'm not sure if it is a good idea to treat front engines differently than non-front engines. A train with a front engine reliability of 20% and a second engine reliablity of 80% should be just as reliable as a train with a front engine at 80% and a second engine at 20%.

Swallow wrote:If these are not allowed on non-front engines, or not at all in multiengine trains, these trains become a sort of tanks that can continue in all circumstances, no matter how much black and grey smoke they emit. IMO if one has a train with many unreliable engines one needs to be punished for it, and in this case that won't really happen I think.

I may be exaggerating a little here but I hope my point is clear. Apart from the current approach of reducing the per-engine breakdown probability depending on the number of engines, there is no real way of balancing this, at least I couldn't find it. However, suggestions are still very much appreciated and they will be taken into consideration.

Tekky wrote:
However, this would require a complete reworking of the current breakdown probabilities.
Do you have anything specific in mind here?
I do not think you are exaggerating. This indeed is a big problem in how multiheaded trains should be handled.

Maybe the best solution should be that breakdowns should be less frequent (as long as reliability is high), but when breakdowns occur, they should be more painful and cause permanent damage to the train until the train is serviced inside a depot.

This means that a train with only one engine that suffers a breakdown will never be able to repair itself to reach 100% power again, except by servicing inside a depot, unless that train has a very high reliability. I would say that the maximum power after a breakdown should be 20% plus the reliability of the train. This means that a train with 80% reliability will be able to fully recover from the breakdown and a train with 0% reliability will only be able to use 20% power until it is serviced inside a depot. These values can of course be randomized somewhat, in order to make things less predictable.

This system will be a lot more painful for a multiheaded train with many unreliable engines. If we assume that we have a train with 10 engines at 0% reliability, the breakdowns of the engines themselves will not be very painful for the train. But the aftereffects of these breakdowns will be very painful, because it will eventually be permanently limited to 20% power in addition to actual breakdown effects, until it services inside a depot.

Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: Patch: Improved Breakdowns v2.2 (r14432)

Post by Tekky » 11 Oct 2008 10:36

In my above proposal, a train with a "service in depot" order should always go to the depot, if it has reduced power due to a previous breakdown, even if it is not scheduled to do this.

EDIT: I was referring to the "service in depot" order because this order type is very often necessary when using YAPP/PBS/path signals, in order to make trains service in a depot, because otherwise, they often won't find a depot without this explicit order. However, what I just wrote also should apply to trains without a "service in depot" order. In other words, a train which has suffered a permanent reduction in power due to a breakdown should act as if its regular maintenance period has expired and start searching for a depot, even if its maintenance period has not expired.
Last edited by Tekky on 12 Oct 2008 11:40, edited 1 time in total.

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

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Hirundo » 11 Oct 2008 17:59

It took some more time than I expected, but here is version 2.3 (files attached to first post) I have supplied a binary as well for win32 users. Changes include a reduced breakdown chance for multiengine trains and a thorough code review resulting in many small fixes and codechanges.
Tekky wrote:Maybe the best solution should be that breakdowns should be less frequent (as long as reliability is high), but when breakdowns occur, they should be more painful and cause permanent damage to the train until the train is serviced inside a depot.
This is quite a radical suggestion, but certainly an interesting one. It is somewhat similar to the current functionality of aircraft; They remain broken until they either land or service, depending on breakdown type.

Currently I'm not planning any major functionality changes like this. However, I'll keep it in my in my mind when talking to the devs on IRC about this patch (I'm planning to do that somewhere next week)
Create your own NewGRF? Check out this tutorial!

Marcoooooo
Engineer
Engineer
Posts: 8
Joined: 15 Oct 2008 11:16

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Marcoooooo » 15 Oct 2008 11:42

Maybe the cost aspect of breakdowns might be nice to implement to, although I do not know if it is possible. A damaged engine might use its fuel less efficiently or or wear its engine more than in normal conditions. This would increase the running costs of the vehicle or let the vehicle age faster than in normal conditions. This way you could chose to drive further and lose money, or to repair first before the service can be continued.

Another aspect of breakdowns would be the qualtiy of the tracks, roads and runways. Assigning more money to the maintance of your properties would reduce the breakdown chance like it is in the real world.

User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Brianetta » 15 Oct 2008 16:00

Marcoooooo wrote:Another aspect of breakdowns would be the qualtiy of the tracks, roads and runways. Assigning more money to the maintance of your properties would reduce the breakdown chance like it is in the real world.
Now that's an idea that appeals to me.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED

Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Tekky » 21 Oct 2008 22:32

Brianetta wrote:
Marcoooooo wrote:Another aspect of breakdowns would be the qualtiy of the tracks, roads and runways. Assigning more money to the maintance of your properties would reduce the breakdown chance like it is in the real world.
Now that's an idea that appeals to me.
The mere suggestion of having track maintenance already appeals to me. :-)

Aali
Traffic Manager
Traffic Manager
Posts: 144
Joined: 01 Oct 2008 00:04
Location: Sweden

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Aali » 21 Oct 2008 23:05

Tekky wrote:
Brianetta wrote:
Marcoooooo wrote:Another aspect of breakdowns would be the qualtiy of the tracks, roads and runways. Assigning more money to the maintance of your properties would reduce the breakdown chance like it is in the real world.
Now that's an idea that appeals to me.
The mere suggestion of having track maintenance already appeals to me. :-)
I too, like this idea very much. It should probably go in a separate patch though.

dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 334
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by dasy2k1 » 30 Oct 2008 19:48

with the multi engine problem,

how about if a non front engine is tripped for mechanical falure say 70% of the time it will just smoke and power reduced to 0% (ie engine falure, where it can be shut down isolated and dragged dead)
the other 30% of the time it causes the whole consist to stop (eg brakes binding on)

the front engine still has the normal chances as for example a falure with the cab controlls which wouldent affect the non front engines (well in this case the saftey cut out would reduce them to 0% power) woudl stop the train in the first

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

Re: Patch: Improved Breakdowns v2.3 (r14458)

Post by Hirundo » 04 Nov 2008 20:01

Another small update which fixes a few issues here and there. One of them was a bug that prevented the breakdown reduction for dual engines from applying (thanks, sbr!), so these trains should perform even better now :) Patch file is as usual attached to the first post. Attached here is the language patch that updates STR_885C_BROKEN_DOWN for non-English languages.

@dasy2k1
The inherit flaw (IMO) with such a solution is that the front engine becomes too important. Let's say I have a train, consisting of one engine with 90% reliability and one engine with 70% reliability. It now matters which one is the front engine, as the train will suffer less mechanical failures with the 90% one in front. This disparity between engines is something I've been trying to avoid.

Personally I consider this patch finished now. I'm not planning any new features or changes, although I will keep it updated to the trunk and fix any bugs that appear. Therefore I would like to ask to (one of) the devs; what is your opinion on this patch? Is it eligible for trunk inclusion? Does it need changes to functionality, code style or anything else? Answers to some or all of these questions would be very much appreciated.
Attachments
language-r14563.patch
(48.68 KiB) Downloaded 178 times
Create your own NewGRF? Check out this tutorial!

DonRazzi
Traffic Manager
Traffic Manager
Posts: 216
Joined: 07 Sep 2006 21:44
Location: Western Germany, KBS 395

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

Post by DonRazzi » 07 Nov 2008 16:48

Hi, just a single question: Have you ever planned to add fatalities to this patch? As we have planecrashs in the game, there should be corresponding catastrophies like derailings, bus-infernos and wrecked ships. The chance of such an accident to happen should be very very low and nearly impossible with correctly serviced vehicles, but they should be there.

Don
Best OTTD Screenshots in 2007 !!! Image Image

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

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

Post by Hirundo » 07 Nov 2008 17:49

DonRazzi wrote:....but they should be there.
Please explain why. Realism is not an answer here, Belugas can tell you why.

IMO Aircraft are overpowered already, no need to gimp the other vehicle types even more.
Create your own NewGRF? Check out this tutorial!

DonRazzi
Traffic Manager
Traffic Manager
Posts: 216
Joined: 07 Sep 2006 21:44
Location: Western Germany, KBS 395

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

Post by DonRazzi » 07 Nov 2008 20:23

Well, when it's not for reallity, it's just a nice thing to waiste some money. If it would correspond with the vehicles reliability it would also benefit economic gameplay a little bit.

Don
Best OTTD Screenshots in 2007 !!! Image Image

Hypolite
Engineer
Engineer
Posts: 126
Joined: 10 Jan 2009 07:20
Location: Paris, france

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

Post by Hypolite » 13 Jan 2009 15:07

I have an example for Don Razzi : I was playing with 2 AI. At a point of the game, I bought one of the AI. I figured then he had a train blocked in a station which entry and exit was blocked by 2nd AI building. The train stayed here for nearly 50 years, until I finally bought the 2nd AI. And each and every month, a little popup showed me "Train 65 is getting very old and needs to be replaced immediately".

At this point, I would have LOVED that its age and 0% reliability make it crash himself.

Ok, my example is a little silly, because the crash breakdown would greatly harm an AI, which never replace his trains.

Anyway, I like the concept of this patch, because in my opinion, breakdowns are needed for the reliability to play a role in the game, but it's just so annoying when a train break down for 1 month at a station entrance dispatch, blocking all traffic, making little popup "Train X is lost" appearing for no real reason.

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

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

Post by 2007Alain2007 » 24 Mar 2009 14:49

can we think about updateing this patchs some time please
For Community Integrated Version http://code.google.com/p/civopenttd/

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

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

Post by 2007Alain2007 » 03 Apr 2009 14:05

yes i can think of updateing it and here i am going to try my best to get it up to trunk step by step

here i updated to 15000
Last edited by 2007Alain2007 on 26 Jun 2009 11:39, edited 1 time in total.
For Community Integrated Version http://code.google.com/p/civopenttd/

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06

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

Post by 2007Alain2007 » 25 Jun 2009 23:38

I updated the patch a bit more with some trunk changes

I am going from R15298 and trying to patch 15310



but i have for got how to fix this error

[SRC] Compiling vehicle_gui.cpp
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp: In function `const Vehicle* GetMostSeverelyBrokenEngine(const Vehicle*)':
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:137: error: `IsFrontEngine' was not declared in this scope
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:137: warning: unused variable 'IsFrontEngine'
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp: In member function `virtual void VehicleDetailsWindow::OnPaint()':
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: error: `IsTrainEngine' was not declared in this scope
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: error: `IsMultiheaded' was not declared in this scope
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: warning: unused variable 'IsTrainEngine'
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: warning: unused variable 'IsMultiheaded'
make[1]: *** [vehicle_gui.o] Error 1
make[1]: Leaving directory `/home/Alainspc/ottdsrc/trunk/objs/release'
make: *** [all] Error 2

and yes befor some dev say i am doing rubish at this but i am trying
Last edited by 2007Alain2007 on 26 Jun 2009 11:38, edited 1 time in total.
For Community Integrated Version http://code.google.com/p/civopenttd/

Eddi
Tycoon
Tycoon
Posts: 7414
Joined: 17 Jan 2007 00:14

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

Post by Eddi » 26 Jun 2009 00:33

2007Alain2007 wrote: C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:137: error: `IsFrontEngine' was not declared in this scope
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: error: `IsTrainEngine' was not declared in this scope
C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/vehicle_gui.cpp:1469: error: `IsMultiheaded' was not declared in this scope
sounds like a missing include (related to r15299 - "Cleanup: remove many redundant includes"?)
try including train.h
You might not exactly be interested in Ferion, but if you are, have fun :)

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot], wallyweb and 5 guests