Patch: Multiengine Normalization

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

Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Patch: Multiengine Normalization

Post by Bjarni »

kaan wrote:
athanasios wrote:To my opinion a message that the engine is broken down would suffice.

Hmmm, that could be done, but I'm not sure how practical that would be with 1000+ trains.
We want to get rid of the message shower, not make it worse. Besides do the player really need to know every single time a locomotive breaks down?
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Multiengine Normalization

Post by athanasios »

And we will get a shower of posts from noobs that their trains are buggy.

It is true that I am not going to enable such a message to pop up. But we would avoid the above.

Well, a notification must be given.

Another idea that passed from my mind, is a text message or a small sprite somewhere on the vehicle's window.

Do you have anything better to propose?
Attachments
broken_engine.png
broken_engine.png (18.57 KiB) Viewed 5237 times
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Patch: Multiengine Normalization

Post by Bjarni »

athanasios wrote:Another idea that passed from my mind, is a text message or a small sprite somewhere on the vehicle's window.
That's a nice idea... right until somebody tries to add 100 locomotives in one train. We need a solution that will work with any number of locomotives.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Patch: Multiengine Normalization

Post by athanasios »

His problem!

For more than 3 or 4 engines we could use a single vehicle sprite and only the number(s) of the engine(s) that is(are) damaged.

If he is a fool to have 100 low reliability engines, so that all are similtaneously broken down, well again: His problem!!!
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Sir Bob
Traffic Manager
Traffic Manager
Posts: 214
Joined: 07 Oct 2006 09:08
Location: Melbourne, Australia

Re: Patch: Multiengine Normalization

Post by Sir Bob »

Or possibly just have a fraction next to the train name saying how many engines are operational.
i.e. "Train 1 (3/4)"

Thoughts?
Witty Signature!
Image
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: Multiengine Normalization

Post by Roujin »

Does it have to be in the main vehicle window?

We could put it into the details window, in the row of the engine that is broken...

something like this...
Attachments
engine broken mockup.png
engine broken mockup.png (10.99 KiB) Viewed 5156 times
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Re: Patch: Multiengine Normalization

Post by kaan »

Nice idea Roujin. Then we could add number of breakdowns there too.

I have made a version with a patch option and attached it.
I'm sorry to say that this will be my last contribution to this patch for quite some time. I'm going to save my energy for work, where I'm a bit stressed out at the moment.

If anyone wants to take over I would be very pleased.
Last edited by kaan on 16 May 2008 23:45, edited 1 time in total.

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Re: Patch: Multiengine Normalization

Post by kaan »

I had a bit of time on my hands and did a little tweaking.
screenie
screenie
details.png (13.87 KiB) Viewed 5002 times
Last edited by kaan on 16 May 2008 23:45, edited 1 time in total.

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
User avatar
Timitry
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 01 Oct 2004 15:28
Contact:

Re: Patch: Multiengine Normalization

Post by Timitry »

I would be in favor of a solution where you can see directly that an engine is broken down, without opening the vehicle window or such.

Imagine you have a great network, but only few depots. You don't think you need more as your trains are running - however, if you see some black smoke on them, maybe on some of the engines, you know you could use more depots!

Can't we add some new graphics? Maybe smoke which is a little less big & black as the current one?
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Patch: Multiengine Normalization

Post by Bjarni »

Timitry wrote:I would be in favor of a solution where you can see directly that an engine is broken down, without opening the vehicle window or such.

Imagine you have a great network, but only few depots. You don't think you need more as your trains are running - however, if you see some black smoke on them, maybe on some of the engines, you know you could use more depots!

Can't we add some new graphics? Maybe smoke which is a little less big & black as the current one?
it would be best to see broken engines without opening windows but the black smoke code presumes the vehicle to be stopped. Because of this the black smoke starts at a certain location and will not move even if the vehicle moves. You would notice this if you read the whole thread before replying.

I think this is a decent solution at least for now. Personally I think the code should work and the impact on the game and gameplay should be investigated. There is no point in getting nice eyecandy for a function that will break the game
razielanarki
Engineer
Engineer
Posts: 20
Joined: 08 May 2002 05:01

Re: Patch: Multiengine Normalization

Post by razielanarki »

what if the broken down engine emits smoke with the diesel smoke sprites colored b/w?
and when a train comes to a full stop (because eg. 3 out of 5 engines are broken), the normal stationary broken down smoke could be shown on each engine.
Anunnaki
Engineer
Engineer
Posts: 64
Joined: 16 Aug 2005 16:09
Location: Prague, Czech Republic

Re: Patch: Multiengine Normalization

Post by Anunnaki »

kaan wrote:...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...
Very nice, great.

I have question, what is biggest think which i lack in openttd. Every train (except multiengine trains) have "running cost per year". This is i think amount of "fuel" which consum the engine per year.

However, this is not calculated on thing, how i use the engine, what i pay for train is same amount of money, independend on how much weight they are carrying. So, my question is, it is possible to change "logic" how much money i pay for one year as a running cost?

My idea is, to have train running cost calculated on weight which is train carying. I hope part of what we need is in the UKRS TRAIN SET. They are capable to have "different" sounds of engines when they are on MAX POWER, middle power or idle power. When the train is accelerating into hills, you hear louad steam engines on MAX POWER...and when engine goes down from the hill, you hear only silent noise :) and engines are on IDLE. So UKRS must have some way how to determine how much are actual engines used.

What we need:
a) Every train must have 4 variables inside, which representing 4 degrees of "how much is engine used" = how much fuel consume in that right momment (high, medium, low, idle), and values are increasing by every title depending on which "usage" is engine on that title. Tran.High, Train.Medium, Train.Low, Train.Idle. Than the train on every new title on which he comes, check how is engine actualy used. When high, than train add +1 to Train.Height variable, when idle then +1 to Train.Low variable. That means, in every variable is stored, on how many tittles was engine used in HIGH, MEDIUM, LOW or IDLE usage. At the end of day, COST PER DAY would be calculated (due to poind d.) and than train reset all 4 variables to 0.

b) When game dont have any function which can easy check how much is engine used, we can calculate that self, like:

Code: Select all

function Usage (Train)
{
 If (Train.Acceleration => 0) then      // engine is used, in other case we are going down from hill = engine is not used
 {
   If (Train.Speed < (Train.MaxSpeed*0.75) Return "Hard";      // less than 75% of max. speed, accelerating, = HIGH usage
   If (Train.Speed <= Train.MaxSpeed Return "Medium"    // from 75% to 100% , not need to much accelerating, MEDIUM usage
   If (Train.Speed > Train.MaxSpeed) Return "Low"    // more than max. speed (more than 100%), no more acceleration needed only stay, LOW usage
 }
 ElseIf { Return "Idle" };     // train is standing on place or is stopping or going down from the hills, IDLE - no power needed
}
c) At the end of every day:

Code: Select all

Function TrainDayPayment (Train)
{
  DayCost = Train.StandardRunningCostPerYear / 365;
  TotalTitlesUsedPerDay = Train.High + Train.Medium + Train.Low + Train.Idle;

If (TotalTitlesUsedPerDay<=1) then        // train was all day standing = engines off, but maintance still there.
{
  Train.High=0;Train.Medium=0;Train.Low=0;Train.Idle=0;     // reseting train variables to be used in the next day
  Return 0.10*DayCost;     //train will pay 10% of standard DayCost
}
elseIf   // train was "active" in that day, was on more than one title
{
  PayForOneTitle = DayCost / TotalTitlesUsedPerDay;
  PayForHigh = (1.25 * Train.High)*DayCost;              // 125% of DayCost per HIGH title
  PayForMedium = (0.75 * Train.Medium)*DayCost;    // 75% of DayCost  per MEDIUM title
  PayForLow = (0.50 * Train.Low)*DayCost;               // 50% of DayCost per LOW title
  PayForIdle = (0.10 * Train.Idle)*DayCost;               // 10% of DayCost per IDLE title
  Train.High=0;Train.Medium=0;Train.Low=0;Train.Idle=0;     // reseting train variables to be used in the next day
  Return PayForHigh + PayForMedium + PayForLow + PayForIdle;
}
This all will work with daylenght too i hope.
Be aware.. the code there is only for imagination, it is not code compatible in game, i am not programmer in C++ and i dont know how it is internaly working in openttd, i was only posting this code for imagination and inspirating openttd prgrammers/modders to make change.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Re: Patch: Multiengine Normalization

Post by kaan »

update in first post.

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Multiengine Normalization

Post by planetmaker »

I added an update to r13397. But that version has the same error as version for r13130: it asserts: see attached savegame & let it run on fast forward.

Code: Select all

/Users/ingo/ottd/wwottdgd/trunk/src/train.h:33: failed assertion `v->type == VEH_TRAIN'
Abort trap
Attachments
multiengine_normalization_v5_r13397.diff
update to r13397
(9.19 KiB) Downloaded 112 times
Unbenannt, 1. Jan 1950.sav
save for r13130: just let it run fast forward and it will crash in a few seconds
(92.69 KiB) Downloaded 106 times
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Re: Patch: Multiengine Normalization

Post by kaan »

thanks for the bug report planetmaker :)

I will look into it as soon as possible.

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
Tiberius
Engineer
Engineer
Posts: 86
Joined: 17 Sep 2004 03:15

Re: Patch: Multiengine Normalization

Post by Tiberius »

seems just a small miss :)
EDIT: ahh, damn, now I made a huge miss ...
Attachments
multiengine_normalization_v5_r13397.diff
(9.22 KiB) Downloaded 103 times
I may implement/fix/tweak/eat/ditch it soon (or in distant future, if at all, so don't hold your breath).
If anyone want to be the one please implement it for us all 8)
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch: Multiengine Normalization

Post by pavel1269 »

I am looking forward to see this patch in some final release or even in trunk. 8)
I will play with brokedowns once again. :)
audigex
Tycoon
Tycoon
Posts: 2017
Joined: 09 Dec 2007 21:28
Contact:

Re: Patch: Multiengine Normalization

Post by audigex »

I dislike the "first engine broken so the train doesn't move" idea - that makes it pot-luck as to whether your train stops or not, and has the same number of breakdowns as without multi-heading and it seems to me that the idea of this patch is to encourage multi-headed trains.

Apart from anything, if there are two crews the first can surely either call up or use hand gestures to indicate to the one behind what to do. Or the ones behind can stick their heads out of the window.

I'd cut the horsepower by the weight of the dead loco, without removing its weight (which is I think how it is now) - more realism isn't really required.

Great patch though :) would it be possible to make the BR HST/TIM/Asiastar (or other multi-car locos) work with the same options? Ie if one fails the horsepower/TE halves but it keeps going?
Jon
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Re: Patch: Multiengine Normalization

Post by Bjarni »

audigex wrote:Apart from anything, if there are two crews the first can surely either call up or use hand gestures to indicate to the one behind what to do. Or the ones behind can stick their heads out of the window.
Usually only the first cab is crewed and the controls will be mirrored to all engines. This means that you have to be able to control the train from the front. If an engine dies then the train stops and the driver disables the engine and then continue driving. However there are a lot of failures that would cause the train to stop (like failure to release brakes, door fails to close, somebody pulled the emergency brake...). The question is how much realism/gameplay will we request of this patch?
audigex wrote:I'd cut the horsepower by the weight of the dead loco, without removing its weight (which is I think how it is now) - more realism isn't really required.
Why not just set the power of the engine in question to 0 while keeping the weight of it in the train?
User avatar
Doorslammer
Tycoon
Tycoon
Posts: 1037
Joined: 16 Oct 2007 11:08
Location: Perth, Western Australia
Contact:

Re: Patch: Multiengine Normalization

Post by Doorslammer »

My thoughts would be this:

Maybe represent the broken unit in question with permanent "clag". This is the smoke you normally get from a diesel when it's pulling hard up a hill (very evident in this game ;) ). So using the smoke from the normal use I daresay wouldn't be too obtrusive would it?

I don't know how it would work on steam/electric or other railed appliances though. Unless it's possible to add the clag to them as well?
Image
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 5 guests