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

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

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

Post by Eddi »

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

regards
Michael
yes. but those are of my native language ;)

also, translations are a little more static than forum postings

and also i said i don't stick to those rules personally (because they don't "flow" properly when writing)
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

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

Post by ostlandr »

I really like this patch! Looking forward to trying it.

Just to be clear, if I have two 2,000 horsepower engines on a train, and one gets the "reduced power" breakdown and drops to zero horsepower, the train keeps moving with one engine working? If so, awesome work.
Who is John Galt?
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

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

Post by Tekky »

I have compiled a Win32 binary of improved breakdowns version 1.1. It can be downloaded from this link:

EDIT: This binary is now out of date. Swallow (the patch author) now provides his own Win32 binaries for the latest version.
http://rapidshare.com/files/145024724/i ... ns_1_1.zip

Disclaimer: Please note that I merely compiled the patched source code and checked the binary for viruses using VirusTotal. I have not audited the source code itself. Therefore, I can provide no warranty that this binary contains no harmful code.

This disclaimer is only provided for legal reasons and I have no reason to believe that this binary contains harmful code, as I have been using it myself.
Last edited by Tekky on 22 Oct 2008 09:50, edited 2 times in total.
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v2.0 (r14117)

Post by Hirundo »

UpdateUpdateUpdate :D

The most important change is that improved breakdowns are now available for all vehicle types.
See the first post for more information.
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.0 (r14117)

Post by Tekky »

Thank you very much for this update. I will be posting a new binary later today. I assume that Swallow (the author of the patch) has no objections to me posting and distributing a binary of this patch?

@Swollow: I would like to make a patchpack with this patch and four other patches, which will be placed under Version 2 of the General Public License (GPL v2). I wouldl of course give you full credit for making this patch. However, I believe that the GPL would not prevent other people to distribute your patch without giving you credit for it. The reason I want the license to be GPL is so that it can be included into trunk, which also is GPL v2. Do you give me permission to do this?
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v2.0 (r14117)

Post by Hirundo »

I hereby state that, unless explicitly stated otherwise, everything I publish on these forums is released under the terms and conditions of the GPL v2.
Yes, I know a statement like this will probably not suffice in court. I do not care.

Therefore you are fully allowed to create binaries or patchpacks, actually this is very much appreciated.
However, I'm working on a small update to fix and improve some stuff, which will be released soon (hopefully tonight) I'd recommend not to create your binary until then, unless you happen to like doing the same thing twice.
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.0 (r14117)

Post by Tekky »

Swallow wrote:Yes, I know a statement like this will probably not suffice in court. I do not care.
I am no lawyer, but still, I can't think of any possible reason why this declaration should not be sufficient.

Anyway, thanks for allowing me to use your patches in my patchpack. I also plan to use your more conditional orders patch in my patchpack, because it fits together perfectly with the stop in depot order patch made by PhilSophus. I think these two patches fit together perfectly, because an explicit "stop in depot" order is very useful when used in conjunction with conditional orders.

Swallow wrote:However, I'm working on a small update to fix and improve some stuff, which will be released soon (hopefully tonight) I'd recommend not to create your binary until then, unless you happen to like doing the same thing twice.
Ok, I won't create a binary until the next release of yours. By the way, the topic of this thread refers to r14117. Shouldn't this be r14417?
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v2.1 (r14428)

Post by Hirundo »

V2.1 is released, see first post as usual.
Tekky wrote:Anyway, thanks for allowing me to use your patches in my patchpack.
No, thank you for supplying the binaries.
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 v2.1 (r14428)

Post by YukonRob »

Hi - playing with 2.1 and I have an aircraft suspended in mid-air (broken - Limited to 0 km/h) Can supply save if necessary. Looking forward to this patch though :)
Suspended Plane
Suspended Plane
Suspended plane.png (726.82 KiB) Viewed 6049 times
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v2.1 (r14428)

Post by Hirundo »

A plane flying at 0 km/h ?( According to the laws of physics such a thing cannot happen.

Could you please provide a savegame, preferably one from before this happened.
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 v2.1 (r14428)

Post by YukonRob »

I pm'd you the savegame. I started loading other savegames, and the planes are loaded stuck. As a general observation all of the stuck planes were circling airports on load.
Tekky
Route Supervisor
Route Supervisor
Posts: 420
Joined: 19 Dec 2006 04:24

Re: Patch: Improved Breakdowns v2.1 (r14428)

Post by Tekky »

Here is the binary for improved breakdowns 2.1.

Legal Information:

Please note that this program is copyrighted and licensed under version 2 of the General Public License, which means -among other things - that it is distributed without any warranty. Please see COPYING.txt for further information. This file is included in the .zip archive. I have supplied this notice because it is mandatory according to section 1 of the GPL.

Pursuant to section 3 §a of the GPL, I declare that the source code of this binary is available from [url]svn://svn.openttd.org/trunk[/url]. I used revision 14430 for building the binary. Furthermore, I subsequently applied the patch "improved breakdowns 2.1" which is available in the first post of this thread. Also, in order to get the language files to compile properly, I had to afterwards also apply a self-made patch, which I have also attached to this post. This binary is also linked with libpng, zlib and freetype2. The source code of these modules are available from this link(zlib), this link(libpng) and from this link(freetype2).

**end of legal information**

Damn, it took me more than half an hour to formulate this legal statement, in order to comply with the GPL. I hope that I am distributing the binary legally now. Well, I guess it is still illegal, because distribution of OpenTTD is generally illegal, since it is a derivative work of a copyrighted work of Chris Sawyer. Or does this maybe qualify as fair use, since only people who have the original game are able to play OpenTTD, because OpenTTD is distributed without the art files? Anyway, at least I did everything I could to comply with the GPL....

EDIT: since Swallow removed the patch of version 2.1 from his first post and replaced it with version 2.2, I must also remove the binary of this old version, or provide the old patch myself, in order to remain compliant with the GPL. I chose to do the latter, since it may be useful to keep this old binary on the forums, for example to determine if a certain bug also occured in a previous binary. Therefore, I have now also attached this old patch of Swallow to this post.

Please note that the attached binary is now outdated. A new version of this patch can be found later in this thread.
Attachments
improved_breakdowns_2_1.zip
(2.72 MiB) Downloaded 151 times
language.patch
(49.1 KiB) Downloaded 187 times
improved-breakdowns-v2.1-r14428.patch
(53.64 KiB) Downloaded 155 times
Last edited by Tekky on 02 Oct 2008 19:38, edited 1 time in total.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Re: Patch: Improved Breakdowns v2.1 (r14428)

Post by Brianetta »

Tekky wrote:Well, I guess it is still illegal, because distribution of OpenTTD is generally illegal, since it is a derivative work of a copyrighted work of Chris Sawyer.
Please don't take this as legal advice; it's not intended as such. If I were to contribute code to the OpenTTD project I'd take the GPL as presented to me at face value, and assume that it had been legally applied to the work. This would be my defence in court if prosecuted for copyright infringement; that I believed in all faith that the license was valid.

As it happens, I don't actually hold that belief, and so to avoid the possibility of perjuring myself I refrain from distributing the game, in source or binary form (yes, this includes distribution to friends). Alas, if it were tried in court and the GPL was found to be unlawfully applied to OpenTTD, all of the rights conferred to other users to modify, distribute and re-use would in turn become unlawful. There is no way at all that I'd use any OpenTTD code in another GPL project.

Again, this isn't intended as advice. If in doubt, talk to a solicitor - or steer clear.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

Re: Patch: Improved Breakdowns v2.1 (r14428)

Post by Hirundo »

YukonRob wrote:I pm'd you the savegame. I started loading other savegames, and the planes are loaded stuck. As a general observation all of the stuck planes were circling airports on load.
The word 'loaded' pointed me to the problem here. It turns out I had forgotten to properly maintain backward compatibility. Version 2.2 (first post) fixes this. If you use this new version to load your old savegame, it should work correctly.

Note that this update only affects the loading of non-patched savegames. It should make no difference to your current game. Trunk games loaded with the old version may have stalled planes, incorrect breakdown chances or a combination thereof. Reloading the old, unpatched savegame with this version should fix it.

/Runs and hides before Tekky finds out his binary has become outdated within 24 hours.
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.1 (r14428)

Post by Tekky »

Swallow wrote:/Runs and hides before Tekky finds out his binary has become outdated within 24 hours.
Argh... well, here is the new binary for improved breakdowns 2.2. Please observe that this binary is copyrighted under Version 2 of the General Public License and is provided without any warranty. For further information, please refer to my previous post. The legal information in my previous post is still valid, except for the fact that I patched against r14432 this time instead of against r14430.

@Swallow: Please consider incorporating my language.patch into your patch. Otherwise, the .lng files will not compile properly with your patch, except for english.lng. In my opinion, it is better to have language files with mixed native language and English than not working .lng files. I hereby grant everyone the right to use my language.patch file under the Terms of Version 2 of the General Public License.

EDIT: This binary is now out of date. Binaries are now supplied by the patch author. Please refer to the first post of this thread.
Attachments
improved_breakdowns_2_2.zip
(2.72 MiB) Downloaded 149 times
Last edited by Tekky on 12 Oct 2008 11:25, edited 1 time in total.
Aali
Traffic Manager
Traffic Manager
Posts: 144
Joined: 01 Oct 2008 00:04
Location: Sweden

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

Post by Aali »

This patch is no fun with long trains of powered wagons. :P

With all those "engines" and that 10% chance to have a mechanical failure, it's almost as bad as unpatched.
What's even worse is that if any of them gets the low speed breakdown, the whole thing slows down, and this happens A LOT with 10 tile trains (20 powered wagons)

You'd think they could just shut down the broken engine and run on the remaining 19, but apparently not :P

Would be nice if you could lower the chance of these types of breakdowns based on the number of engines in the train. (And as a side-effect, increase the chance of losing power in a multi-engine setup)
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

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

Post by Hirundo »

Aali wrote:This patch is no fun with long trains of powered wagons. :P
The term 'powered wagons' is kind of ambiguous here. Do you mean wagons using the powered wagon callback, such as the 2CC xMU cars in the 2cc set? These are not counted as engines, so it should not be a problem. Or are you talking about trains in which each carriage is an engine, e.g. 10 Manley-Morels in one train. In this case they are indeed all engines and thus they will all break down, so I assume this is what you mean.

The subject of multiengine trains in the context of this patch is a tricky one. Please consider the following points:
- The impact of breakdowns is significantly lower than it used to be.
- Multiengine trains are already compensated somewhat, because emergency stops only apply to the front engine.
- Multiengine trains are able to compensate a power loss far more easily.
- Breakdown chance is affected by load. This benefits trains with a power surplus, which multiengine trains often have.
- Multiengine trains stopping more often is somewhat considered to be a feature. The aforementioned advantages are designed to balance this.

However, it seems this balance tips in the wrong direction, especially when chaining xMUs. I have been thinking about this problem for a while now, but I haven't been able to come up with an answer that really satisfies me. Options include the following:
- divide the breakdown chance by the number of engines. Advantage: solves the problem completely. Disadvantage: makes the whole multiengine feature basically obsolete.
- Adjust the breakdown types, so non-front engines only suffer from power reductions. Advantage: keeps multiengine support in place. Disadvantage: hackish and seems unnatural. Why does only the front engine suffer from mechanical failures?
- divide the breakdown chance by a certain factor, such as sqrt(number of engines). Advantage: may be a nice balance for gameplay. Disadvantage: How can one explain that adding an engine to the consist causes less breakdowns for the other engines?

As you see, this is not an easy problem to tackle, but it is certainly on my todo list. If anyone as a good suggestion, please let me know.
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 »

Swallow wrote:As you see, this is not an easy problem to tackle, but it is certainly on my todo list. If anyone as a good suggestion, please let me know.
Although I spent a lot more time compiling binaries for this patch than actually playing these binaries (I generally haven't been playing much OpenTTD lately) and therefore may not be qualified to judge what would be best, I would like to make the following suggestions:
  • Mechanical failures: I'm not sure whether this type of failure should occur with multiheaded trains, because with a multiheaded train, it should be normally possible to shut off an engine if it is misbehaving and continue driving with the other engines. Of course, if something is wrong with the wheels of the engine and there is a danger of a derailment, then it is not sufficient to simply shut down the engine, so the train will have to be stopped. But this type of failure applies to all wagons, not just engines.
  • Emergency stop failure: As far as I know, in German high-speed trains, when someone pulls the "emergency" lever, the train does not stop automatically. Instead, the train's driver is notified when someone pulls the "emergency" lever and it is up to the driver and crew to decide whether the situation warrants an emergency stop. Therefore, I'm not quite with the way this failure is implemented. It may be realistic for other countries, but if you really want realism, the probability of this failure occuring should be proportional to the number of passengers on the train and it should NEVER happen with freight trains (EDIT: I am assuming that the use of the emergency lever was abusive. Maybe I should not make this assumption?)
  • Lower maximum speed failure: I don't think that a failing engine should slow down other engines too, because a failed engine in a multiheaded train can normally be simply shut down.
  • Reduction in power failure: I like the way this failure is implemented and have no suggestions of improvement.
In any case, even if I don't consider this patch perfect, it certainly is a big step in the right direction and a lot better than the current breakdowns in OpenTTD. So I would like to thank Swallow for his work on this patch, because I have always found breakdowns very annoying in standard OpenTTD.
Last edited by Tekky on 04 Oct 2008 17:34, edited 2 times in total.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

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

Post by Brianetta »

Swallow wrote:- divide the breakdown chance by the number of engines. Advantage: solves the problem completely. Disadvantage: makes the whole multiengine feature basically obsolete.
It doesn't make it obsolete. It makes it worth buying more than one locomotive in some circumstances. Multiheading is a gameplay decision for the player. In regular play, the decision is for extra horsepower, against extra capital cost, extra running cost and a longer train (which affects cargo capacity for a given platform length). That's an awful lot of reasons not to multi-head, and only one to do so. Your patch makes it more interesting, and dividing the chance by the number of engines doesn't harm its appeal. It's still better than before, and far from obsolete.
Swallow wrote:- Adjust the breakdown types, so non-front engines only suffer from power reductions. Advantage: keeps multiengine support in place. Disadvantage: hackish and seems unnatural. Why does only the front engine suffer from mechanical failures?
Only the front engine represents systemic failures that affect the whole train. Is that a workable excuse? Feel free to use it; you don't even need to credit me.
Swallow wrote:- divide the breakdown chance by a certain factor, such as sqrt(number of engines). Advantage: may be a nice balance for gameplay. Disadvantage: How can one explain that adding an engine to the consist causes less breakdowns for the other engines?
Easily. It' a game play thing, balanced for our enjoyment. If it works, it isn't broken. Talk to Belugas if you're worried about things seeming unrealistic where gameplay might otherwise suffer.
Swallow wrote:As you see, this is not an easy problem to tackle, but it is certainly on my todo list. If anyone as a good suggestion, please let me know.
Hopefully there's something to inspire you in there. (-:
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Hirundo
Transport Coordinator
Transport Coordinator
Posts: 298
Joined: 27 Jan 2008 13:02

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

Post by Hirundo »

Many thanks for your input. It really helps when people voice their opinions.
Brianetta wrote:Easily. It' a game play thing, balanced for our enjoyment. If it works, it isn't broken. Talk to Belugas if you're worried about things seeming unrealistic where gameplay might otherwise suffer.
I think you are right here. I spent quite a lot of time thinking and testing, but was unable to find a solution which realistic but does not harm gameplay. What I found to work best is the following:

1. Trains which are multiengine by design, such as the AsiaStar or the Manley Morel DMU, have their breakdown chance multiplied by about 0,7.
2. The breakdown chance for a given engine in a consist is multiplied by 3/(n+2), with n being the number of engines. This results in the following:

Code: Select all

c(n) = breakdown chance per engine in a consist of n engines =   
1; 0,75; 0,60; 0,50; 0,43; 0,38; 0,33; 0,30
t(n) = total breakdown chance when compared to a single engine = 
1; 1,50; 1,80; 2,00; 2,14; 2,25; 2,33; 2,40
It may not be entirely realistic, but it is simple and it works. Quick empirical testing showed that train of 5+ DMUs could more than easily keep up with a single DMU or engine, where it used to lag behind.

I attached a modified patch file below. Please test it in a real game to see how it works. 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 ;) )
improved-breakdowns-multiengine.patch
(56.51 KiB) Downloaded 182 times
@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.
Create your own NewGRF? Check out this tutorial!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests