PATCH: Lost Cargo Cost

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
DC-1
Engineer
Engineer
Posts: 88
Joined: 13 Mar 2013 13:53

PATCH: Lost Cargo Cost

Post by DC-1 »

Hello all!

This is my first patch for OpenTTD. I decided to play a game where all passengers are satisfied. I always kept on my eyes on rating of stations and tried to keep the rating above 50% for not to loose the cargo. Now the lost cargo can cost money for the company who owns the station. So you have to keep all your stations ratings on good or else it will cost some money for you.

One screenshot explains everything:
ottd-lostcargocost2.png
LostCargoCost screenshot with everything
(606.41 KiB) Downloaded 6 times
The cost is calculated by ( lost_cargo * cs->current_payment ) equation. Any idea how to be better?
Attachments
lostcargo-1.3.2.diff.gz
Lost Cargo Cost diff against the stable 1.3.2
(2.91 KiB) Downloaded 280 times
zooks
Transport Coordinator
Transport Coordinator
Posts: 262
Joined: 29 Jun 2006 08:36

Re: PATCH: Lost Cargo Cost

Post by zooks »

Good idea to gain some insight on how much cargo a company is missing out.
However, lost cargo is not actually an expense is it? So to me it seems is a bit out of place as an expense in the finance window.

cheers
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: PATCH: Lost Cargo Cost

Post by planetmaker »

zooks wrote:Good idea to gain some insight on how much cargo a company is missing out.
However, lost cargo is not actually an expense is it? So to me it seems is a bit out of place as an expense in the finance window.

cheers
As if it were an argument: it's realistic ;-)

You made a transportation contract and simply dump the cargo into a waste bin to let it rot (or drop people in the middle of no-where). That usually results in fines or contract penalties ;-)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4766
Joined: 09 Sep 2007 05:03
Location: home

Re: PATCH: Lost Cargo Cost

Post by Alberth »

I like the idea, but wonder how effective it is.
Did you try it with a few savegames from others?

In my experience, only new users are not very careful about cargo delivery. Experienced players tend to make sure they move everything they get.
That means that the new users get hit by this patch, rather than the more experienced players.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: PATCH: Lost Cargo Cost

Post by planetmaker »

Actually, one of the problems with cargo rating is that it doesn't take into account turnover at all nor the time cargo is waiting at a station. Thus if you have a station with very high throughput, you easily have an abysmal rating, as there on average might be waiting a few hundret units of cargo. But you pick it up within a game day. Only to have that many delivered again the next one. This probably would need addressing somewhat as well or this would penalize high-frequency transfer terminals quite a lot where service de-facto is quite excellent.
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: PATCH: Lost Cargo Cost

Post by michael blunck »

IMO, such a feature shouldn´t be addressed locally and on a narrow timeframe, but rather globally and by accounting on a yearly basis ("penalty"), if at all.

regards
Michael
Image
User avatar
DC-1
Engineer
Engineer
Posts: 88
Joined: 13 Mar 2013 13:53

Re: PATCH: Lost Cargo Cost

Post by DC-1 »

michael blunck wrote:IMO, such a feature shouldn´t be addressed locally and on a narrow timeframe, but rather globally and by accounting on a yearly basis ("penalty"), if at all.
You can see the cargo leak realtime on the map, and of course it is shown on the finance window with yearly summary of all. Watch attached screenshot.

Alberth wrote:I like the idea, but wonder how effective it is.
Did you try it with a few savegames from others?

In my experience, only new users are not very careful about cargo delivery. Experienced players tend to make sure they move everything they get.
That means that the new users get hit by this patch, rather than the more experienced players.
You're right; i've developed this patch last night, so there was no too much testing. And because of the new option in settings, it is not compatible with previous savegames. :-/
I think the most of the patches make the game harder, so you're right again: unexperienced user can turn it off, like infrastructure maintenance, noise levels, recessions, etc.
planetmaker wrote:Actually, one of the problems with cargo rating is that it doesn't take into account turnover at all nor the time cargo is waiting at a station. Thus if you have a station with very high throughput, you easily have an abysmal rating, as there on average might be waiting a few hundret units of cargo. But you pick it up within a game day. Only to have that many delivered again the next one. This probably would need addressing somewhat as well or this would penalize high-frequency transfer terminals quite a lot where service de-facto is quite excellent.
Phh... I don't wanna change the original station rating algorithm (yet ;->). If OpenTTD says it's bad, then this patch make it worse.
I'm still planning how the cost should be generated, now it's not too expensive for an average company. I think is enough fair. So if you have a big station with thousands of cargo then the cost of lost cargo will be a minimum amount compare to the profit (like running costs).
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: PATCH: Lost Cargo Cost

Post by Eddi »

i have a minor suggestion: could the cost animation also show accumulated transfer income that is lost?

(that would be useful even when the cost is set to 0)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: PATCH: Lost Cargo Cost

Post by Zuu »

Perhaps show the amount in yellow with a negative sign. Just as transfer income is differed using yellow.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
DC-1
Engineer
Engineer
Posts: 88
Joined: 13 Mar 2013 13:53

Re: PATCH: Lost Cargo Cost

Post by DC-1 »

Sorry folks, i have no idea how to detect transferred cargo. :-/ The original algorithm just throw out some random packets of cargo without any checking. I'm interested in anyone's help.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: PATCH: Lost Cargo Cost

Post by fonso »

@planetmaker and follow-ups: Since r25362 cargo waiting at other stations is considered for the rating at the origin station.
The guy on the picture is not me, it's Alonso.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: PATCH: Lost Cargo Cost

Post by Eddi »

The accumulated transfer payment is stored in the cargopacket, so in StationCargoList::Truncate you'd have to gather this information for the dropped packets.

something else i noticed: you use st->rect to display the cost animation, but you probably should use st->xy (location of the station sign) instead.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests