Page 1 of 3

Station ratings

Posted: 25 May 2016 09:34
by 3iff
Version 1 now released - Here now and maybe at bananas later. All the files included, including source files so you can compile it yourself should you wish. Just drop this file into your newgrf folder. There's also a readme which might be useful.
Ratings1.0.tar
(18 KiB) Downloaded 705 times
--------

It seems that the latest FIRS has removed the station ratings control option. Well, as at least one player has been begging for it to be replaced, I thought I might be able to create a newgrf that does this.

It remains in SPI (my industry set based on FIRS) but I've just had a go at reusing the code to create a newgrf that does the station ratings bit...

...and it works. Just coal for now but as the screenshot shows, it works. That's the only newgrf loaded and I have a rating of 100% at that station...

I obviously have some work to do but I can possibly get a version soon for players to test.
Sarhattan Transport, 3rd Jun 1940#1.png
Sarhattan Transport, 3rd Jun 1940#1.png (106.04 KiB) Viewed 13492 times
I'm now busy thinking of how much I can customise this.

New version 19-Nov-19 to include 64 cargoes. UNTESTED - but hopefully it will work. It should be compatible with industry sets using fewer than 64 cargoes. It may only be compatible with later versions of OTTD (1.9x or 1.10x). Please report if it works (or doesn't).
ratings15.grf
(6.08 KiB) Downloaded 266 times

Re: Station ratings

Posted: 25 May 2016 12:42
by 3iff
Station Ratings newgrf - BETA 1
======================

Should probably be called Cargo Ratings, what do you think?

This uses much of the code as from FIRS 1.4.3 by andythenorth.

This is a standalone newgrf that provides the opportunity to change station ratings, choosing one of the following:

Grim and Mean - exactly as standard OTTD
Favourable - Less harsh than standard
Insanely Generous - Always 100% (but will take time for a new station to reach this level).

As only 32 cargos are available, this newgrf configures every one except those listed below to use the selected station rating setting. This means that it should work for every industry set (even the default industries) and all climates without extra customisation. I've done a quick test of all except Toyland...I'm not going there.
Passengers and mail are NOT affected by this newgrf. Enough appear during the game and we don't need more.

CargoID
0 - Passengers, assuming passengers use cargo slot 0 everywhere.
2 - Mail, assuming mail uses cargo slot 2 everywhere.
30 - NARS 2 gearing (if there's a genuine cargo here then it won't be affected. This needs some thought).

Using this with an industry set that offers station rating changes may have unexpected consequences.
Specifically, any FIRS versions that have this option and SPI v1 and v1.1

BUG REPORTS are very welcome. Hopefully there won't be any (bugs).
Comments and suggestions are also welcome.

Licensed under GPL(v2).

Re: Station ratings

Posted: 25 May 2016 14:23
by Alberth
I don't understand why you cannot just set cargo 30 too, there isn't any cargo gearing, but that shouldn't be a problem, would be my guess.

Re: Station ratings

Posted: 25 May 2016 14:35
by 3iff
It was disabled in the FIRS code so I carried it over to here. I will probably add cargo 30 too, eventually...that's what the beta is for, comments and suggestions.

I'm just a bit wary of breaking something that I don't need to break, especially stuff I don't understand.

Re: Station ratings

Posted: 25 May 2016 16:20
by Mizari
Thank you. Finally, I don't have to have way more trains than necessary to keep the rating high.

Re: Station ratings

Posted: 25 May 2016 17:39
by Alberth
From a FIRS point of view, if you provide station ratings for FIRS, then you shouldn't provide station ratings for non-FIRS cargoes. At least, that seems a reasonable argument against changing it.

Since Andy stayed away from cargo 30 to keep compatibility with NARS(?) train set, it would make sense to also stay away from changing its station ratings as well.

Re: Station ratings

Posted: 25 May 2016 20:17
by andythenorth
Alberth wrote:Since Andy stayed away from cargo 30 to keep compatibility with NARS(?) train set, it would make sense to also stay away from changing its station ratings as well.
Nah :D I'd do cargo 30 as well, it's not going to do any harm to NARS 2, and excluding it is more likely to have unexpected side effects when/if some set does use cargo 30 ;)

Nice to see this grf. Station rating hack it is a useful feature for some styles of play, but didn't belong inside FIRS.

Re: Station ratings

Posted: 26 May 2016 07:45
by 3iff
Alberth...can you make up your mind? :wink:

I decided to go with modifying cargo 30 anyway, mainly for consistency. When coding this, I thought cargos were relevent by name but now I see it's just cargo slots regardless of which cargo has been allocated to that slot.

I've added a check for FIRS/SPI that already include this facility (just a bit of testing required). I have a bit more to check but it should be mainly finished.

andythenorth: Actually, most of this is your code, I just put it in the right order. :) (You may not get that reference though).

I should have a proper version 1 ready later today, maybe. It will be compatible with the beta version.

Version 1 now released, see post 1 of this thread.

Re: Station ratings

Posted: 26 May 2016 13:12
by andythenorth
3iff wrote:Actually, most of this is your code, I just put it in the right order. :)
I think that yexo wrote this originally, my contribution was only to delete it from FIRS 2 ;)

Re: Station ratings

Posted: 26 May 2016 14:06
by 3iff
Apologies to Yexo then, it's not easy to work out who did what...

I'd hate to give you credit for something you didn't do... :wink:

Re: Station ratings

Posted: 13 Jun 2016 03:16
by taufik97
thank you very much, this is what i need :D

Re: Station ratings

Posted: 13 Dec 2016 12:17
by Ben1338
Hey there, I was going to attempt a project similar to this.

I was wondering if this GRF can be expanded to include these settings https://wiki.openttd.org/Game_mechanics#Station_rating and have the ability to change every single parameter separately within OTTD instead of bundling them all into a single setting, it's something that I didn't like about FIRS.

I'm willing to lend a hand in the project as I was hoping that I could make it myself, but I don't have the know-how to do that yet.

Re: Station ratings

Posted: 22 Dec 2016 10:18
by 3iff
I've no idea if those values can be accessed via newgrf. If they can then it should be easy to amend them.

My internet access is sporadic so it can be just once every 2 weeks or so. If you can find out more on this subject in the meantime...
Just reply here if you discover anything.

Re: Station ratings

Posted: 22 Dec 2016 13:44
by Ben1338
Before FIRS, I didn't know that station ratings could be altered in the way the newGRF accesses them.

As for GRFs in general, I have no idea on where to begin.

I looked at the nml with a text editor and it seems easy enough to work with, granted once I actually get familiar with the language.

https://newgrf-specs.tt-wiki.net/wiki/NML:Main The problem is that I find the wiki so hard to work with when introducing myself into the NewGRF language because I find that it doesn't explain the topic well enough for me to understand.

Also, about those values, in the event that they cannot be accessed, the NML language should be able to emulate it, right?

Re: Station ratings

Posted: 22 Dec 2016 15:06
by michael blunck
Ben1338 wrote: I was wondering if this GRF can be expanded to include these settings https://wiki.openttd.org/Game_mechanics#Station_rating and have the ability to change every single parameter separately
Yes, it can (partly):

- amount of cargo waiting -> var60
- days since last cargo pickup -> var61
- max speed last veh -> var64
- age in years last veh -> var64
- statue in town
- advertising campaigns
- rv crashed
- train crashed

=> custom station rating calculation -> CB145 allows to modify first 3 values for station rating calculation

regards
Michael

Re: Station ratings

Posted: 19 Feb 2017 11:09
by LabUser
While quite useful and will be fun to play around with, is there a way of extending this to also include Passenger and Mail cargo ratings?

Re: Station ratings

Posted: 07 Mar 2017 11:19
by 3iff
There may be, but I have no intentions of doing this at the moment. I find that pass/mail are always overwhelming anyway and I can never keep up with them. I hardly need even more. Also, I'm using the JGR version and that has a way of controlling town generation of pass/mail. I always turn this down.

Re: Station ratings

Posted: 15 Mar 2017 19:24
by Kalen
LabUser wrote:While quite useful and will be fun to play around with, is there a way of extending this to also include Passenger and Mail cargo ratings?
This GRF comes with the source, so you can quite simply add the two remaining cargoes to the NML file and recompile it, and that should do the trick.

Re: Station ratings

Posted: 24 Mar 2017 15:49
by Ben1338
Well, that's interesting, I've been trying to compile the source as-is following https://www.tt-wiki.net/wiki/NMLTutoria ... sing_NML_3, Including "Klmnc ERROR: "ratings.nml", line13: Unknown string "STR_GRF_NAME"

I've tried to implement patches by substituting them with names, and they seem to work. But I wondered if it compiles okay for you?

Re: Station ratings

Posted: 25 Mar 2017 01:16
by Kalen
That's weird. I didn't have to do anything special at all; just downloaded the NML win32 bundle from the link in the wiki, extracted the NewGRF source to the same folder as NML, performed edits, then used the nmlc ratings.nml command in the command prompt and that was it, it compiled successfully for me.