Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide cross walks phase 2 #42

Open
3 tasks
kianzarrin opened this issue Dec 11, 2019 · 6 comments
Open
3 tasks

hide cross walks phase 2 #42

kianzarrin opened this issue Dec 11, 2019 · 6 comments

Comments

@kianzarrin
Copy link
Collaborator

kianzarrin commented Dec 11, 2019

This is a task to merge Hide TMPE crossswalks mod with Network skins2.
requirements:

  • "Hide TMPE crossswalks" should use transpire.
  • Come to an agreement on how this mod will be mergeed with TMPE/#27 and NS2.
  • fix performance issues on "Hide TMPE crossswalks"

EDIT: I moved the rest of this task to here CitiesSkylinesMods/HideCrosswalks#1

related:
CitiesSkylinesMods/TMPE#27
CitiesSkylinesMods/TMPE#27 (comment)
CitiesSkylinesMods/TMPE#40

@kianzarrin
Copy link
Collaborator Author

From steam comments:

jakeroot 19 minutes ago
It doesn't seem to work perfectly for all custom roads: "Clus´s Asymmetrical Roads" have the crosswalk disappear from the edge, and they get moved to the center of the junction (in a very glitchy way). But even so, it makes it way easier to cover with ploppable asphalt, so I'm not complaining. Plus this is still in alpha, so I know it won't work perfectly (especially with all custom roads). Again, great work. Looking forward to future iterations.

So we need to test on Clus´s Asymmetrical Roads. Considering that I have been flipping textures I am not surpassed this happened.

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Dec 15, 2019

I added the following instructions using transpire. This compatible with NS2

------------------------------------
TRANSPILER PEEK:
ldfld UnityEngine.Vector3 m_position
ldarg.s 7
ldfld UnityEngine.Quaternion m_rotation
ldloc.s 16 (NetInfo+Node)
ldfld UnityEngine.Material m_nodeMaterial
ldarg.2 NULL <<<
ldloc.s 13 (System.UInt16) <<<
call UnityEngine.Material CalculateMaterial(UnityEngine.Material, UInt16, UInt16) <<<
ldloc.s 16 (NetInfo+Node)
ldfld System.Int32 m_layer
ldnull NULL
ldc.i4.0 NULL
ldloc.s 14 (NetManager) 
------------------------------------
------------------------------------
TRANSPILER PEEK:
ldarg.s 7
ldfld UnityEngine.Vector3 m_position
ldloc.s 16 (NetInfo+Node)
ldfld System.Single m_lodRenderDistance
callvirt Boolean CheckRenderDistance(Vector3, Single)
ldarg.2 NULL <<<
ldloc.s 13 (System.UInt16) <<<
call Boolean ShouldHideCrossing(UInt16, UInt16) <<<
or NULL <<<
brfalse Label47
ldloc.s 14 (NetManager)
ldfld UnityEngine.MaterialPropertyBlock m_materialBlock
callvirt Void Clear()
ldloc.s 14 (NetManager)
------------------------------------

Screenshot (197)

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Dec 15, 2019

Fixed Clus´s Asymmetrical Roads by using the cropping approach.
EDIT: I got the wrong road!
Screenshot (198)

The cropping approach does not smooth out the roads though. I think I need to get the cut right. for example at 75%. Image processing may still be better.

We should not touch the _APRMap of built-in small roads. that way they look smooth.
highways don't need to flip crossings. Actually I think we need to add crossings to highway were applicable. Roads that do not have pedestrian on both side do not have crossing texture and should not be flipped (maybe I should simply check if they are highway).

There are still some more roads to test:

Chamëleon : I've also cross-checked it with the tiny highways an national roads from whisperwalk at connection to normal roads (Yes I know national roads and highways have no crossings that must be hidden :D) But the new version of his highways may clip blue - can be covered with ploppable asphalt transition .... or simply do not hide crossings on highways :D
Small clips:
Suspended Monorail Over Roads (4 and 6 lane only) have a small clip at the Median
Same for the Four-Lane Elevated Brick Road v2
Prison road with fence from INTERACTIVE PRISONS - Prison Pack has a small gras clip on both sides using this mod.
Heavy Clips:
The official 4 lane tool booth roads clips... (larger ones work fine) - but you can use them only with FindIt!
As mentioned Clus's asymmetrical roads but also normal his normal ones (like Suburban Road #1, Suburban Road # 02, 2 Lane Road - flat, Four Lane medium Road) are not working with this mod.
Parking Lot Roads from Badi_Dea 40m and 58m Parking road clips (smaller ones work fine)
Paris bridge from Psychocinesis clips also

@kianzarrin
Copy link
Collaborator Author

some roads to try on:

aubergine18Last Tuesday at 16:02
red brick junction nodes: https://steamcommunity.com/sharedfiles/filedetails/?id=1800314427
this has some interesting stuff, although looks like only on segment: https://steamcommunity.com/sharedfiles/filedetails/?id=1806489849
some crazy node texturing: https://steamcommunity.com/sharedfiles/filedetails/?id=1533069018
completely unrelated, but this is really cool way to do u-turn area on roads with medians (transition between wider and narrower version of the road I assume): https://steamcommunity.com/sharedfiles/filedetails/?id=1632829475
even more crazy node texture: https://steamcommunity.com/sharedfiles/filedetails/?id=1391209732
what looks like customised crossings: https://steamcommunity.com/sharedfiles/filedetails/?id=1303930193
another custom crossing texture: https://steamcommunity.com/sharedfiles/filedetails/?id=1217613268
some of whisperwalk's roads have real crazy stuff happening on the nodes, particularly his tiny highways roads (I doubt they have crossing though): https://steamcommunity.com/id/whisperwalk/myworkshopfiles/?appid=255710
oh, and there's also a bunch of nodeless roads in the CSUE and CSUR road collections:
https://steamcommunity.com/workshop/filedetails/?id=1423096565
https://steamcommunity.com/workshop/filedetails/?id=1206133771
oh, yeah, and this road takes things to a whole new level of crazy: https://steamcommunity.com/sharedfiles/filedetails/?id=1537917051

@kianzarrin
Copy link
Collaborator Author

kianzarrin commented Dec 16, 2019

I decided the crop out only a portion of the road then stretch out the first half of the texture. For some reason stretching out the whole texture does not work well with clus's roads which seems to have some wired textures.

----------------------------------------------------------------------------------------
              no stretching                  |         stretch               |  crop out
----------------------------------------------------------------------------------------

This not only solves clus's texture corruption but also smooths out the ends:
Screenshot (199)

I don't understand why does it matter which part of the textures I stretch considering that it looks the same all along.
Screenshot (201)

EDIT: I don't know about before but my new cropping strategy seems to fix parking roads as well:
Screenshot (206)

@kianzarrin
Copy link
Collaborator Author

@boformer I did not manage to reach to you so I created a new steam item to hide Junction markings using NS2:
Screenshot (576)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant