Service interval in percents counter-intuitive. Why?

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

Post Reply
User avatar
san-ho-zay
Engineer
Engineer
Posts: 34
Joined: 14 Dec 2006 16:12
Location: Leeds, UK

Service interval in percents counter-intuitive. Why?

Post by san-ho-zay »

If using service intervals in percents, this is what the test for service required looks like in 0.5.1:

Code: Select all

v->reliability < GetEngine(v->engine_type)->reliability * (100 - v->service_interval) / 100
For example, if the max reliability of a vehicle is 90% and I set my service interval to 10%, the vehicle gets serviced when the reliability drops by 10% of the maximum reliability, i.e. 9% to 81%.

I guess this seems counter-intuitive to me. It seems more natural to have the percentage the other way round, i.e. 90% producing the same result as above. Was the idea to make it work the same way as the number of days service interval, i.e. a larger number means less servicing?

And, while I'm on the topic of servicing, can anyone tell me if the behaviour of automatic servicing at depot (no orders and no depot force) has changed from TTD? It used to be that trains would decide to go to a depot at the most inconvenient time in their route. Now it seems they make in intelligent choice. Where's this in the code - I can't see it in vehicle.c? Is it something to do with pathfinding? I was going to update the wiki page on servicing.
san-ho-zay
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Re: Service interval in percents counter-intuitive. Why?

Post by PouncingAnt »

san-ho-zay wrote: For example, if the max reliability of a vehicle is 90% and I set my service interval to 10%, the vehicle gets serviced when the reliability drops by 10% of the maximum reliability, i.e. 9% to 81%.
Gads, is *that* how it works?? I also found this counter-intuitive... in that I didn't know it worked this way around! whooops ^^;
NB: the below challenges are still open for submission, so feel free to perform necromancy on them!
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4

Or try my scenario instead!

-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"

Patches:
Company Station Stats
PandaMojo
Engineer
Engineer
Posts: 21
Joined: 04 May 2006 04:42

Post by PandaMojo »

No wonder I felt the need to turn off breakdowns.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests