Cargo Distribution

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
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

I've done some things about the smallmap:

There is no more display as number or graphs and no more selection what stats to display. Every link is drawn in a color determined by (max(usage, planned) / capacity) of all traffic in both direction added. Specifically:
  • 0% to 33% saturation is white
  • 33% to 100% saturation is green
  • 100% to 200% saturation is orange
  • above 200% saturation is red
Additionally you can still hover over a link and see the details in the legend. I'll probably change the algorithm to take the worse of both directions instead of just adding them up and I might change the colours and ratios. Any proposals about that are welcome.
The guy on the picture is not me, it's Alonso.
Arie-
Director
Director
Posts: 593
Joined: 20 Jan 2009 16:07

Re: Cargo Distribution

Post by Arie- »

Well, it was on WWW's server with the g3f19418e build when I really noticed it. I'll see if I have a save game and leave it running for a while, to bad its a 1k*1k map so fast forward would not greatly increase speed on my computer :(.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Cargo Distribution

Post by Zephyris »

I would suggest this colour series for a nice graduated colour change for different route saturations... The colour indexes are (in decimal):

Code: Select all

15
14
103
102
101
100
99
91
92
206
207
208
209
67
190
189
188
187
186
185
184
183
182
181
180
179
178
215
Attachments
CargodistColours.png
CargodistColours.png (1.35 KiB) Viewed 2837 times
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Cargo Distribution

Post by ostlandr »

Just thought I'd pop in here again and say how much I love CargoDist. It's completely spoiled me for playing "vanilla" OTTD. The biggest frustration for me in OTTD is when you have a station that produces goods that you need to use as a transfer point; you can't do it. The vehicles will happily pick up the goods they just dropped off. :evil:
Passenger handling is great, too. In "vanilla" OTTD there is money to be made shuffling passengers around the stops of an isolated city. But with CargoDist, the citizens of OTTD have places to go. Build a couple of road & rail passenger networks, tie them together with airports (outside the city limits) and boom! 8) This really works well for valuables, too; truck them to and from the airport, and fly them between cities with banks. Never worked satisfactorily with regular OTTD for the reason stated above.
Who is John Galt?
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

I'm very glad to see some activity again in this thread, it's been a bit quiet for a while :)

Since there seems to be a (much needed) smallmap rework in progress I thought I'd throw in my 2 cents...
I should start by saying that I don't exactly like it in the first place. With the requirements that CD has for it, it becomes a less detailed, less functional secondary main view of sorts. Also, it doesn't suit my needs too well.
I mainly need the map for 2 things: first I need to figure out where stuff is, i.e. highlight industries or display only specific ones and so on. For this a simple overlay on the main view would be much more helpful, as I spend most of my time searching for stuff on the smallmap, the trying to locate it in the main view to evaluate distances, terrain and so on. For this part the map is usually in the way and I minimize or close it. The second thing is the link graph saturation/usage, for which it has worked reasonably well, but again: overlaying the information on the main view would be much more helpful.

I doubt that you have the spare time to implement a change of such proportions, and quite frankly it isn't even really related to cargodist (more of a general issue), but I thought I might as well mention it as there could be a tiny chance this can be done at some point :)

About the currently planed/implemented changes, I haven't had time to check out the new version yet but it sound very good! Had never thought about this much, but in most cases I only want to see one cargo type and have an easy overview of the network, which this accomplishes in a much simpler way than before. Sounds great! I do hope you find a way to separate the directions though, as that's usually the information I'm interested in the most.

Also: +1 forZephyris' color series!
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Cargo Distribution

Post by Rubidium »

ostlandr wrote:The biggest frustration for me in OTTD is when you have a station that produces goods that you need to use as a transfer point; you can't do it. The vehicles will happily pick up the goods they just dropped off.
Oh, you mean you'd like some order to tell vehicles to not load cargo at a specific station? Similar to the "no unloading" unload-order?

Good news: now there is such a feature in OpenTTD using the "no loading" load-order. Although... "new" might be inappropriate for something that's been part of OpenTTD's stables for 4.5 years.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Cargo Distribution

Post by Zephyris »

Directionality could be done with something like this... Wouldn't work well for very short routes though, but might be ok with a 2x zoom on the minimap.

*edit* Ignore the font sizes! Thats the next step in my big GUI project...
Attachments
minimapdiridea.png
minimapdiridea.png (49.65 KiB) Viewed 2735 times
el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

Rubidium wrote:
ostlandr wrote:The biggest frustration for me in OTTD is when you have a station that produces goods that you need to use as a transfer point; you can't do it. The vehicles will happily pick up the goods they just dropped off.
Oh, you mean you'd like some order to tell vehicles to not load cargo at a specific station? Similar to the "no unloading" unload-order?

Good news: now there is such a feature in OpenTTD using the "no loading" load-order. Although... "new" might be inappropriate for something that's been part of OpenTTD's stables for 4.5 years.
Yes, but sometimes you want them to pick up something. Just not the stuff they just dropped off!
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Thanks for all the comments. I've changed the smallmap to show the worst link's colour instead of all links aggregated. I think this is the best we can do without adding too much information. The idea with the two lines next to each other is nice, but they'd be hard to discern and there's no space for the arrows on short links. I've also adopted Zephyris' colours for the links but I think I'll need to change them some more. I don't like the black as final colour. It should be bright red as that tells me there is something wrong. Also the darker shades of green should be the ones signifying more saturation. It feels wrong that the darkest green means about 50% saturation while there are lighter shades for both less and more. Yes, I know the shades for less saturation are a little blueish but for me those are hard to tell apart - well maybe I'm a little blind ;)
The guy on the picture is not me, it's Alonso.
Creat
Traffic Manager
Traffic Manager
Posts: 141
Joined: 26 Oct 2009 16:33

Re: Cargo Distribution

Post by Creat »

yea now that you mention it, that seems a little odd... are there any actual blue tones you could use for the below 50% range? I think green(ish) for 50-100 is perfect, as that's the range you want your saturation to be in.

About the arrows: I'd really love those (and dual lines, if possible) even if they are problematic on short links, at least the information is there to zoom into. You could only display the arrows (and two lines) if the current zoom level places the stations X pixels apart (where it's known not to be an issue). So for those rare super-short links (or a very zoomed out minimap) the information is only one link, but usually (at least if you zoom in a little) there would be two lines, possibly with arrows :D
The arrows are still optional though, I think. if you view those links like streets, the right hand side (or left, if that option is set in advances preferences) would show the flow out of a station, the left one the incoming one. (having a little difficulty explaining what I mean, but I hope you get the point?)

anyway, that would really be extremely helpful, as there would rarely be reason to view the mouse-over and everything is clear with one look at the map.
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Cargo Distribution

Post by Wasila »

Pics?
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Cargo Distribution

Post by Zephyris »

I'll Have another play with the colours and see what I can get...
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

i had a green-red-scale in my stuck trains patch.

Code: Select all

/**
 * Colour Coding for Stuck Counter
 */
static const uint32 _stuck_counter_colours[] = {
       MKCOLOUR(0xD0D0D0D0),
       MKCOLOUR(0xCECECECE),
       MKCOLOUR(0xBFBFBFBF),
       MKCOLOUR(0xBDBDBDBD),
       MKCOLOUR(0xBABABABA),
       MKCOLOUR(0xB8B8B8B8),
       MKCOLOUR(0xB6B6B6B6),
       MKCOLOUR(0xB4B4B4B4),
};
assert_compile(lengthof(_stuck_counter_colours) == 8);
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

I think I like this one:

Code: Select all

0x0f, 0xd1, 0xd0, 0x57,
0x55, 0x53, 0xbf, 0xbd,
0xba, 0xb9, 0xb7, 0xb5
white -> green for everything below 100%, orange -> red for everything above. Btw, I've found a page in the ttdpatch wiki where all those codes are mapped to visible colours ... just for those of you who also feel the urge to write a little program to do this for you:

http://wiki.ttdpatch.net/tiki-index.php ... oordinates
The guy on the picture is not me, it's Alonso.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

fonso wrote: Btw, I've found a page in the ttdpatch wiki where all those codes are mapped to visible colours
There used to be "ottd-colour-palette.gif" in the docs folder, animated and all, but it was removed recently. I do not recall which revision exacly but the changelog mentioned it being broken. It was the same palette as the windows palette at the bottom of the wiki page you linked.


I also have a small request while I am here.
In the version against r20853 you have changed the cargolinks to change colour according to cargoflow. Me likes but I also liked the links coloured according to the cargo-type being transported. Any chance to have that back somewhere in the future, please?
Maybe with a button like there used to be for showing the graphs but only one instead of 6, when you click it the game togles between the recouloring flow and the type?
If not possible or too much work I can understand.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Cargo Distribution

Post by Yexo »

ChillCore wrote:
fonso wrote: Btw, I've found a page in the ttdpatch wiki where all those codes are mapped to visible colours
There used to be "ottd-colour-palette.gif" in the docs folder, animated and all, but it was removed recently. I do not recall which revision exacly but the changelog mentioned it being broken. It was the same palette as the windows palette at the bottom of the wiki page you linked.
It was in r20811, see FS#4079 for the original bug report. I'll re-add the file if anyone provides a fixed version (no dithering, correct palette) animated gif for both the windows and the dos palette.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Thank you for the link Yexo.
The palettes at the wiki are the correct ones?
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Re: Cargo Distribution

Post by Zephyris »

ChillCore wrote:The palettes at the wiki are the correct ones?
Yup...
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2864
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Thank you Zephyris for your quick reply, sorry for hijacking your thread fonso.

Maybe we can continue the discussion about the animated palette here:
http://www.tt-forums.net/viewtopic.php?f=26&t=50264
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

ChillCore wrote: I also have a small request while I am here.
In the version against r20853 you have changed the cargolinks to change colour according to cargoflow. Me likes but I also liked the links coloured according to the cargo-type being transported. Any chance to have that back somewhere in the future, please?
Maybe with a button like there used to be for showing the graphs but only one instead of 6, when you click it the game togles between the recouloring flow and the type?
If not possible or too much work I can understand.
No, sorry. I'm trying to reduce the complexity of the smallmap, not add to it. You can figure out which cargos are travelling on a certain link by selecting only one cargo at once. Also the station colours will usually give you a clue.

I have now implemented the idea with two lines per link, one for each direction. Also I have made the station dots significantly smaller. Now most of the time you can see the links, even within towns, at the default zoom level. Unfortunately it's hard to catch those with the mouse hovering. So, now I'm thinking about also removing that mouse-hovering-details-in-legend thing and then the zoom-in. After that the smallmap should still be good enough to see the most important information while at the same time not violating OpenTTD's design principles.
The guy on the picture is not me, it's Alonso.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests