Station ratings

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Station ratings

Post 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 695 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 13189 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 260 times
Last edited by 3iff on 19 Nov 2019 10:17, edited 2 times in total.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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).
Attachments
rating10beta1.grf
(3.03 KiB) Downloaded 490 times
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Station ratings

Post 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.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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.
User avatar
Mizari
Traffic Manager
Traffic Manager
Posts: 136
Joined: 22 Apr 2012 14:21

Re: Station ratings

Post by Mizari »

Thank you. Finally, I don't have to have way more trains than necessary to keep the rating high.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Station ratings

Post 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.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Station ratings

Post 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.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Station ratings

Post 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 ;)
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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:
taufik97
Engineer
Engineer
Posts: 4
Joined: 21 Apr 2015 10:02

Re: Station ratings

Post by taufik97 »

thank you very much, this is what i need :D
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: Station ratings

Post 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.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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.
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: Station ratings

Post 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?
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Station ratings

Post 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
Image
LabUser
Engineer
Engineer
Posts: 38
Joined: 21 Feb 2016 12:10

Re: Station ratings

Post 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?
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Station ratings

Post 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.
User avatar
Kalen
Traffic Manager
Traffic Manager
Posts: 160
Joined: 07 Jun 2008 22:07
Location: Portugal

Re: Station ratings

Post 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.
User avatar
Ben1338
Traffic Manager
Traffic Manager
Posts: 171
Joined: 17 Nov 2007 17:23
Skype: ben313371

Re: Station ratings

Post 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?
User avatar
Kalen
Traffic Manager
Traffic Manager
Posts: 160
Joined: 07 Jun 2008 22:07
Location: Portugal

Re: Station ratings

Post 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.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests