Skip to content

Commit 8f104c6

Browse files
authored
Merge pull request #1735 from CitiesSkylinesMods/game-update/compatibility_fix_1_16_1
What's new 11.7.4.0
2 parents be0f6e3 + 18ba0b3 commit 8f104c6

File tree

16 files changed

+133
-47
lines changed

16 files changed

+133
-47
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,30 @@ This changelog includes all versions and major variants of the mod going all the
2929

3030
> Date format: dd/mm/yyyy
3131
32+
#### TM:PE V[11.7.4.0](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.3.0...11.7.3.1) STABLE, 22/03/2022
33+
34+
- [Meta] Compatibility patch for the game update 1.16.1-f2
35+
- [New] Prevent the user from setting invalid Lane Arrows, update arrows if lane connections exist #368, #1724 (krzychu124)
36+
- [Fixed] Mouse wheel scroll is changing values if dropdown popup is closed #1733 (krzychu124)
37+
- [Fixed] Building Color change performance improvements #1725 (krzychu124)
38+
- [Fixed] Reduced memory pressure/garbage generation in simulation critical paths #1731 (krzychu124)
39+
- [Updated] Translation update for Arabic, Czech, English, French, Indonesian Italian, Korean, Polish, Portuguese, Romanian, Spanish, Thai, Turkish and Ukrainian
40+
- [Updated] Minor improvements in storing mod default values #1702 (kianzarrin)
41+
- [Mod] Improved compatibility with More Path Units
42+
- [Steam] [TM:PE v11 STABLE](https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252)
43+
44+
#### TM:PE V11.7.4.0 TEST, 22/03/2022
45+
46+
- [Meta] Compatibility patch for the game update 1.16.1-f2
47+
- [New] Prevent the user from setting invalid Lane Arrows, update arrows if lane connections exist #368, #1724 (krzychu124)
48+
- [Fixed] Mouse wheel scroll is changing values if dropdown popup is closed #1733 (krzychu124)
49+
- [Fixed] Building Color change performance improvements #1725 (krzychu124)
50+
- [Fixed] Reduced memory pressure/garbage generation in simulation critical paths #1731 (krzychu124)
51+
- [Updated] Translation update for Arabic, Czech, English, French, Indonesian Italian, Korean, Polish, Portuguese, Romanian, Spanish, Thai, Turkish and Ukrainian
52+
- [Updated] Minor improvements in storing mod default values #1702 (kianzarrin)
53+
- [Mod] Improved compatibility with More Path Units
54+
- [Steam] [TM:PE v11 TEST](https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785)
55+
3256
#### TM:PE V[11.7.3.1](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.3.0...11.7.3.1) STABLE, 23/12/2022
3357

3458
- [Fixed] Partial detection of Bank vans as service vehicles (krzychu124)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<a href="https://github.com/CitiesSkylinesMods/TMPE/wiki/Report-a-Bug">Report a Bug</a><br />
1010
</p>
1111
<p align="center">
12-
<a href="https://store.steampowered.com/app/255710/Cities_Skylines/"><img src="https://img.shields.io/static/v1?label=cities:%20skylines&message=v1.16.0-f3&color=01ABF8&logo=unity" /></a>
12+
<a href="https://store.steampowered.com/app/255710/Cities_Skylines/"><img src="https://img.shields.io/static/v1?label=cities:%20skylines&message=v1.16.1-f2&color=01ABF8&logo=unity" /></a>
1313
<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252"><img src="https://img.shields.io/github/v/release/CitiesSkylinesMods/TMPE?label=stable&color=7cc17b&logo=steam&logoColor=F5F5F5" /></a>
1414
<a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785"><img src="https://img.shields.io/github/v/release/CitiesSkylinesMods/TMPE?include_prereleases&label=test&color=f7b73c&logo=steam&logoColor=F5F5F5" /></a>
1515
<a href="https://github.com/CitiesSkylinesMods/TMPE/releases/latest"><img src="https://img.shields.io/github/v/release/CitiesSkylinesMods/TMPE?label=origin&color=F56C2D&logo=origin&logoColor=F56C2D" /></a>
@@ -30,6 +30,7 @@
3030

3131
## Releases
3232

33+
3334
- [TM:PE v11 STABLE](https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252) (fully tested releases)
3435
- [TM:PE v11 TEST](https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785) (latest beta test releases)
3536
- [Download Binaries](https://github.com/CitiesSkylinesMods/TMPE/releases) (for non-Steam users)

TLM/SharedAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
// Minor Version
2121
// Build Number
2222
// Revision
23-
[assembly: AssemblyVersion("11.7.3.*")]
23+
[assembly: AssemblyVersion("11.7.4.*")]

TLM/TLM/Custom/PathFinding/CustomPathFind.cs

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,11 +1293,14 @@ ref nextLaneId.ToLane(),
12931293
queueItem_.pathType == ExtPathType.DrivingOnly)
12941294
// NON-STOCK CODE END
12951295
) {
1296-
bool isPrevSegmentPedZoneRoad = prevSegmentInfo.IsPedestrianZoneOrPublicTransportRoad();
12971296
for (int i = 0; i < 8; i++)
12981297
{
12991298
ushort nextPedZoneSegmentId = nextNode.GetSegment(i);
1300-
if (nextPedZoneSegmentId != 0 && nextPedZoneSegmentId != prevSegmentId && isPrevSegmentPedZoneRoad) {
1299+
if (nextPedZoneSegmentId != 0 && nextPedZoneSegmentId != prevSegmentId)
1300+
{
1301+
ref NetSegment nextPedZoneSegment = ref nextPedZoneSegmentId.ToSegment();
1302+
if (nextPedZoneSegment.Info.IsPedestrianZoneOrPublicTransportRoad())
1303+
{
13011304
ProcessItemCosts(
13021305
#if DEBUG
13031306
isLogEnabled,
@@ -1312,14 +1315,15 @@ ref nextLaneId.ToLane(),
13121315
ref nextNode,
13131316
false,
13141317
nextPedZoneSegmentId,
1315-
ref nextPedZoneSegmentId.ToSegment(),
1318+
ref nextPedZoneSegment,
13161319
ref prevRelSimilarLaneIndex,
13171320
connectOffset,
13181321
false,
13191322
true);
13201323
}
13211324
}
13221325
}
1326+
}
13231327
} else {
13241328
if (isLogEnabled) {
13251329
DebugLog(
@@ -2290,10 +2294,9 @@ private void ProcessItemPublicTransport(
22902294
Randomizer randomizer = new Randomizer(pathFindIndex_ ^ nextLaneId);
22912295
newDistance *= randomizer.Int32(10000U) * (1f / 1000f);
22922296
}
2293-
nextItem.ComparisonValue = comparisonValue +
2294-
(newDistance /
2297+
float currentComparisonValue = (newDistance /
22952298
((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_));
2296-
nextItem.Duration = duration + (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f));
2299+
float currentDuration = (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f));
22972300

22982301
nextItem.Direction =
22992302
(nextSegment.m_flags & NetSegment.Flags.Invert) != NetSegment.Flags.None
@@ -2331,9 +2334,8 @@ private void ProcessItemPublicTransport(
23312334
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) *
23322335
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
23332336

2334-
nextItem.ComparisonValue +=
2335-
nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
2336-
nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed;
2337+
currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
2338+
currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed;
23372339
}
23382340

23392341
if (nextLaneId == startLaneB_) {
@@ -2367,11 +2369,12 @@ private void ProcessItemPublicTransport(
23672369
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) *
23682370
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
23692371

2370-
nextItem.ComparisonValue +=
2371-
nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
2372-
nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed;
2372+
currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
2373+
currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed;
23732374
}
23742375

2376+
nextItem.ComparisonValue = comparisonValue + currentComparisonValue;
2377+
nextItem.Duration = duration + currentDuration;
23752378
nextItem.LaneId = nextLaneId;
23762379
nextItem.LanesUsed = item.LanesUsed | nextLaneInfo.m_laneType;
23772380
nextItem.VehiclesUsed = item.VehiclesUsed | nextLaneInfo.m_vehicleType;
@@ -2692,6 +2695,7 @@ private bool ProcessItemCosts(
26922695

26932696
NetInfo.LaneType allowedLaneTypes = laneTypes_;
26942697
VehicleInfo.VehicleType allowedVehicleTypes = vehicleTypes_;
2698+
VehicleInfo.VehicleCategory currentVehicleCategory = vehicleCategory_;
26952699
if (!enableVehicle) {
26962700
allowedVehicleTypes &= VehicleInfo.VehicleType.Bicycle;
26972701
if (allowedVehicleTypes == VehicleInfo.VehicleType.None) {
@@ -2700,6 +2704,10 @@ private bool ProcessItemCosts(
27002704
}
27012705
}
27022706

2707+
if (ignoreBlocked_) {
2708+
currentVehicleCategory = VehicleInfo.VehicleCategory.All;
2709+
}
2710+
27032711
if (!enablePedestrian) {
27042712
allowedLaneTypes &= ~NetInfo.LaneType.Pedestrian;
27052713
}
@@ -2782,7 +2790,6 @@ private bool ProcessItemCosts(
27822790
}
27832791
#endif
27842792

2785-
var currentVehicleCategory = vehicleCategory_;
27862793
// NON-STOCK CODE END
27872794
for (; nextLaneIndex <= maxNextLaneIndex && nextLaneId != 0; nextLaneIndex++) {
27882795
NetInfo.Lane nextLaneInfo = nextSegmentInfo.m_lanes[nextLaneIndex];
@@ -2934,8 +2941,8 @@ private bool ProcessItemCosts(
29342941
}
29352942

29362943
// NON-STOCK CODE END
2937-
nextItem.ComparisonValue = comparisonValue + transitionCostOverMeanMaxSpeed;
2938-
nextItem.Duration = duration + transitionCost / ((prevMaxSpeed + nextMaxSpeed) * 0.5f);
2944+
float currentComparisonValue = transitionCostOverMeanMaxSpeed;
2945+
float currentDuration = transitionCost / ((prevMaxSpeed + nextMaxSpeed) * 0.5f);
29392946
nextItem.Direction = nextDir;
29402947

29412948
if (nextLaneId == startLaneA_) {
@@ -2972,10 +2979,10 @@ private bool ProcessItemCosts(
29722979
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) *
29732980
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
29742981

2975-
nextItem.ComparisonValue +=
2982+
currentComparisonValue +=
29762983
nextOffset * nextSegment.m_averageLength /
29772984
(nextLaneSpeed * maxLength_);
2978-
nextItem.Duration +=
2985+
currentDuration +=
29792986
nextOffset * nextSegment.m_averageLength / nextLaneSpeed;
29802987
}
29812988

@@ -3013,10 +3020,10 @@ private bool ProcessItemCosts(
30133020
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) *
30143021
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
30153022

3016-
nextItem.ComparisonValue +=
3023+
currentComparisonValue +=
30173024
nextOffset * nextSegment.m_averageLength /
30183025
(nextLaneSpeed * maxLength_);
3019-
nextItem.Duration +=
3026+
currentDuration +=
30203027
nextOffset * nextSegment.m_averageLength / nextLaneSpeed;
30213028
}
30223029

@@ -3026,7 +3033,7 @@ private bool ProcessItemCosts(
30263033
(nextLaneInfo.m_laneType &
30273034
(NetInfo.LaneType.Vehicle | NetInfo.LaneType.TransportVehicle)) !=
30283035
NetInfo.LaneType.None) {
3029-
nextItem.ComparisonValue += 0.1f;
3036+
currentComparisonValue += 0.1f;
30303037
blocked = true;
30313038
if ((allowedVehicleTypes & VehicleInfo.VehicleType.Plane) != 0)
30323039
{
@@ -3063,7 +3070,7 @@ private bool ProcessItemCosts(
30633070
}
30643071
}
30653072

3066-
nextItem.ComparisonValue += adjustedBaseLength;
3073+
currentComparisonValue += adjustedBaseLength;
30673074

30683075
if (isLogEnabled) {
30693076
DebugLog(
@@ -3084,7 +3091,7 @@ private bool ProcessItemCosts(
30843091
// apply lane distance factor
30853092
float adjustedBaseLength = baseLength;
30863093
adjustedBaseLength *= 1 + laneDist;
3087-
nextItem.ComparisonValue += adjustedBaseLength;
3094+
currentComparisonValue += adjustedBaseLength;
30883095

30893096
if (isLogEnabled) {
30903097
DebugLog(
@@ -3111,7 +3118,7 @@ private bool ProcessItemCosts(
31113118
int lastTarget = nextLane.m_lastTarget;
31123119
if (laneIndexFromInner < firstTarget ||
31133120
laneIndexFromInner >= lastTarget) {
3114-
nextItem.ComparisonValue +=
3121+
currentComparisonValue +=
31153122
Mathf.Max(1f, (transitionCost * 3f) - 3f) /
31163123
((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_);
31173124
}
@@ -3134,7 +3141,7 @@ private bool ProcessItemCosts(
31343141

31353142
if (!transportVehicle_ && nextLaneInfo.m_laneType ==
31363143
NetInfo.LaneType.TransportVehicle) {
3137-
nextItem.ComparisonValue +=
3144+
currentComparisonValue +=
31383145
20f / ((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_);
31393146
}
31403147
}
@@ -3151,9 +3158,11 @@ private bool ProcessItemCosts(
31513158

31523159
if ((nextLaneInfo.vehicleCategory & VehicleInfo.VehicleCategory.PublicTransportRoad) != 0 &&
31533160
(nextLaneInfo.vehicleCategory & ~(VehicleInfo.VehicleCategory.Bus | VehicleInfo.VehicleCategory.Trolleybus | VehicleInfo.VehicleCategory.Taxi)) == 0) {
3154-
nextItem.ComparisonValue -= baseLength * 0.25f;
3161+
currentComparisonValue -= baseLength * 0.25f;
31553162
}
31563163

3164+
nextItem.ComparisonValue = comparisonValue + currentComparisonValue;
3165+
nextItem.Duration = duration + currentDuration;
31573166
AddBufferItem(
31583167
#if DEBUG
31593168
isLogEnabled,
@@ -3437,10 +3446,9 @@ private void ProcessItemPedBicycle(
34373446
var nextMaxSpeed = nextLaneInfo.m_speedLimit;
34383447
#endif
34393448

3440-
nextItem.ComparisonValue = comparisonValue +
3441-
distance /
3449+
float currentComparisonValue = distance /
34423450
((prevMaxSpeed + nextMaxSpeed) * 0.25f * maxLength_);
3443-
nextItem.Duration = duration + (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f));
3451+
float currentDuration = (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f));
34443452

34453453
nextItem.Direction =
34463454
(nextSegment.m_flags & NetSegment.Flags.Invert) != NetSegment.Flags.None
@@ -3477,9 +3485,8 @@ private void ProcessItemPedBicycle(
34773485
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) *
34783486
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
34793487

3480-
nextItem.ComparisonValue +=
3481-
nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
3482-
nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed;
3488+
currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
3489+
currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed;
34833490
}
34843491

34853492
if (nextLaneId == startLaneB_) {
@@ -3511,11 +3518,12 @@ private void ProcessItemPedBicycle(
35113518
float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) *
35123519
BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR;
35133520

3514-
nextItem.ComparisonValue +=
3515-
nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
3516-
nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed;
3521+
currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_);
3522+
currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed;
35173523
}
35183524

3525+
nextItem.ComparisonValue = comparisonValue + currentComparisonValue;
3526+
nextItem.Duration = duration + currentDuration;
35193527
nextItem.LaneId = nextLaneId;
35203528
nextItem.LanesUsed = item.LanesUsed | nextLaneInfo.m_laneType;
35213529
nextItem.VehiclesUsed = item.VehiclesUsed | nextLaneInfo.m_vehicleType;

TLM/TLM/Manager/Impl/AdvancedParkingManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,7 @@ public bool FindParkingSpaceForCitizen(Vector3 endPos,
19521952
false,
19531953
false,
19541954
GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance,
1955+
false,
19551956
out endPathPos)) {
19561957
calculateEndPos = false;
19571958
}

TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ bool citizenDebug
927927
false,
928928
false,
929929
parkingAiConf.MaxBuildingToPedestrianLaneDistance,
930+
false,
930931
out parkedVehiclePathPos);
931932
}
932933

@@ -977,6 +978,7 @@ bool citizenDebug
977978
allowUnderground,
978979
false,
979980
parkingAiConf.MaxBuildingToPedestrianLaneDistance,
981+
false,
980982
out startPosA);
981983
} else {
982984
foundStartPos = FindPathPosition(
@@ -1152,6 +1154,7 @@ public bool FindPathPosition(ushort instanceID,
11521154
SavedGameOptions.Instance.parkingAI
11531155
? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance
11541156
: 32f,
1157+
false,
11551158
out PathUnit.Position posA,
11561159
out PathUnit.Position posB,
11571160
out float distA,
@@ -1171,6 +1174,7 @@ public bool FindPathPosition(ushort instanceID,
11711174
SavedGameOptions.Instance.parkingAI
11721175
? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance
11731176
: 32f,
1177+
false,
11741178
out posA,
11751179
out posB,
11761180
out distA,
@@ -1191,6 +1195,7 @@ public bool FindPathPosition(ushort instanceID,
11911195
SavedGameOptions.Instance.parkingAI
11921196
? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance
11931197
: 32f,
1198+
false,
11941199
out posA,
11951200
out posB,
11961201
out distA,

0 commit comments

Comments
 (0)