Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

More player colors

Started by Vladki, April 05, 2021, 06:29:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



I feel that there could be more objects using player colors in pak128.britain.  I understand that vehicle liveries tend to follow real life in this pakset, but there is place for player colors on metal constructions. Currently mostly on bridges. Also some small details on stations, depots and signalboxes. I'd like to add more - especially the cranes on docks, shipyards and stations.

I'll try that myself, but what I wanted to ask, is if adding player colors is done purely in "postprocessing" on the rendered PNG's, or if should I first use blender to repaint the structures?


If you are doing post-processing, you may enjoy the alter_hue tool, a short Perl script that lets you easily change one or more ranges of hues to player or alternate gradients (or back again).  This is part of my simutrans-pak-tools on github.
An example use would be:

./alter_hue -i stations/goods-sidings-crane.png -o /tmp/new-crane.png 80-p
which would change the green parts of the goods-sidings-crane to colors in the player gradient.  I used Gimp to determine the hue (be sure to select HSV in the color dialog).


Oh great. I'll try that. I am experimenting with the gimp-simutrans tools, and the harbour-goods-modern, which already is in color quite close to player color.
But trying to "repair" it to player color gives similar result to yours. Threshold 21 is too low - does not fix all pixels, and threshold 22 destroys the shades...

EDIT: this is great tool. First try with the harbour crane looks quite good. Unfortunately it chose too bright player colors, and the darkest part remained almost black for all players. Also it is brighter in comparison with the road cargo bay with crane (TruckStopMedium1920), Thus the details are less visible. Is there any tweak for "darkening" ?

Intermediate result here:


Excellent suggestion.  I have updated the program slightly to permit specifying a level offset in percentage, when converting to player colors. The default (and formerly fixed) level offset is 10%.  Here I use an offset of 30%, given with the L suffix:

./alter_hue -i simutrans-pak128.britain/stations/harbour-goods-modern.png -o /tmp/crane.png -v 188+5-aL30
There is now also a -v for verbose flag as well, to clarify how the (admittedly somewhat cryptic) arguments have been parsed.


Wow, thanks. I thought if the difference between road and docks crane is in the rendering - new transparent workflow, vs. old classic. That may be why the road crane looks a bit thinner and more detailed.


I found out that for the automatic coversion, the brightness would have to go UP, not down, but the tool allow only darkening. Anyway I just replaced all the dark places with the darkest shade of player color, and the result is here, along with the original crane for comparison. Also added the shipyard. But the snow image for shipyard needs more attention :-( The current snow image is not very nice - the snow is "transparent" so it makes the whole crane kind of pink coloured, and that is not possible with player color.


I committed a small change that permits negative values for the level offset, e.g., 188+5-pL-20 ... if that helps


I agree that the pakset needs more player colour - although the colours are brighter than the rest of the theme. The crane looks good and shows how it could be done to just puncture the realistic brown/grey concrete and brick feel without shifting the sets overall British-ness.

Lovely stuff!


I have only just seen this post, as the notification went into my spam folder. Player colour is difficult as this cannot be done wholly in Blender, necessitating complex post-processing steps for each graphic. I did look into whether there was a way of doing this entirely in Blender at one point (there is a post on the Blender forum about it some years ago), but it was a long way from being feasible.

The crane would probably look better if either just the cab part or just the support part were in player colour rather than both - but I appreciate that this might make it rather harder to deal with. Another issue with player colour is that I am not sure that the alpha blending is possible with player colour (can we check this?), and adding alpha blending will make the legs look a lot better, and the whole crane look significantly better.

What are people's views on how useful that the player coloured crane is as a UI tool compared with the somewhat detrimental aesthetic impact?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


I think that semitransparent player color should work. So then there is an option to do the blending by simutrans engine, in these two scenarios:

Everything except the crane is backimage, crane is frontimage and uses only player colors with varying level of transparency (alpha channel). That allows antialiasing of crane edges and legs.

Everything including the crane is backimage, and the snow is frontimage. That allows better blending of thin snow/frost cover on the crane - that would be nice on the shipyard or rail station crane. But at the same time both of these need front/back image even in summer version.

I don't know who made the road loading bays. The cranes there look much better (thinner legs, good snow cover, full range of player color shades). So if the same process would be applied to the other cranes, the result would be much better than mine.

Also we have two player colors so we can use one for the cab and the other for the legs or vice versa.