Patch: Multiengine Normalization
Moderator: OpenTTD Developers
Patch: Multiengine Normalization
This patch makes locomotives on trains with more than one locomotive act like any locomotive would when it comes to ageing, servicing and breakdowns.
The effect of a breakdown has been altered however.
When the first engine of a train breaks down everything stops like it has been all along. When an engine that isn't the first on a train breaks down it will subtract its horsepower from the front engine for the duration of the breakdown.
This means that a train with multiple engines where one (or more) of the secondary engines is broken down - is carrying a lot of dead weight, but not stopping.
As a nice little bonus: Any engine that need to go to depot for servicing will cause the entire train to go to depot.
The train cargo panel has been modified to show details about each engine. Version 5 is attached. The only change is a bugfix.
The effect of a breakdown has been altered however.
When the first engine of a train breaks down everything stops like it has been all along. When an engine that isn't the first on a train breaks down it will subtract its horsepower from the front engine for the duration of the breakdown.
This means that a train with multiple engines where one (or more) of the secondary engines is broken down - is carrying a lot of dead weight, but not stopping.
As a nice little bonus: Any engine that need to go to depot for servicing will cause the entire train to go to depot.
The train cargo panel has been modified to show details about each engine. Version 5 is attached. The only change is a bugfix.
- Attachments
-
- MultiengineNormalization_V5_SVN13130.diff
- (8.54 KiB) Downloaded 267 times
Last edited by kaan on 17 May 2008 00:01, edited 4 times in total.
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
Ooh, pretty nice. One thing you have to watch out for though is that if one of the secondary engines get old, you'll start getting news messages about "Train 0", which isn't desperately helpful. Another point is that checking for IsTrainEngine(v) || IsFrontEngine(v) is redundant since the front engine is also a train engine.
No-one's more important than the earthworm.
Good pointMaedhros wrote:Ooh, pretty nice. One thing you have to watch out for though is that if one of the secondary engines get old, you'll start getting news messages about "Train 0", which isn't desperately helpful. Another point is that checking for IsTrainEngine(v) || IsFrontEngine(v) is redundant since the front engine is also a train engine.
Any directions of where to look for the "getting old" code?
The second bit ... erhm ... thats just me not cleaning the code properly
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
Ok, here is version 2 with handling of old engines and new strings
Last edited by kaan on 16 May 2008 23:43, edited 1 time in total.
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
This is a cool patch. I think a few of people were asking for it.
Some other ideas
Make broken engines spew out smoke so you can see if they are not operational.
Make the broken down engines stay broken down until the whole train completely breaks down or enters a depot.
Only stop the train if ALL the engines are broken down. It would be fun to see a 4 engine train with 3 broken engines. =)
Fix this mess:
Replace it with cleaner code, maybe the breakdown chance can increase based on how much effort the trains are using. An engine pulling 2 cars would break down less than an engine pulling 10 cars.
Those are just ideas; it is your patch. =)
Some other ideas
Make broken engines spew out smoke so you can see if they are not operational.
Make the broken down engines stay broken down until the whole train completely breaks down or enters a depot.
Only stop the train if ALL the engines are broken down. It would be fun to see a 4 engine train with 3 broken engines. =)
Fix this mess:
Code: Select all
r = Random();
/* increase chance of failure */
chance = v->breakdown_chance + 1;
if (CHANCE16I(1,25,r)) chance += 25;
v->breakdown_chance = min(255, chance);
/* calculate reliability value to use in comparison */
rel = v->reliability;
if (v->type == VEH_SHIP) rel += 0x6666;
/* disabled breakdowns? */
if (_opt.diff.vehicle_breakdowns < 1) return;
/* reduced breakdowns? */
if (_opt.diff.vehicle_breakdowns == 1) rel += 0x6666;
/* check if to break down */
if (_breakdown_chance[(uint)min(rel, 0xffff) >> 10] <= v->breakdown_chance) {
v->breakdown_ctr = GB(r, 16, 6) + 0x3F;
v->breakdown_delay = GB(r, 24, 7) + 0x80;
v->breakdown_chance = 0;
}
Those are just ideas; it is your patch. =)
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
interesting patch... I see that somebody beat me to writing it (not the worst problem you can have).
You could clean up the getting old string by making a static const string array. This can save you from making dublicated code.
I wonder about how to handle breakdowns though. Should the front always stpo the train and never any of the rear ones? If anything, I would say that there should be a risk that any broken engine will stop the train. One could also argue that the train can continue with the front engine broken. The front should have a greater risk of having to stop the train because it contains more complex stuff that's needed to control the other engines.
Also engines should not be able to magically fix themselves. They would need to stop in order to be fixed, but this can save you from stopping in junctions and then stop at stations where they can be overtaken if needed. The counter for the breakdown should then count while the train loads and unloads.
Also how should the load affect the risk of breakdown? There is a certain risk when the front engine pulls a lot (it's overloaded), but shouldn't it be divided with the number of engines to even out the load? and what if the engines aren't equally strong?
And what about the display of the breakdown counter?
You could clean up the getting old string by making a static const string array. This can save you from making dublicated code.
I wonder about how to handle breakdowns though. Should the front always stpo the train and never any of the rear ones? If anything, I would say that there should be a risk that any broken engine will stop the train. One could also argue that the train can continue with the front engine broken. The front should have a greater risk of having to stop the train because it contains more complex stuff that's needed to control the other engines.
Also engines should not be able to magically fix themselves. They would need to stop in order to be fixed, but this can save you from stopping in junctions and then stop at stations where they can be overtaken if needed. The counter for the breakdown should then count while the train loads and unloads.
Also how should the load affect the risk of breakdown? There is a certain risk when the front engine pulls a lot (it's overloaded), but shouldn't it be divided with the number of engines to even out the load? and what if the engines aren't equally strong?
And what about the display of the breakdown counter?
I'm glad you like itZojj wrote:This is a cool patch. I think a few of people were asking for it.
Well, the problem is that when you activate the black smoke it just stay where the engine broke instead of following the train. Looks kind of strange with the tracks smoking like thatZojj wrote:Some other ideas
Make broken engines spew out smoke so you can see if they are not operational.
That is one way to do it, but as it is now then trains get repaired on track all the time and changing that would be adding micromanagement.Zojj wrote:Make the broken down engines stay broken down until the whole train completely breaks down or enters a depot.
This is the next thing I am looking into but don't expect too much. As of now secondary engines don't have a speed or is even started when the train starts. Lots of things might go wrong when I activate thatZojj wrote:Only stop the train if ALL the engines are broken down. It would be fun to see a 4 engine train with 3 broken engines. =)
I would love to, but this is my first patch so I think I'm just going to take it easyZojj wrote:Fix this mess:
[snip]
Replace it with cleaner code, maybe the breakdown chance can increase based on how much effort the trains are using. An engine pulling 2 cars would break down less than an engine pulling 10 cars.
I welcome your feedbackZojj wrote:Those are just ideas; it is your patch. =)
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
I'm glad you are now free to do something else with your timeBjarni wrote:interesting patch... I see that somebody beat me to writing it (not the worst problem you can have).
Please give an example as how to do this. I really can't imagine what you mean.Bjarni wrote:You could clean up the getting old string by making a static const string array. This can save you from making dublicated code.
These are all good ideas.Bjarni wrote:I wonder about how to handle breakdowns though. Should the front always stpo the train and never any of the rear ones? If anything, I would say that there should be a risk that any broken engine will stop the train. One could also argue that the train can continue with the front engine broken. The front should have a greater risk of having to stop the train because it contains more complex stuff that's needed to control the other engines.
Also engines should not be able to magically fix themselves. They would need to stop in order to be fixed, but this can save you from stopping in junctions and then stop at stations where they can be overtaken if needed. The counter for the breakdown should then count while the train loads and unloads.
On the other hand you could argue that the current system is close enough to the real thing. As it is then about 1/n of the breakdowns stops the train (where n is the number of engines and assuming the engines are of the same type). For gameplay purposes this would mean that on a 3 engine train most breakdown would not stop the train, but many would. How does that sound for realism?
For most players that don't know the underlying mechanics, this would be enough to make it "realistic" and fun. On the other hand the players that knows more wouldn't be tempted to make every train a 4 engine monster to keep it from ever stopping. This might be the best way to keep "realism" in there somewhere because you would mostly use multi engine trains on routes with many wagons and/or hills and mountains.
I really like that idea, you should rewrite the breakdown codeBjarni wrote:Also how should the load affect the risk of breakdown? There is a certain risk when the front engine pulls a lot (it's overloaded), but shouldn't it be divided with the number of engines to even out the load? and what if the engines aren't equally strong?
As it is now the breakdowns are counted for each engine and i think it should remain so. It would be a good idea to show this on the detailed info on the train (you know the place where you can see all the wagons too).Bjarni wrote:And what about the display of the breakdown counter?
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
I really don't think its necessary with black smoke on secondary engines, not every fault is a fireBjarni wrote:that would be really ugly code. It would be better to make the smoke follow the engine. Also it's an open question which of those two solutions that would be easiest to code.knedle wrote:You could turn on and off smoke every second this way smoke would follow broken engine.
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
I didn't state that very well. Right now you have it so the broken engine repairs itself while the train is still moving.kaan wrote:That is one way to do it, but as it is now then trains get repaired on track all the time and changing that would be adding micromanagement.Zojj wrote: Make the broken down engines stay broken down until the whole train completely breaks down or enters a depot.
A broken-down engine shouldn't be able to be fixed until the train comes to a stop. When the 2nd or 3rd engine is "broken down", it can still be pulled by the 1st engine. There would be no extra management involved, just a little more smoke. =)
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
I geese you could have a random chance that it could be fixed in motion or vice versa.Zojj wrote:I didn't state that very well. Right now you have it so the broken engine repairs itself while the train is still moving.kaan wrote:That is one way to do it, but as it is now then trains get repaired on track all the time and changing that would be adding micromanagement.Zojj wrote: Make the broken down engines stay broken down until the whole train completely breaks down or enters a depot.
A broken-down engine shouldn't be able to be fixed until the train comes to a stop. When the 2nd or 3rd engine is "broken down", it can still be pulled by the 1st engine. There would be no extra management involved, just a little more smoke. =)
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
the devs have a complete rewrite of breakdowns planned according to this post. See 9.2
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
That's nice to know, thanks for the linkZojj wrote:the devs have a complete rewrite of breakdowns planned according to this post. See 9.2
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
Actually, with multiple units, the lead unit breaking down won't necessarily stop the whole consist. Of course, if it's a running gear issue. . .Bjarni wrote: (snip)
I wonder about how to handle breakdowns though. Should the front always stpo the train and never any of the rear ones? If anything, I would say that there should be a risk that any broken engine will stop the train. One could also argue that the train can continue with the front engine broken. The front should have a greater risk of having to stop the train because it contains more complex stuff that's needed to control the other engines.
Currently, when the train is at less than full load, some crews will shut down the prime mover in the lead unit, to give themselves a quieter ride.
That is something I would love to see. Lightly loaded trains operating at slow speeds almost never breaking down, and overloaded trains on steep grades or running at high speeds breaking down more often. Different horsepower (KW) engines together shouldn't affect the game, as each should be working at an equal share of it's maximum effort. US locomotives have eight "notches" or power settings. On a level track, the driver of the lead units might radio back to the driver of the helper units "put it in run 1 and relax for a while." As the grade increases, he will say "give me run 4" and his own locomotives are likewise in run 4. Soon it's "Give me run 6" as the train's speed drops. If you're a lucky spectator, the call will be "Give me all you've got" and all four locomotives on the head end and the pair of helpers will be screaming in notch eight, nearly twenty thousand turbocharged horsepower making the small pebbles dance on the ground at your feet. . .Also how should the load affect the risk of breakdown? There is a certain risk when the front engine pulls a lot (it's overloaded), but shouldn't it be divided with the number of engines to even out the load? and what if the engines aren't equally strong?
<< stops, catches breath, has a cigarette >>
Who is John Galt?
Who is online
Users browsing this forum: Semrush [Bot] and 22 guests