Closed SevenQM closed 4 years ago
@SevenQM as I explained in comments on workshop item , it's the other mod which is dependent on TM:PE.
I suspect it's CSUR_TMPE_Laneconnector_Fix
(it's obsolete, according to github page) or more likely Advanced Junction Rule
Disable both for now if you want to use v11
version and just wait for update.
We can do nothing from our side.
Tagging @pcfantasy
@SevenQM
Both CSUR_TMPE_Laneconnector_Fix and Advanced Junction Rule is obsolete.
CSUR_TMPE_Laneconnector_Fix is never published and it is for CSUR beta3. please use CSUR ToolBox in steam.
Advanced Junction Rule is removed from steam. Please delete it.
@pcfantasy Can we incorporate that code (now in the CSUR ToolBox) direct in to TMPE? I assume it's to deal with lane connector issues on nodeless junctions? We have same issue for RWY (Railway) nodeless tracks and a few other networks too...
@aubergine10
Yes, in CheckSegmentsTurningAngle, TMPE will check
if (turningAngle < 1f) { // balabala........................... float dirDotProd = sourceDirection.x targetDirection.x + sourceDirection.z targetDirection.z; return dirDotProd < turningAngle; }
if turningAngle < 1f and dirDotProd > turningAngle; then return false to prevent some lane connectors.
Sometimes for some reasons, asset owner will create some roads which turningAngle is not 1f. So I just return true for all CSUR roads to allow all lane connectors.
@kianzarrin Could you incorporate that in to the stuff you're doing with lane connectors?
@aubergine10 That review is already getting too big and out of hand. I added fix for lane curves on the top of the ModeLaneMarker and SegmentLaneMarker stuff.
why not to do this in a separate pull request. It is not conflicting with my code.
I am on this. I will also fix CSUR toolbox.
EDIT: WAIT IF CSUR wants to be compatible with previous TMPE versions it should check version string right? what version should it check? tagging @aubergine10
Actually Ill just check for existence of :
public static bool IsCSUR(NetInfo asset)
using reflection or something.
PS: who ever wrote this code has a really wide screan!
Loader.Detours.Add(new Loader.Detour(Assembly.Load("TrafficManager").GetType("TrafficManager.UI.SubTools.LaneConnectorTool").GetMethod("CheckSegmentsTurningAngle", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(ushort), typeof(NetSegment).MakeByRefType(), typeof(bool), typeof(ushort), typeof(NetSegment).MakeByRefType(), typeof(bool) }, null),
typeof(NewLaneConnectorTool).GetMethod("CheckSegmentsTurningAngle", BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(ushort), typeof(NetSegment).MakeByRefType(), typeof(bool), typeof(ushort), typeof(NetSegment).MakeByRefType(), typeof(bool) }, null)));
@kianzarrin
I suggest to return true for all roads.
Why do we need to check turningAngle to allow lane connector for road, only railway need this I think,
@pcfantasy Sometimes for some reasons, asset owner will create some roads which turningAngle is not 1f. So I just return true for all CSUR roads to allow all lane connectors.
Can you please give me an example outside of CSUR?
@victoriacity
Can you help explain something about turningAngle?
maxTurningAngle < 90 degrees is necessary for implementing continuous median toggled by traffic lights. For example, when traffic lights are turned off for a T-junction of CSUR roads, the median and markings on the straight road is not broken so that one does not have to plop medians and markings manually to achieve such effect as in vanilla roads.
Specifically, the continuous median is a direct connect node triggered by a connect group (e.g., WideTram and NarrowTram), and most CSUR roads have connect group originally designed for trains and at-grade tram intersections. This leads to the need of setting an acute maxTurningAngle for continuous medians, because the maxTurningAngle is the maximum angle by which the game tries to create direct connect nodes.
In vanilla roads, the maxTurningAngle is 90°. This allows for making rail transit networks above or on the road turn at an intersection. In the screenshot above the turning angle of monorail is exactly 90° in the left and slightly larger than 90° in the right. Because the maxTurningAngle is 90°, the monorail is connected through a direct connect road only in the left.
Therefore, if the maxTurningAngle=90 is used for continuous median (right road in the above screenshot), one obtains a similar effect as is expected for a monorail/tram intersection. However, in this case the desired effect is the median of the branched road comes to an end right before the intersection (left road in the above screenshot), and this has to be achieved by setting maxTurningAngle < 90. In CSUR roads, we set maxTurningAngle=75 (maxTurningAngleCos=0.2588) to allow for some flexibility in the intersection angle.
Outside of CSUR, the earliest road assets implementing continuous median also have maxTurningAngle < 90, for example: https://steamcommunity.com/sharedfiles/filedetails/?id=1300747514 https://steamcommunity.com/sharedfiles/filedetails/?id=1327917624 https://steamcommunity.com/sharedfiles/filedetails/?id=1319965985
In the situation bellow its possible to select the monorail lanemarker even though it does not go anywhere. (EDIT: original TMPE code)
OK I fixed the issue of the max turning angle. it only applies to tracks now:
To solve https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues/649#issuecomment-583843474 I made exception for unconnected tracks:
The TMPE side is fixed(shortly will put a pull request) the CSUR should not patch TMPE if the fix is present. One way to do this is to check for TMPE version:
TrafficManagerMod::public const string VERSION = "11.0";
Can I rely on this to be VERSION >= 11.1
EDIT: I am not intending to do string comparison. i will convert it to number first.
@kianzarrin
OK,I will update this too.
I think the VERSION
needs to be string due to CO API (IUserMod
) - could be wrong, been ages since I checked. And we often have versions with -beta1
etc in them.
We could add a separate property to the TrafficManagerMod
with some sort of numeric version number?
Just realised VERSION
isn't part of IUserMod
so we can change it to any format we want
@kianzarrin Change it to number but provide some way to include string bolt ons in the stuff that gets shown to user (eg. 11.1-beta1
or 11.0-hotfix
)
@aubergine10
Just realised VERSION isn't part of IUserMod so we can change it to any format we want @kianzarrin Change it to number but provide some way to include string bolt ons in the stuff that gets shown to user (eg. 11.1-beta1 or 11.0-hotfix)
I prefer to use Version class.
// usage example
new Version(11.1,blah,blah)
version.ToString(2) //major and minor only
version1 > version2 // it has internal comparison
And I will get Version
from AssemblyInfo.cs:
public static string VersionString => ModVersion.ToString(2);
public static Version ModVersion => typeof(TrafficManagerMod).Assembly.GetName().Version;
Hopefully no one has used TrafficManagerMod::VERSION
externally.
I fixed this issue: The images bellow are produced while CSUR did not patch TMPE.
also the log includes:
No need to defer LaneConnectorTool::CheckSegmentsTurningAngle calls
which means new version of TMPE was detected and was not patched.
detecting median is not part of this issue but rather its part of #243
A beta is being pushed to LABS page that does not yet contian CSUR fix. The beta will be versioned 11.1.0
(note: build value)
The CSUR update will be in next beta, version 11.1.1. For more details see #687
@SevenQM Please let us know if the issue is fixed or not.
Describe the problem
After the V11 update, I entered the game as before, and an error message popped up。 Could not load type 'TrafficManager.Traffic.Data.VehicleState' from assembly 'TrafficManager, Version=1.0.7026.40416, Culture=neutral, PublicKeyToken=null'. [System.TypeLoadException]
Details: No details
I subscribed to the V11LABS version. No other subscriptions. There is no problem returning 10.20. Find solution: subscribe to V11 and subscribe to 10.20, the problem will only disappear when V11 is enabled
Steps to reproduce
Log files
Savegame?
https://steamcommunity.com/sharedfiles/filedetails/?id=1988175689
Screenshots?
Notes or questions?
TMPE.log output_log.txt