Autorenew old vehicules "bug"

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply

Do you think this patch is usefull ?

Yes
10
83%
No
1
8%
Not concerned
1
8%
 
Total votes: 12

User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Autorenew old vehicules "bug"

Post by MagicBuzz »

Some months ago, I already suggested to change the way the "Autorenew vehicule when it gets old" patch.

Currently, if you set "service interval" to 0, and don't schedule depots in your orders, you don't have any chance of getting you vehicule renewed when it gets old. This patch works only if the vehicule enters a depot.
Worst of all, if the autorenew patch is enabled, you aren't even warned about your vehicule gets old.

I suggest to change how it works for players like me who play with no break down, so no scheduled servicing (nor in the orders nor at intervals).

When the vehicule reachs the age it has to be renewed, if not any service is scheduled (nor in the orders nor at intervals) it should automatically head to a depot to get renewed.

Here is my old patch refreshed to fit the lastest build (and some optimizations as well...)

-- Fix : Now when we start a "autoreplace" for a newer vehicle, all the old vehicle type don't go to the depot immediately. You can choose in your vehicle list wich ones you want to send to depot by using "send to service". As this patch works with "service" disabled, it just overrides the normal action by sending only the vehicles that have a vehicle replacement.

r12059 - Refresh of the patch to fit the current version (currently, the patch was broken with the lastest trunk)

This refresh still needs some tests, especially in the "normal" settings mode (I mean, when you use breakdowns and servicing)
Attachments
fix_auto_replace_if_old.patch
r12059
(3.51 KiB) Downloaded 184 times
Last edited by MagicBuzz on 04 Feb 2008 23:54, edited 3 times in total.
User avatar
rav
Traffic Manager
Traffic Manager
Posts: 253
Joined: 17 May 2007 13:36
Location: Netherlands
Contact:

Post by rav »

very nice! I've been waiting for such a patch :o
but shouldn't this go in the development section? :oops:
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

The last time I designed this patch, I got answers from the dev section that this patch was useless and so on.

So this time I prefer to ask here if someone wants it ;)
User avatar
rav
Traffic Manager
Traffic Manager
Posts: 253
Joined: 17 May 2007 13:36
Location: Netherlands
Contact:

Post by rav »

hmm, well I can tell you it isn't useless :P

breakdowns just occur far too often in OTTD, so I turn them off by default, consequence is that my trains will visit the depots for no reason, so I turn that off too, which leaves the trains to get old!

again: great patch, it should make trunk or at least the ChrisIN :P
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

Well, when breakdowns are off, what is the point in renewing vehicles? (Except they will no longer show with red color, etc ...)
100 years old bus then works as perfectly as new one ...

Perhaps some feature to split the "warning about player vehicles" to two subcategories ("warn about old vehicles" and "warn about other problems" (train lost, not enough orders ...)) would be better
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
phil88
Transport Coordinator
Transport Coordinator
Posts: 267
Joined: 25 Jan 2007 23:26

Post by phil88 »

Correct me if I'm wrong, but the older a vehicle is, the lower the station rating is of the stations it goes to.
- Phil
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

If you don't want your vehicules to be replaced, just disable the patch "autorenew vehicule when it gets old" then ;)

Thus my patch also applies to the "autoreplace" feature : right now, when you activate a replacement, you have to send all you vehicules manually.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

phil88 wrote:Correct me if I'm wrong, but the older a vehicle is, the lower the station rating is of the stations it goes to.
I thought it was something like that, but I can't find it in the source code. But I'm pretty sure I saw something about vehicule age.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

MagicBuzz wrote:
phil88 wrote:Correct me if I'm wrong, but the older a vehicle is, the lower the station rating is of the stations it goes to.
I thought it was something like that, but I can't find it in the source code. But I'm pretty sure I saw something about vehicule age.
It depends on vehicle speed and ... yes, there is condition for age:

Code: Select all

{
	byte age = ge->last_age;
	(age >= 3) ||
	(rating += 10, age >= 2) ||
	(rating += 10, age >= 1) ||
	(rating += 13, true);
}
So basically, the rating will not decrease as result of old vehicle being there, but will increase if you use very new vehicles.

Basically, once vehicle age is 3 years, it does not matter how old it is - whether 4 years or 140 years ...

But it is right, that by renewing the old vehicle, you get some short interval (3 years) in which you'll be receiving some bonus again ...

So it will make sense to "force" the vehicles for exchange if autoreplace is enabled (after all, it is clientside settings, so everybody can turn it off)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

I just fixed my patch.

The problem is that starting a new vehicle replacement was sending all vehicles concerned by this change to go in the nearest depot.

Now, they won't, and wait you use the "send to service" button in vehicle list. Only vehicles concerned by a autoreplacement will then go to the depot.

PS : This should not impact the way the "send to service" button works if you use normal service. I'll check it tomorrow.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Re: Autorenew old vehicules "bug"

Post by MagicBuzz »

Small update : patch refresh in order to work correctly with the r12059 trunk.
Take care, it still needs to be tested (I did only quick tests)
User avatar
sickie
Engineer
Engineer
Posts: 85
Joined: 15 Sep 2007 00:51
Location: Slovenia
Contact:

Re: Autorenew old vehicules "bug"

Post by sickie »

Thank you for updating this patch. I really like your patches (Timetable separation, autorenew).
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest