The International Simutrans Forum

 

Author Topic: More player colors  (Read 474 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki

  • Devotee
  • *
  • Posts: 3711
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
More player colors
« on: April 05, 2021, 06:29:21 PM »
Hello,

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?

Offline wlindley

  • Devotee
  • *
  • Posts: 1055
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: More player colors
« Reply #1 on: April 05, 2021, 07:50:38 PM »
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:

Code: [Select]
./alter_hue -i stations/goods-sidings-crane.png -o /tmp/new-crane.png 80-pwhich 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).

Offline Vladki

  • Devotee
  • *
  • Posts: 3711
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: More player colors
« Reply #2 on: April 05, 2021, 07:57:13 PM »
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:

« Last Edit: April 05, 2021, 08:47:19 PM by Vladki »

Offline wlindley

  • Devotee
  • *
  • Posts: 1055
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: More player colors
« Reply #3 on: April 05, 2021, 11:26:55 PM »
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:

Code: [Select]
./alter_hue -i simutrans-pak128.britain/stations/harbour-goods-modern.png -o /tmp/crane.png -v 188+5-aL30There is now also a -v for verbose flag as well, to clarify how the (admittedly somewhat cryptic) arguments have been parsed.
« Last Edit: April 07, 2021, 10:04:49 PM by wlindley »

Offline Vladki

  • Devotee
  • *
  • Posts: 3711
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: More player colors
« Reply #4 on: April 06, 2021, 07:00:22 AM »
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.

Offline Vladki

  • Devotee
  • *
  • Posts: 3711
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: More player colors
« Reply #5 on: April 06, 2021, 07:51:03 PM »
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.




http://list.extended.simutrans.org/~simutrans/building.PlayerGoodsHarbour.pak
http://list.extended.simutrans.org/~simutrans/building.PlayerBoatyard.pak
« Last Edit: April 06, 2021, 10:08:47 PM by Vladki »

Offline wlindley

  • Devotee
  • *
  • Posts: 1055
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: More player colors
« Reply #6 on: April 07, 2021, 10:05:50 PM »
I committed a small change that permits negative values for the level offset, e.g., 188+5-pL-20 … if that helps

Offline KneeOn

  • Devotee
  • *
  • Posts: 247
  • Pak64.GB
  • Languages: EN
Re: More player colors
« Reply #7 on: April 08, 2021, 10:35:08 PM »
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!

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20715
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: More player colors
« Reply #8 on: April 16, 2021, 09:15:39 PM »
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?

Offline Vladki

  • Devotee
  • *
  • Posts: 3711
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS
Re: More player colors
« Reply #9 on: April 17, 2021, 09:41:56 AM »
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.