CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
574 stars 85 forks source link

Improve Lane Connection Arrow Heads #1500

Open kianzarrin opened 2 years ago

kianzarrin commented 2 years ago

image from #1492 the following changes was made to lane connection tool:

The borders of lane arrows are curved. we need to make it sharp. also another problem is that the arrows for forward connection goes under the backward connection. we need both arrows on top and the lane color to be average of both connections.

kianzarrin commented 2 years ago

I didn't manage to change alphaBlend for texture overlay. so the only way I can think of to fix this is:

foreach connection in connections:
    render all black wire/arrow-haed borders 
foreach connection in connections:
    render all wire/arrow-head fill colors.
    if bidirectional connection (need to cache such information).
        mix colors for fill wire colors. 
        render arrow heads on top.
kianzarrin commented 2 years ago

@kvakvs do you want to try to see if you can change the alphaBlend of the texture overlay. You have more experience so maybe you can find a way without complicating the code.

kvakvs commented 2 years ago

I suggest we do not flirt with alpha blending, its high risk low reward.

To highlight some curves i suggest one of the following:

kianzarrin commented 2 years ago

@kvakvs I am talking about the border of the arrow heads.

kianzarrin commented 2 years ago

Are you saying all lane connection wires should do this and drop the idea of black border?

kvakvs commented 2 years ago

Black outline is great in my opinion. But if its not all black it looks worse. And if you use alpha anywhere, it looks even worse.

kianzarrin commented 2 years ago

@kvakvs But if its not all black it looks worse.

as you can see in the image in the description its all black. as I explained int the description:

gray borders for active lane has been replaced by black.

if you use alpha anywhere.

we still do use alphaBlending on the black outline. but we don't touch alpha channel of the color as I said in description:

lane curves are never transparent regardless of user settings

originalfoo commented 2 years ago

Is it possible to make black connector outline a little thinner - same sort of width as the black outline round the lane circles?

originalfoo commented 2 years ago

Another option (might look rubbish, no idea without testing) - what about removing the black borders completely, and draw a shape over the junction filled with semi-transparent black? Sort of a darkened foundation to ensure contrast of the lines, rather than individual line borders? The effect would be to darken the road a bit. Given that most roads are sunken (although that can be modified with Curb Height Adjuster mod) the shape could possibly be slightly lower than pavement level so it only darkens the road surface?

kvakvs commented 2 years ago

a 30-50 or 70% black circle of junction radius (or based on biggest segment width for this junction? some can be bigger than usual with the node controller)? that's not a bad idea at all

kianzarrin commented 2 years ago

@kvakvs are you planning to take a look at this at some point? I am not really good at UI design ... if I take over this I will bombard you with questions like last time!

kvakvs commented 2 years ago

I did not start this branch. Want me to take over the work? Or you want review & approval?

originalfoo commented 2 years ago

Regarding the lanes, could we also change color saturation?

For example, if we used a color chart such as Flat Design or Material we could set num colors available = num suitable columns (depends on chart used), and then define which rows are used for active vs. other, with the active row being more vibrant (eg. saturated, during daytime) than the other row, and ideally at least 1 row between the two to ensure contrast. Additionally, we chould shift / invert the rows based on sun intensity - eg. at night a lighter colour will stand out more than a vibrant colur, and day will be the opposite.

Chart could be stored in 2D array (or whatever) and at start of overlay session pluck the values from desired rows and put them in to two fastlist (ie. existing m_buffer arrays) for rapid heap access. Could even lerp the colors as sun intensity changes from frame to frame?