Skip to content

Commit

Permalink
update decompiled systems for 1.1.11f (#3)
Browse files Browse the repository at this point in the history
* update decompiled systems for 1.1.11f

remove searchtree/pathfinding logic

* update readme, fix system replacement
  • Loading branch information
bcallender authored Oct 29, 2024
1 parent 911e260 commit 7db4c62
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 734 deletions.
2 changes: 2 additions & 0 deletions AllAboard.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATransportCarAISystem_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9dbfd0f80f1c47cda752f580c9797e08953800_003Fb7_003F85f1bcd2_003FTransportCarAISystem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATransportTrainAISystem_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9dbfd0f80f1c47cda752f580c9797e08953800_003Fe8_003F22847a57_003FTransportTrainAISystem_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/Environment/AssemblyExplorer/XmlDocument/@EntryValue">&lt;AssemblyExplorer&gt;&#xD;
&lt;Assembly Path="F:\SteamLibrary\steamapps\common\Cities Skylines II\Cities2_Data\Managed\Game.dll" /&gt;&#xD;
&lt;/AssemblyExplorer&gt;</s:String></wpf:ResourceDictionary>
6 changes: 1 addition & 5 deletions AllAboard/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,11 @@ public void OnLoad(UpdateSystem updateSystem)

PublicTransportBoardingHelper.TrainMaxAllowedMinutesLate.Data = (uint) m_Setting.TrainMaxDwellDelaySlider;
PublicTransportBoardingHelper.BusMaxAllowedMinutesLate.Data = (uint) m_Setting.BusMaxDwellDelaySlider;
PublicTransportBoardingHelper.CleanUpPathfindingQueue.Data = m_Setting.TestPathfindingCleanup;

World.DefaultGameObjectInjectionWorld.GetOrCreateSystemManaged<TransportTrainAISystem>().Enabled = false;

World.DefaultGameObjectInjectionWorld.GetOrCreateSystemManaged<TransportTrainAISystem>().Enabled = false;
World.DefaultGameObjectInjectionWorld.GetOrCreateSystemManaged<TransportCarAISystem>().Enabled = false;
updateSystem.UpdateAt<PatchedTransportCarAISystem>(SystemUpdatePhase.GameSimulation);
updateSystem.UpdateAt<PatchedTransportTrainAISystem>(SystemUpdatePhase.GameSimulation);
log.Info("Completed Replacement of Base Train/CarAI Systems.");
log.InfoFormat("Pathfinding Cleanup Enabled?: {0}", PublicTransportBoardingHelper.CleanUpPathfindingQueue.Data);
log.InfoFormat("Bus Max Dwell Time: {0}", PublicTransportBoardingHelper.BusMaxAllowedMinutesLate.Data);
log.InfoFormat("Train Max Dwell Time: {0}", PublicTransportBoardingHelper.TrainMaxAllowedMinutesLate.Data);
//updateSystem.UpdateBefore<InstantBoardingSystem>(SystemUpdatePhase.GameSimulation);
Expand Down
19 changes: 7 additions & 12 deletions AllAboard/Properties/PublishConfiguration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ to fix it with a Mod instead!
tl;dr: This mod adds a hard cap on the Dwell Time of public transport vehicles, simulating a conductor calling
"All Aboard!" when the train is scheduled to leave and closing the doors. This is an ALPHA version of this mod.

### Changelog
### Changelog

#### 0.1.1

- Updated for 1.1.11f. Removed pathfinding cleanup functionality, at least until I have more time to experiment.

#### 0.1.0

- Instead of trying to correlate simulationFrameIndex to real-world seconds, relate them to in-game minutes, which is
Expand Down Expand Up @@ -122,23 +126,14 @@ vehicle to reject the boarding cims!
<!--Link to the forum post where the mod can be discussed-->
<ForumLink Value=""/>
<!--Version of the mod-->
<ModVersion Value="0.1.0"/>
<ModVersion Value="0.1.1"/>
<!--Recommended version of the base game to use the mod-->
<GameVersion Value="1.1.*"/>
<!--Dependency for the mod, can be set multiple times-->
<Dependency Id=""/>
<!--Change log for new version. Single line or multi line. Supports minimal markdown subset-->
<ChangeLog>
#### 0.1.0

- Instead of trying to correlate simulationFrameIndex to real-world seconds, relate them to in-game minutes, which is
more consistent.
- Use SharedStatic to make the maximum dwell delay configurable in settings (thanks @Nullpinter!). Now users can set a
fixed maximum dwell delay (in in-game minutes) for each transit family (bus, train), after which boarding will be
forced to end. By default, this is set to a conservative **8** in-game minutes for buses/trains, but each is
configurable separately.
You might want to tune the value higher if you see cims being left behind too often, or lower, if you have a high
number of vehicles on a line.
- Updated for 1.1.11f. Removed pathfinding cleanup functionality, at least until I have more time to experiment.
</ChangeLog>
<!--External link. supported types are discord, github, youtube, twitch, x, paypal, patreon, buymeacoffee, kofi, crowdin, gitlab-->
<ExternalLink Type="github" Url="https://github.com/bcallender/AllAboard"/>
Expand Down
18 changes: 2 additions & 16 deletions AllAboard/Setting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,17 @@ public class Setting : ModSetting
[SettingsUISlider(min = 0, max = 30, step = 1, unit = "Minutes")]
public int BusMaxDwellDelaySlider { get; set; }

public bool TestPathfindingCleanup { get; set; }


[SettingsUIButton]
public bool ApplyButton
{
set
{
PublicTransportBoardingHelper.TrainMaxAllowedMinutesLate.Data = (uint)TrainMaxDwellDelaySlider;
PublicTransportBoardingHelper.BusMaxAllowedMinutesLate.Data = (uint)BusMaxDwellDelaySlider;
PublicTransportBoardingHelper.CleanUpPathfindingQueue.Data = TestPathfindingCleanup;
Mod.log.InfoFormat(
"Now max dwell delay: Bus: {0} minutes, Train : {1} minutes. Pathfinding cleanup? {2}",
"Now max dwell delay: Bus: {0} minutes, Train : {1} minutes.",
PublicTransportBoardingHelper.BusMaxAllowedMinutesLate.Data,
PublicTransportBoardingHelper.TrainMaxAllowedMinutesLate.Data,
PublicTransportBoardingHelper.CleanUpPathfindingQueue.Data);
PublicTransportBoardingHelper.TrainMaxAllowedMinutesLate.Data);
}
}

Expand All @@ -44,7 +39,6 @@ public override void SetDefaults()
{
TrainMaxDwellDelaySlider = 8;
BusMaxDwellDelaySlider = 8;
TestPathfindingCleanup = false;
}
}

Expand Down Expand Up @@ -80,14 +74,6 @@ public IEnumerable<KeyValuePair<string, string>> ReadEntries(IList<IDictionaryEn
_setting.GetOptionDescLocaleID(nameof(Setting.BusMaxDwellDelaySlider)),
"Maximum amount of (in-game) time to allow a Bus to 'dwell' beyond its scheduled departure frame. "
},
{
_setting.GetOptionLabelLocaleID(nameof(Setting.TestPathfindingCleanup)),
"Experimental Pathfinding Cleanup"
},
{
_setting.GetOptionDescLocaleID(nameof(Setting.TestPathfindingCleanup)),
"Attempt to clean up passengers after forcing train to depart. Do not enable this unless you are testing the functionality."
},
{ _setting.GetOptionLabelLocaleID(nameof(Setting.ApplyButton)), "Apply" },
{ _setting.GetOptionDescLocaleID(nameof(Setting.ApplyButton)), "Apply Settings" }
};
Expand Down
Loading

0 comments on commit 7db4c62

Please sign in to comment.