Industry rating

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

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Industry rating

Post by SirkoZ »

Gonozal_VIII wrote:it doesn't matter much if the industry rating is low in ttd, it's not worth the effort to sabotage a player that way, you'll only cut some percent of the production of that industry but it matters a lot for georges industries, they close down if the rating is low
edit: and where is the logic in the fact that an industry that's serviced by two stations produces less than it would with only one station? that's clearly a bug and just because it's a bug that has already been there in ttd doesn't mean that it shouldn't be fixed
No, I don't think it's a bug - it's just been programmed that way in TTD so to make competition stiffer.
Of course - one could always improve it, but I think the original idea was to get station ratings down.

To ruin that challenge, I'll tell you - you can easily overcome that with a company statue in town, no matter how stupid or idol-worshiping that is. :mrgreen:
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Industry rating

Post by Bilbo »

SirkoZ wrote:To ruin that challenge, I'll tell you - you can easily overcome that with a company statue in town, no matter how stupid or idol-worshiping that is. :mrgreen:
Once I have enough money, I build these statues in all towns where I have some transportation ...
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)
Gonozal_VIII
Traffic Manager
Traffic Manager
Posts: 165
Joined: 03 Dec 2007 15:06

Re: Industry rating

Post by Gonozal_VIII »

SirkoZ wrote:I think the original idea was to get station ratings down.
i think you didn't get the whole point, the station rating doesn't go down, you can have a station rating of 90% and industry rating still won't rise above 70% or something because someone built a crappy station next to yours
SirkoZ wrote:To ruin that challenge, I'll tell you - you can easily overcome that with a company statue in town, no matter how stupid or idol-worshiping that is. :mrgreen:
that won't help, even with 100% station rating (you can never hold that anyways) an opponent can drag you down without any effort and cause industry closure
industry rating should NEVER be lower than the rating of the best station servicing it. the distribution and rating should be like that: best station (rating x) gets x% of the total production, next station(rating y) gets (100 - x) * y% of the total production.
example: station a has 80% rating, station b has 40%, industry production per month is 1000 units
industry rating is 80+20*0,4 = 88% therefore total distributed production is 880
station a gets 800 units of those and station b gets 80
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Industry rating

Post by George »

SirkoZ wrote:
George wrote:
PhilSophus wrote:Well not necessarily better, but nevertheless not worse. I would find the following conditions also logical:
1) Industry rating is never better than the maximum of the two station ratings
Totally disagree! Gonozal_VIII is right. Such rule would become the way for sabotage X(
Same in TTD - will you change that too? Any settings in TTDPatch yet to overcome that "problem"?
I supposed distribution formula is different in TTDP, isn't it?
Image Image Image Image
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Industry rating

Post by SirkoZ »

Gonozal_VIII wrote:
SirkoZ wrote:I think the original idea was to get station ratings down.
i think you didn't get the whole point, the station rating doesn't go down, you can have a station rating of 90% and industry rating still won't rise above 70% or something because someone built a crappy station next to yours
Sorry - I mean % transported, not station rating.

Isn't that done there to sort of increase the challenge?
Come to think of it - in TTD the only competitors were AI (and perhaps over the cable second player) - and with AI's bonus ratings - it sure was one big challenge to compete with the AI.
I'm sure TTDPatch has the same thing.

However - if we want it here in oTTD for multiplayer (no station bonuses) then we would perhaps need a better algorithm.
I also noticed from the dihedral competition server 4 (down now) that the only problem with % transported under 60 was with slow trains or road vehicles...
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Industry rating

Post by DaleStan »

First and foremost: STOP CALLING IT "INDUSTRY RATING"!! Industries have percent-transporteds, they do not have ratings.
George wrote:I supposed distribution formula is different in TTDP, isn't it?
It is. As I understand it, with a,b as percentages, the industry percent-transported is min(100, a+b). The ratios of produced to distributed cargo are a/max(100, a+b) and b/max(100, a+b).

So, a single station with rating X, and two stations, one rated X and the other rated 0, will function the same for the owner of station X. In fact, until a+b exceeds 1, both stations behave as if the other station was not there.

So, yes, you can sabotage your opponents, but only by providing a service that rivals theirs, and the standard form -- getting a higher rating to steal all the cargo -- fails miserably.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Industry rating

Post by PhilSophus »

I have continued thinking about it a bit. What we need is sum-like function t = f(a,b), where a and b are the station ratings and t is the fraction of cargo transported with the following properties (note I take the range 0..1, so just divide percentages by 100):

1) f(a,b) <= 1 for all a <=1 and b <= 1 (never transport more than 100% :wink: )
2) f(a,b) >= max(a,b) (building additional stations can not decrease the transported cargo)

I remembered a function from physics known as relativistic velocity addition and similar to that would propose the following (note that b is lower rating of both if they are unequal):

t = (a+b/2)/(1+a*b/2)

The amount of cargo transported to each station is just:

If a = b: amount1 = amount2 = total_amount * t / 2 (so each gets half)

Otherwise (a > b):
amount1 = total_amount * a/(a+b/2) * t
amount2 = total_amount * (b/2)/(a+/b/2) * t

As you can see the sum is always total_amount * t.

What do you think?
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Gonozal_VIII
Traffic Manager
Traffic Manager
Posts: 165
Joined: 03 Dec 2007 15:06

Re: Industry rating

Post by Gonozal_VIII »

i've calculated some values with those functions and i like the results very much, there's a quite large difference between equal ratings and slightly different ratings but that's only fair... better is better, even if it's only a bit. unless somebody knows something that would fit even better, i would vote for implementing that function :-)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Industry rating

Post by DaleStan »

PhilSophus wrote:t = (a+b/2)/(1+a*b/2)
Why is only the smaller rating halved? My recollection of physics says that such things should be symmetric.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Industry rating

Post by PhilSophus »

DaleStan wrote:
PhilSophus wrote:t = (a+b/2)/(1+a*b/2)
Why is only the smaller rating halved? My recollection of physics says that such things should be symmetric.
The idea behind this, is the following: If you already have a station that serves the industry and provide another station with worse rating (or even equal), the latter is of much less use for the industry than the first one.

Of course, in physics the formula is (u+v)/(1+u*v) and I also tried that first, but to my taste, with this formula the transported goods ratio increases to aggressively when providing a second station. Surely, one can fine-tune a bit by varying k in the following formula: (a+k*b)/(1+a*k*b), but the values for k=0.5 looked quite good.

I don't know if I already mentioned that: Not having a second station is counted as b=0 in the formula I gave.

Implementing this is pretty straightforward and just a few lines of modification. I'll provide a small patch this evening, so that everyone can try, if it feels right with this patch.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Industry rating

Post by SirkoZ »

Any patch yet, folks?

Of course creating one you ought to look at the all the rating fix attempts for oTTD that were made up till now (SourceForge's patch list and that spray for flies). Looks like old SourceForge pathc/bugs site doesn't exist anymore...
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Industry rating

Post by PhilSophus »

SirkoZ wrote:Any patch yet, folks?
Here you are. The attached patch implements the formula I suggested above. Actually, quite short, most of it are comments :wink:
SirkoZ wrote:Of course creating one you ought to look at the all the rating fix attempts for oTTD that were made up till now (SourceForge's patch list and that spray for flies). Looks like old SourceForge pathc/bugs site doesn't exist anymore...
I would agree if implementing the suggestion was a lot of work. But since it is not, I guess providing a patch, trying how it affects game play and then discussing advantages and drawbacks seems the better way. And I did not intend to put too much time into this :mrgreen:

EDIT: Use -d station=4 to see the debug output of the modification.
Attachments
improved_station_distrib_r12035.patch
(2.58 KiB) Downloaded 101 times
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Industry rating

Post by SirkoZ »

PhilSophus wrote:
SirkoZ wrote:Any patch yet, folks?
Here you are. The attached patch implements the formula I suggested above. Actually, quite short, most of it are comments :wink:
Nice! Thx - will test it with my new default_AI_improvement patch (only longer train stations first but lots of comments).
PhilSophus wrote:
SirkoZ wrote:Of course creating one you ought to look at the all the rating fix attempts for oTTD that were made up till now (SourceForge's patch list and that spray for flies). Looks like old SourceForge pathc/bugs site doesn't exist anymore...
I would agree if implementing the suggestion was a lot of work. But since it is not, I guess providing a patch, trying how it affects game play and then discussing advantages and drawbacks seems the better way. And I did not intend to put too much time into this :mrgreen:
Indeed - I wholly agree - as with all my patches - I aim to do a lot with as little changes as possible.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests