Changing station rating calculation

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Casual tycooner
Engineer
Engineer
Posts: 3
Joined: 24 Mar 2023 06:03

Changing station rating calculation

Post by Casual tycooner »

I'd like to change the way station ratings are calculated, how should I go about it?
editing the source code directly doesn't sound like the most sustainable idea
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Changing station rating calculation

Post by Eddi »

station rating can be modded via station rating callback (NML version), however, this makes it incompatible with industry NewGRFs, i think.
Casual tycooner
Engineer
Engineer
Posts: 3
Joined: 24 Mar 2023 06:03

Re: Changing station rating calculation

Post by Casual tycooner »

That looks good, it doesn't quite override everything but it's a solid start, I'm not familiar with the format of the files/folders, is there a template I can use to get started?
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Changing station rating calculation

Post by Eddi »

i'd probably start with the generic NML tutorial (which doesn't do anything you want, but it should get you familiar with the basic concepts), and then look at existing industry sets. i think FIRS includes a custom rating calculation, where it flat out sets 100% rating for everything. although FIRS code may be difficult to follow, since it builds up the NML code from templates during the compile, you might need to look at some intermediate compile output to see something you can reuse in a pure NML environment.
Casual tycooner
Engineer
Engineer
Posts: 3
Joined: 24 Mar 2023 06:03

Re: Changing station rating calculation

Post by Casual tycooner »

I took a look at FIRS, it's certainly big.
Looks like it's to tutorial land for me, any other tips are welcome in the meantime :)
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Changing station rating calculation

Post by 3iff »

Take a look at viewtopic.php?t=74856

It's something I wrote, borrowed (very heavily) from Firs. Hope it helps.
If you can say what you wish to achieve perhaps we can point you in the right direction.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests