Detailed Station 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

Post Reply
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Detailed Station rating

Post by KeldorKatarn »

Would anybody doing patch packs be interested in this? If so I'll try to create a standalone patch based on trunk and make it available here.
Attachments
station_rating.jpg
station_rating.jpg (607.12 KiB) Viewed 164 times
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Detailed Station rating

Post by _dp_ »

Nice idea, I like it. Should be useful as many people ask about those ratings.
But as for including it depends on how you actually do it. For example, we use different style for popup windows so I may decide that it's easier to do it anew than try to fix your patch.
Attachments
citymania-info-popup.png
citymania-info-popup.png (59.95 KiB) Viewed 2067 times
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Detailed Station rating

Post by _dp_ »

I'd also put it like this I think:

Max speed of last vehicle: 129 km/h (+11%/24%)
Days since last pickup: 4 (+51%/51%)
Units of cargo waiting: 1567 (-35%/16%)
Statue in town of station: no (0%/10%)
Total target rating: 40%
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Detailed Station rating

Post by KeldorKatarn »

Ot's not a popup, it's a tool tip. And that's the tool tip style. I just use the tooltip functionality that's already there.
As for showing the concrete values... I didn't do that because I cannot get the speed of the last vehicle. The game pre-processees that first
so all vehicle types get a comparable rating despite their very different speeds. Also the time between pickups is handled differently for ships.
So I have no direct access to that data. I'd have to store lots of additional data. I'll check but seems to be a bit much. All the player needs to know is how he can improve things.
AS for the colors or the values next to their description: YOu can't read other colors well on the yellow tool tip background and the tooltip has a maximum width. It doesn't all fit in there.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Detailed Station rating

Post by KeldorKatarn »

Here's the code. Careful I changed the way ratings work a slight bit, especially where the speed of vehicles is concerned. But people
dealing with patch packs should be able to extract what they need. The changes are nothing major. It's mostly in the station_gui.cpp

https://github.com/KeldorKatarn/OpenTTD ... ion_rating

I also adjusted the looks.
Attachments
station_rating.jpg
station_rating.jpg (320.49 KiB) Viewed 1987 times
station_rating_newgrf.jpg
station_rating_newgrf.jpg (257.67 KiB) Viewed 1987 times
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Detailed Station rating

Post by _dp_ »

Popups, tooltips, words :p Anyhow, they are different, also can't break compatibility with vanila so ended up not using your code at all. Well, thanks for inspiration anyway :)
For anybody interested in my version it's here: https://bitbucket.org/pavels/cmclient/c ... c64559435c Should be somewhat compatible with trunk.
Attachments
citymania-detailed-ratings.png
citymania-detailed-ratings.png (48.1 KiB) Viewed 1897 times
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Detailed Station rating

Post by KeldorKatarn »

Nice looks. I might adjust mine to take this layout. I just wanted to avoid creating a completely new widget setup initially. But now that I see this it's probably worth the effort :)
With this code you'll get the wrong output for units waiting though whenever the destination station punishes you temporarily. There's no way to check for that and the vanilla game also
calculates that a bit wrong. But the visuals are neat :)
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Detailed Station rating

Post by _dp_ »

Yeah, I noticed that extra penalty, but decided not to show it, at least for now. Mostly because I don't see a good way to do it while maintaining vanila compatibility.
KeldorKatarn
Transport Coordinator
Transport Coordinator
Posts: 274
Joined: 13 Apr 2010 21:31

Re: Detailed Station rating

Post by KeldorKatarn »

It's also pretty broken in vanilla, which is why I changed how it works. I updated my visuals to reflect yours somewhat. I also added the vehicle type behind
the speed rating and because I use the real speed instead of the processed speed to confuse the player yes. I also call it "cargo waiting (on average per next stop)"
because that's what the game does if CargoDist is active. otherwise the nnumbers wouldn't fit and also confuse the player.

Thanks for doing the work of creating the visuals. Cool stuff :) Might give me ideas for future stuff like this ;)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests