[patch] Cargo Payment Fix (r27460)

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

xarick
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 26 Feb 2015 00:52

Re: [patch] Cargo Payment Fix (r27460)

Post by xarick »

[+] Spoiler
Time travel comparison at 24 km/h

Altered vehicle_base.h:
inline uint GetAdvanceDistance()
{
return (this->direction & 1) ? 128 : 256;
}
Image

Original vehicle_base.h:
inline uint GetAdvanceDistance()
{
return (this->direction & 1) ? 192 : 256;
}
Image


Time travel comparison at 3 km/h

Altered vehicle_base.h:
inline uint GetAdvanceDistance()
{
return (this->direction & 1) ? 128 : 256;
}
Image

Original vehicle_base.h:
inline uint GetAdvanceDistance()
{
return (this->direction & 1) ? 192 : 256;
}
Image
EDIT: I just noticed that OpenTTD isn't precise enough when doing calculations with very low speed values. Thus, these tests aren't all that good.
Attachments
vehicle speed test.sav
at 24 km/h
(13.32 KiB) Downloaded 95 times
vehicle speed test 3 kmh.sav
(15.2 KiB) Downloaded 93 times
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 26 Feb 2015 00:52

Re: [patch] Cargo Payment Fix (r27460)

Post by xarick »

Best travel time approximation yet.


With attached patch:
Image

Original 1.6.1:
Image
Attachments
Slowdown Trains, Aircraft and Ships on Non-Axis v1 r27655.patch
(753 Bytes) Downloaded 97 times
vehicle speed test large.sav
(269.95 KiB) Downloaded 96 times
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 341
Joined: 26 Feb 2015 00:52

Re: [patch] Cargo Payment Fix (r27460)

Post by xarick »

Another alternative patch, vehicle income is modified, by basing it on penalized diagonal distances between source and destination tiles.

But road vehicles are adversedly affected by it, unfortunately.
Attachments
less vehicle income on non-axis v1 r27655.patch
(1.02 KiB) Downloaded 93 times
Formerly known as Samu
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Redirect Left, WintryAmethyst and 23 guests