citiesskylinesmods / hidecrosswalks Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Moving boformer/NetworkSkins#42 to here because it does not sound like I am merging this with NS2 in the next version. and even if I do it may be a submodule.
In this task I hide tmpe cross walks
here I continue to version 2 of the operation to make further improvements.
Version 2.0 released:
Version 2.5 released:
Version 3.0:
Version 3.*
Version 4:
Debug tools:
related:
CitiesSkylinesMods/TMPE#27
CitiesSkylinesMods/TMPE#27 (comment)
CitiesSkylinesMods/TMPE#40
Ideas to improve FPS
Ideas to improve one-time processing speed.
colors[][]
Benchmarking
Will send a PR to fix, just logging issue here.
If a network does not load correctly, it can cause the node
to be null
:
HideCrosswalks/HideTMPECrosswalks/Utils/PrefabUtils.cs
Lines 32 to 33 in 14b3c0d
@krzychu124 spotted the error while testing some stuff for fps booster mod:
btw, that segment was trolleybus vanilla asset, if that matters
In the picture bellow you can see a road from Next2 that does not have zebra crossings texture. In my hide crossings mod I : EDIT 1- clone the material 2- get defuse texture from node material (NetInfo.Node[0].m_nodeMaterial.GetTexture(ID_DEFUSE)
). 4- do some processing (lets say I flip the texture). 5- set the processed texture as defuse texture of the node material.
And as you can see int he picture bellow it draws a weird junction texture:
This is the defuse texture of m_nodeMaterial
from mod tools:
Why does it look exactly like the segment texture? in fact the are identical. So I decided to exclude the situation when node texture is equal to the segment texture in the code bellow. This solved the problem (more like a hack arround):
public static bool HasSameNodeAndSegmentTextures(NetInfo info, Material nodeMaterial, int texID) {
foreach (var seg in info.m_segments) {
Texture t1 = nodeMaterial.GetTexture(texID);
Texture t2 = seg.m_segmentMaterial.GetTexture(texID);
if (t1 == t2)
return true;
}
return false;
}
So
1- is the original m_nodeMaterial is not being rendered but when I change its defuse texture then it gets rendered?
2- why does it have such a weird node texture in the first place?
So far so good. but now users are complaining why my mod does not hide the crosswalks from THIS ROAD:
The node texture is the same as one of the segment textures:
Although the node texture is identical to one of the segment textures, this time the node texture IS rendered ( I don't understand why). But because my hide crossings mod will not hide the crossing because the node texture is identical to one of the segment textures.
I need to know when the node texture is rendered and when it is not so that I know when to exempt it from my hide crossing mod and when not to. The condition node[i].m_nodeMaterial.GetTexture(texID) == segment[i].m_segmentMaterial.GetTexture(texID);
is not a good condition. So what should I look for?
EDIT:
while we are at it what is the difference between NetNode.Node.m_nodeMaterial
and NetNode.Node.m_material
?
In the picture bellow 4L road has smooth segment to junction transition but there is a APR texture missmatch for the 6L road.
After doing a few experiments it appears that only plain roads(no aymmetry/decoration/medians) have this problem.
sometimes CS stretches node texture WRT the segment texture before rendering them. In such circumstances blending in the segment texture to node texture can result into texture mismatch.
// Simplified blending code
float weight= i/length;
node_color[i] = node_color[i]*weight+segment_color[i]*(1-weight);
So far I look for grass/trees in the name of the road to determine if it has decoration and look for a lane with laneType == None
to find medians. If so I shrink segment textures by 91%.
I do not know what exactly to look for (is there a field or a flag I need to check) to distinguish such roads from one another and I do not know how much is the scaling factor.
###Need
In the images bellow I put the segment texture underthe generated (by blending) node APR texture for 4L and 6L road:
related:
#1 (comment)
Discovered this while wading through world's biggest error log: https://steamcommunity.com/app/255710/discussions/0/1750148101145257091/
The class NetworkSkins.Skins.NetworkSkin could not be loaded, used in NetworkSkins, Version=1.0.7319.2601, Culture=neutral, PublicKeyToken=null
The class NetworkSkins.Skins.NetworkSkin could not be loaded, used in NetworkSkins, Version=1.0.7319.2601, Culture=neutral, PublicKeyToken=null
System.TypeLoadException: Could not load type 'NetworkSkins.Skins.NetworkSkin' from assembly 'NetworkSkins, Version=1.0.7319.2601, Culture=neutral, PublicKeyToken=null'.
at HideTMPECrosswalks.Utils.NS2Utils._HideJunction (UInt16 segmentID) [0x00000] in <filename unknown>:0
at HideTMPECrosswalks.Utils.NS2Utils.HideJunction (UInt16 segmentID) [0x00000] in <filename unknown>:0
at HideTMPECrosswalks.Utils.NS2Utils._HideJunction (UInt16 segmentID) [0x00000] in <filename unknown>:0
at HideTMPECrosswalks.Utils.NS2Utils.HideJunction (UInt16 segmentID) [0x00000] in <filename unknown>:0
No idea what caused it, but user has a massive number of broken assets/mods so could be side effect of that.
Could this be cause by your update? I have nothing new -only your mod is updated...
@thebugfixnet
Seems to collide with Garbage Bin Controller https://steamcommunity.com/sharedfiles/filedetails/?id=1386697922 ???
A Mod caused an error [System.Exception] Details: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: No target method specified for class VanillaGarbageBinBlocker.PropManagerDataPatch (declaringType=, methodName =AfterDeserialize, methodType=, argumentTypes=NULL) at Harmony.PatchProcessor.PrepareType () [0x00000] in :0 at Harmony.PatchProcessor..ctor (Harmony.HarmonyInstance instance, System.Type type, Harmony.HarmonyMethod attributes) [0x00000] in :0 at Harmony.HarmonyInstance.b__6_0 (System.Type type) [0x00000] in :0 at Harmony.CollectionExtensions.Do[Type] (IEnumerable1 sequence, System.Action1 action) [0x00000] in :0 at Harmony.HarmonyInstance.PatchAll (System.Reflection.Assembly assembly) [0x00000] in :0 at VanillaGarbageBinBlocker.UserMod.OnEnabled () [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception
enabling and disabling mods does not always work due to an internal bug in the game resulting in "zombie" mods. You need to restart CS particularly if you migrate between different mod versions.
@thebugfixnet
I not only disabled the mod - i even uninstalled him and restarted several times to test...not your - https://steamcommunity.com/sharedfiles/filedetails/?id=1386697922 ... one this is uninstalled, everythink works again. Interesing: this error apeared already in april in combination of NS2 and Garbage Bin Controller. Look at https://community.simtropolis.com/forums/topic/758072-network-skins-2/?page=2 for VanillaGarbageBinBlocker.PropManagerDataPatch
I have a huge list of mods active and up to today they all worked flawless together.
The error appear on starting the game - so before loading a save.
As soon as i have your Mod + Garbage Bin Controller active this error appears... unsubbed from Garbage Bin Controller is the short term solution... as it is not really horrible to have the C:S Trashcans in Town...
Tomorrow I'll have a further look...
So.... I started now several time new with sub- unsub.... where able to reproduce it - BUT: I needed to delete some Garbage Bin Controller files manually from the C:S folders. At unsub three files stayed there... don't know why... So it works now....
And regarding to my used mods...as I said: a long list - so a real stress test for new mods :D
81 Tiles (Fixed for 1.2+) [DEACTIVATED atm]
Adaptive Prop Visibility Distance
Adjust Pathfinding [BETA]
Advanced Stop Selection (ex MTSE)
Advanced Vehicle Options AVO (Industries DLC ready)
Airport Roads
Any Road Outside Connections
Better Bulldozer [Park Life Compatible]
Building Anarchy
Building Themes
Bulldoze It!
Campus Parks
Crossings
Custom Namelists
Customize It Extended
Daylight Classic
Decal Prop Fix
Detail
Disable Zone Check
Electric Roads Mod 1.2.3
Elektrix's Road Tools 2.0
Elevated Stops Enabler
Emergency Light Changer
Employ Overeducated Workers V2 (1.11+)
Empty It!
Environment Changer (+ Improved Theme Selection )
Extended Game Options
Extra Landscaping Tools
Find It!
Fine Road Anarchy 2
Fine Road Tool 2
Force Level Up
Garbage Bin Controller
Hide It!
Hide TMPE Crosswalks V2.2 [ALPHA]
Improved Public Transport 2
Land Ships
Less Steam
Loading Screen Mod [Test]
More Advanced District Snapping
Move It!
Network Extensions 2
Network Skins 2 (Beta)
Network Tiling
No Abandonment
No Tree Brush Slope Limit
Not So Unique Buildings
Optimised Outside Connections
Parkify
Pause on load
Plop the Growables
Ploppable Asphalt +
Precision Engineering
Prefab Hook (Mod Dependency)
Prop & Tree Anarchy
Prop Line Tool [PLT] (vAlpha)
Prop Precision
Prop Snapping
Prop it Up! 1.4.4
Quay Anarchy
Realistic Population and Consumption Mod v8.4.0
Realistic Walking Speed
Roundabout Builder
Service Vehicle Selector 2
Set your own Start Money amount
Sharp Textures
Ship Converter
Ship Path Anarchy
Smart Intersection Builder
Sort Mod Settings
Spawn Points Fix
Spawn/Unspawn Positions Swapper
Sub-Buildings Tabs
Surface Painter
TM:PE 11.0 ALPHA
Theme Decals
Theme Mixer 2 [DEACTIVATED atm]
Ticket Price Customizer
Toggle It!
TotalyFree Camera
Touch This! Tool 3
Tram Station Track
Transparency LODs Fix
Transparent Selectors
Tree LOD Fix
Tree Movement Control
Ultimate Level Of Detail (ULOD)
Unlimited Outside Connections (Beta)
WaterPipeUpgrader v2 PARKLIFE READY
Zoning toolset (toggle + upgrade tool)
Zoom It!
After subscribing to hide crosswalks 3.0 (experimental), when the camera zooms in, the models of roads and buildings in the game will disappear.(as shown in these 2 pics)
TMPE.log
RMCrosswalks.debug.log
output_log.txt
Not sure if you would rather have this in the workshop comments. Anyway...
I have quite a lot of roads installed on the workshop. The effect of this is that I cannot make exceptions for some roads. The list does not have a scrollbar for this. Maybe a scrollbar could be added, or the type of form could be changed alltogether.
Thanks for an amazing mod.
###Intro:
I am trying to blend in the segment textures into node textures to create smooth junctions for custom roads. For asymmetrical roads there is an extra challenge to know which end of the segment the node texture is attached to (it makes sense if it is the large end but its better not to assume anything). To simplify the code and to boost memory and performance I decided to cut the texture in half and the second half of the texture is the mirror of the first half.
###Problem
I assumed that the segment texture will have the larger part of the road on the left but I was mistaken. Network extension 2 has some weird textures:
I need to find a way to understand if the texture is inverted so that I can change my processing.
Currently I just look for the name "inverted" in the texture name to understand. But I need a more future proof approach to understand when a texture is inverted.
To distinguish inverted VS non-inverted texture I tried to compare AsymAvenueL2R4 to AsymAvenueL2R3 because they are very similar but the texture is inverted in one but not the other.
This is the part of code that loads the inverted texture:
if (invertMe || info.m_segments[i].m_mesh.name == "Bus")
inverted = "_Inverted"; ```
but this does not explain how CS understands the texture is inverted (I doubt that it is by name).
### Plan
- one more thing I have not check is the mesh uv. I do not know how to do that yet but maybe it helps.
HideTMPECrosswalks patches Reverted.
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
NullReferenceException
at (wrapper managed-to-native) UnityEngine.Component:get_transform ()
at BuildingThemes.BuildingVariationManager.Reset () [0x00000] in :0
at BuildingThemes.LoadingExtension.OnReleased () [0x00000] in :0
at LoadingWrapper.OnLoadingExtensionsReleased () [0x00000] in :0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
LoadingWrapper:OnLoadingExtensionsReleased()
LoadingWrapper:Release()
LoadingManager:ReleaseRelay()
LoadingManager:OnDestroy()
@RaeTheGit 4 hours ago
Of course. Murphy's Law kicked in and I couldn't "deliberately" get the game to actually crash with both mods activated, but I managed to get a log of Hide Crossings disabled, where everything runs smooth (but doesn't look as good/desired) and one with Hide Crossings enabled, where unpausing after load changes the button but the simulation doesn't start running. Also, most UI stuff didn't work like changing lane arrows in TMPE or bulldozing anything.
Log w/out Hide Crossings [ufile.io]
Log with Hide Crossings [ufile.io]
raethegit 5 hours ago
So, for now i deduce this said incompatibility exists and seems to be only triggered by certain circumstances like either OS, installed assets, mods, or even the hardware, or any combination of that... which will probably and hopefully be revealed by the output log.
raethegit 5 hours ago
@albeo I don't have Bonjour on my Linux machine
I never got any indications that Hide Crosswalks or Remove Need For Pipes was actually in any way related to those crashes, they both work(ed) just fine and as expected. I just very frequently got those ominous crashes to desktop right after loading or unpausing a game so I did some random search on the workshop to see if there might be known issues for some of the installed mods, assets, etc, and that is when I came across Duplicate Assembly Scanner which described the exact behaviour and the possible reason for that.
For verification, I have now temporarily unsubscribed from Hide Crosswalks, as it is "only" for cosmetics and doesn't influence functionality. Now the game runs much more stable and is way more responsive additionally to being playable much faster after loading. To not distort the result I deliberately changed nothing else than unsubscribing from HC.
I'll try to resubscribe so I can get a fresh output log later.
aubergine18 6 hours ago
@RaeTheGit Share your output_log.txt so we can see what actual error is.
Albreo 7 hours ago
@LemonsterOG I second this.
@RaeTheGit Try to get rid of Bonjour if you have one on your computer. I'm trying to confirm if it's related to my crash.
LemonsterOG 8 hours ago
@RaeTheGit -- I use both this mod and Remove Need for Pipes without issue. You must have some other mod(s) conflicting.
raethegit 8 hours ago
I have experienced "instant crashes" a lot lately and just now found the Duplicate Assembly Scanner in the workshop, so i gave it a shot. Turns out this mod and Remove Need For Pipes are conflicting as they use the same method from different Harmony versions (yours v2.0.0, Remove Need For Pipes v1.2.0) which is said to be a very probable cause of those crashes.
Just wanted to give a heads up on this as both mods add a lot of value to gameplay for me, and did the same over at the Remove Need For Pipes mod.
Still want to leave a big thanks for your work! :)
player-1.log
player-2.log
Fix in V3.0:
Won't fix:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.