-
Content Count
51 -
Joined
-
Last Visited
Content Type
Profiles
Forums
Omnibus
News
Features
Downloads
City Journals
Calendar
Gallery
Everything posted by aubergine18
-
Incompatible Mods Checker (WIP)
aubergine18 posted a topic in Cities: Skylines Modding - Open Discussion
In this guide I'm going to explain how part of the mod incompatibility detection used in TM:PE works, specifically: Detecting known-incompatible mods Detecting other versions of your own mod It does not cover: Detecting "currently unknown" incompatibilities You'll need a redirection framework (eg. Harmony) to do stuff like that Persisting settings such as "Run on startup" or "Ignore disabled mods" Implementation is specific to how you choose to store settings I've tried to keep the guide as simple and generic as possible. When to use? First, an incompatible mod checker can be somewhat contentious so only implement it if you really need it. For example, these are valid reasons to implement a checker: Another mod conflicts with your mod, breaking it's functionality or causing weird bugs Some users have obsolete versions of your mod You keep forgetting to remove other builds of your mod during development & testing The first two items on that list should be obvious, but the third might seem a little strange. While developing and testing TM:PE, we realised that the game (well, Mono, actually) is really bad at coping with multiple versions of the same mod - you can, and should, read more about it in our issue tracker. The tl;dr is: If there are multiple versions of your mod installed, such as a local dev version and a workshop version, the game struggles to differentiate them. The more complex your mod, particularly if it uses lots of static classes, etc., the more nightmarish this issue becomes. With over a million subscribers (probably only about 300k active), 46 known incompatible mods, ~10 older versions of TM:PE, and 2 live versions (LABS and STABLE), we really needed this infrastructure to help tame support workload! If you spot any errors in the guide below, please let us know as you could potentially make hundreds of thousands of people a bit happier! Top-level overview The checker has three main stages: Determine when the mod checker should run: If the mod is already enabled when cities.exe is launched, wait until the plugin manager is ready Or run when the mod is enabled by the user via Main Menu > Content Manager > Mods Scan for known incompatible mods, including other versions of your mod Display a pop-up dialog allowing the user to unsubscribe/delete problematic mods See comments below for each stage in turn. Credits Krzychu124 developed the initial version of the mod checker. LinuxFan identified the issue with Mono not dealing with multiple instances of the same mod, and Dymanoid later elaborated on why that happens. Dymanoid also came up with the neat way to use a Guid to identify the current instance of the mod when scanning through other mods. FireController helped with testing. The UI code is largely based on the games' own code by Colossal Order. I've just helped out a bit on the fringes. -
Incompatible Mods Checker (WIP)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
Stage 3: User interface This stage will be added in a few days, we're currently hunting down some bugs. The TM:PE implementation can be viewed online: IncompatibleModsPanel.cs todo -
Incompatible Mods Checker (WIP)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
Stage 2: Scan for incompatible mods In stage 1, you will see we instantiate a ModsCompatibilityChecker instance, and then PerformModCheck() - here's the code that does that... The TM:PE implementation can be viewed online: ModsCompatibilityChecker.cs namespace YourNamespace { public class ModsCompatibilityChecker { private readonly Dictionary<ulong, string> knownIncompatibleMods; public ModsCompatibilityChecker() { knownIncompatibleMods = LoadListOfIncompatibleMods(); } // In TM:PE, we actually load these from an embedded text file resource, // but to keep this guide simple we'll just manually define them in code. private Dictionary<ulong, string> LoadListOfIncompatibleMods() { // You don't really need the string, tbh, so you could use a much simpler data structure here Dictionary<ulong, string> results = new Dictionary<ulong, string>(); results.Add(409184143u, "Traffic++"); results.Add(626024868u, "Traffic++ V2"); return results; } // continued below... Now, before we continue, it's important to set yourself some rules about adding mods to the list. If your mod is popular, you're potentially going to nerf the subscriber count of the mods on the list. As an example, you can view the rules we defined for TM:PE in our wiki. Furthermore, you should also post a page somewhere explaining why the mods are incompatible, and, where possible, list alternate mods (particularly if the incompatible mods are obsolete) to help users retain functionality they would otherwise lose. As an example, see this post we made in the Steam workshop. // continued from above... // Scan for incompatibilities, and if any are found show a dialog public void PerformModCheck() { Dictionary<PluginInfo, string> detected = ScanForIncompatibleMods(); if (detected.Count > 0) { IncompatibleModsPanel panel = UIView.GetAView().AddUIComponent(typeof(IncompatibleModsPanel)) as IncompatibleModsPanel; panel.IncompatibleMods = detected; panel.Initialize(); UIView.PushModal(panel); UIView.SetFocus(panel); } } // Iterate installed mods looking for any on the knownIncompatibleMods list, or other // versions of our mod. public Dictionary<PluginInfo, string> ScanForIncompatibleMods() { // This gives a unique id for our mod so we can avoid adding it to the results Guid selfGuid = Assembly.GetExecutingAssembly().ManifestModule.ModuleVersionId; Dictionary<PluginInfo, string> results = new Dictionary<PluginInfo, string>(); // You'd pull this from your mod settings, but to keep things simple we'll just define inline bool filterToEnabled = false; foreach (PluginInfo mod in Singleton<PluginManager>.instance.GetPluginsInfo()) { // Skip bundled mods, camera scripts, and, if filtered, non-enabled mods if (!mod.isBuiltin && !mod.isCameraScript && (!filterToEnabled || mod.isEnabled)) { string modName = GetModName(mod); ulong workshopID = mod.publishedFileID.AsUInt64; if (knownIncompatibleMods.ContainsKey(workshopID)) { results.Add(mod, modName); } else if (modName.Contains("YourModName")) { Guid currentGuid = GetModGuid(mod); if (currentGuid != selfGuid) { results.Add(mod, $"{modName} in /{Path.GetFileName(mod.modPath)}"); } } } } return results; } public string GetModName(PluginInfo mod) { return ((IUserMod)mod.userModInstance).Name; } public Guid GetModGuid(PluginInfo plugin) { return plugin.userModInstance.GetType().Assembly.ManifestModule.ModuleVersionId; } } } Phew! So, that's stage 2 done. We've built up a list of identified incompatible mods and, assuming we found some, it's now time to do the dreaded UI stage... -
Incompatible Mods Checker (WIP)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
Stage 1: Determine when the mod checker should run This is the easy bit For sake of brevity, I've left out the using clauses, I'm sure your IDE will help you fill in the gaps. The TM:PE implementation can be viewed online: TrafficManagerMod.cs namespace YourNamespace { public class YourMod : IUserMod { public string Name => "YourModName"; public string Description => "Your mod description"; public void OnEnabled() { if (UIView.GetAView() != null) { // The user just enabled mod via Content Manager > Mods // So we can run the checker right now CheckForIncompatibleMods(); } else { // The mod was already enabled when Cities.exe launched // We need to wait for plugin manager to be ready, so use this event: LoadingManager.instance.m_introLoaded += CheckForIncompatibleMods; } } public void OnDisabled() { // Remove the event listener LoadingManager.instance.m_introLoaded -= CheckForIncompatibleMods; } private static void CheckForIncompatibleMods() { // You'd pull this from your mod settings, but we'll just define inline for now bool ScanOnStartup = true; if (ScanOnStartup) { // This performs the next stage - checking for incompatible mods ModsCompatibilityChecker mcc = new ModsCompatibilityChecker(); mcc.PerformModCheck(); } } } } You'll notice we're using the LoadingManager.instance.m_introLoaded event in the code above; that occurs after the game has finished downloading any new or updated subscriptions and initialised the PluginManager. -
Cities Skylines: Campus Mods
aubergine18 replied to ghosty20's topic in Cities: Skylines General Discussion
TM:PE has an internal game version check, and if the game version changes (new version of game) then it shows a warning to let users know there might be issues. So far we've not had any Campus-specific issues; looks like the pathfinder and vehicle AIs have not been altered in any way as part of Campus patch. We updated the internal game version check to the new game version number and released a new version, along with some other updates, to both STABLE and LABS versions of TM:PE. If you are aware of any issues with TM:PE, please let us know. We are currently doing code review on the next release, version 10.21 (not yet released), which includes the following changes: -
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Is there a difference between the light props bundled with the mod and the original "Modern Lighting Pack" they came from? Also, catenary options don't seem to be showing for rail tracks from the Railway collection - I assume that it's because those assets have their catenary set by a dedicated "Railway Replacer" mod, but just flagging it up just in case.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
On UK Roads Revived roads, changing street lights sometimes results in lights facing wrong way like so: Not sure if it's asset or prop problem. The light facing wrong way is "LPS Street Light" which I think comes with base game. The road is a 1-lane slip road from the UK Roads Revived Motorways pack (it has some dependencies, I think the lights it uses are in the 'essentials' pack listed on asset 'required items' list).- 81 Replies
-
- 1
-
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Just noticed comment on R69 discord that NS2 should be ready next week... Would it be possible to change the way the road color thing works? Currently the palette updates every time I select new road or change color, which is somewhat annoying. Would it be possible to require manual intervention to put a color on the palette? Like clicking the larger color preview swatch or something? That way it keeps me in control over my color palette, rather than just random stuff appearing in there without me noticing. To reiterate an earlier comment:- 81 Replies
-
- 1
-
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
I'm not sure if this is a bug or a feature, but thought I'd flag it up as potentially unexpected mod behaviour - here's what I did: Placed some elevated City Park ped path - ugh, don't like those lights... Open "lights" panel in NS2 and choose a fancy "old french lamp" (note: Keep lights panel open during next steps) Try upgrading path - game won't let me upgrade ped path to path of same type (ugh, can this be changed?) Ok, I'll upgrade to some other path first and then upgrade that back to city path later... * upgrades to amusement park path * Selects city path again and upgrades, expecting it to now have old french lamps It gets the lights of the amusement park ped path ... wait, what?! Based on my workflow at the time, I was like "Why have you switched to a different street lamp?" It's like when I switched to amusement path, the lights select panel thought I'd selected a different light (amusement park light) for the city park ped path...?- 81 Replies
-
- 1
-
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Applying traffic lights to Parking Lot Roads results in lights facing away from the road rather than in to the road.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Vanilla asphalt & pavement textures (for TM:PE color palette)
aubergine18 posted a topic in Cities: Skylines Modding - Open Discussion
Hi, Does anyone have the seamless tiling textures for vanilla pavement, asphalt, bus lane and bike lane? I'm working on new color palette for TM:PE lane connector (it will also be used for revised UI for traffic lights and bunch of other stuff) and decided to test colors in HTML for faster iterations - to do that properly it would really benefit from being able to set the page background to some common textures a mentioned above. Any help (and images!) greatly appreciated -
Vanilla asphalt & pavement textures (for TM:PE color palette)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
It can now apply visualisations of different types of color blindness Once complete I'll be uploading the tool to TM:PE issue tracker (which contains additional information about the color research): https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues/287 -
Vanilla asphalt & pavement textures (for TM:PE color palette)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
Thanks Here is progress so far, with vanilla pavement texture selected: As for in-game lighting conditions, we'll be using an unlit shader to do the lane routing overlays so the colors won't be affected An added bonus is 8 - 12 fps improvement when extensive routing is applied, based on this rudimentary test map. -
Vanilla asphalt & pavement textures (for TM:PE color palette)
aubergine18 replied to aubergine18's topic in Cities: Skylines Modding - Open Discussion
What's the crp extractor? -
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Unable to change trees or lights on P & B Pavement ped path Unable to change trees and lights on several of the UK Rural and UK Small roads- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Draw Bridge Mod (WIP)
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Do you think this could evolve in to a River Ford (shallow river crossing) feature in future iterations? I'm slowly working my way through a set of street signs and finding ways to use them in game (yes, there will even be a toad crossing). However, the river ford one has be running in to this stumbling block (no pun intended): I'm using invisible roads from the workshop, one which allows bridges, however to get the vehicles close enough (ideally, "in") to the water I have to lower the bridges a lot and it ends up showing the flooded road sign. That's good in one way, it marks the road as blocked. However, literal herds of water pump trucks turn up and start trying to drain the river, which in turn ruins the waterfall I spent ages on downstream: Anyway, just throwing some crazy ideas out there- 5 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
> not worth to make a bugfix mod for that or is it? I think it would be useful assuming CO won't fix this bug (which has existed since road editor was introduced).
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Zoo street light on a raised (city) park path is rotated by 90 degrees (so it faces sideways, rather than in to the path).- 81 Replies
-
- 1
-
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
I've double-checked, I do not have NS1 anywhere (even checked the folders on disk - local and workshop). I also disabled NS2 - yet the error still appears in the log. Maybe its some other mod that copied the code from NS1? I'm currently trying to track down which mod might contain that code.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
@boformer I don't have NS1 subscribed, only NS2 (in local folder). You can see full list of mods I have (and also full log file) in this issue ticket I just created in Real Time repo: https://github.com/dymanoid/RealTime/issues/208- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Noticed this error in the log: System.TypeInitializationException: An exception was thrown by the type initializer for Mono.CSharp.CSharpCodeCompiler ---> System.IO.FileNotFoundException: Windows mono path not found: C:\Program Files (x86)\Steam\steamapps\mono\mono\mini\mono.exe at Mono.CSharp.CSharpCodeCompiler..cctor () [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at Microsoft.CSharp.CSharpCodeProvider.CreateCompiler () [0x00000] in <filename unknown>:0 at System.Xml.Serialization.XmlSerializer.GenerateSerializers (System.Xml.Serialization.GenerationBatch batch, System.CodeDom.Compiler.CompilerParameters cp) [0x00000] in <filename unknown>:0 at System.Xml.Serialization.XmlSerializer.RunSerializerGeneration (System.Object obj) [0x00000] in <filename unknown>:0 Assembly 'NetworkSkins.UI.UINetworkSkinsPanel ' resolved to '' [Serialization] Mod still functional despite the error as far as I can tell.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
I won't get time to test these with NS2 any time soon, but here's a list of super-weird roads I've been compiling as part of a release-test process for the TM:PE mod. I suspect many of these roads will confuse NS2, for example there are some with mixed tree assets, others with 3+ tree-medians, etc. https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Roads-to-Test If anyone knows of other weird roads, please let me know and I'll add to the list. Hopefully it will be a useful resource for any mods that do stuff with road networks. I plan to make a list of tracked networks too so let me know about those as well EDIT: For the lights and trees features of NS2, I think you're going to need to change tabs to lane numbers, rather than just left/right. And, ideally, while hovering a tab, highlight the lanes it refers to on the map - similar to how T++ used to do it:- 81 Replies
-
- 1
-
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
On pretty much every road, there's usually a gap in the street lights when junctions are added and for roads that have solid median over the junction (eg. the recently released UK Roads Revived Motorway pack) I have to go searching for the light in Find It in order to be able to plop down the missing lights over the junction. Would it be possible to have something in NS2 that allows me to grab the light from the selected road so I can plop it down? Or somehow enter name of the light (and category, etc) in to Find It so I don't have to manually type in search term? Also, I've experimented more with the color swatches and would definitely prefer it if adding to the palette was manual. I currently have an entire palette of dark swatches. It would be great if the initial swatches were pre-defined (eg. bus road red, bike lane green, few asphalt/concrete colors) and there was some way I could override those swatches with own colors (eg. click the large preview swatch showing current color to "copy" it, then click a smaller swatch to "paste" the color on to that swatch). It would also be nice to toggle the color chooser; once I've got my swatches set up I could hide the color chooser so only the swatches are displayed.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
As an end-user, that isn't intuitive. Maybe something similar to this would clarify - when the lines are broken, customisations affect one side or the other, but if line is joined both sides are updated...? So when I'm experimenting with colors it's going to overwrite the swatches? IMO it would be better to have some fixed pre-defined swatches (for common road colors as described in previous comments), and some custom swatches, with the ability for me to manually add and update those swatches somehow. I'll do some more testing later today, if time permits, and see if I can clarify my thoughts.- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
-
Network Skins 2
aubergine18 replied to boformer's topic in Cities: Skylines Modding - Open Discussion
Regarding the drag handle, it's probably due to weird scaling that C:SL uses. I have a QHD monitor but C:SL always limits to 1080p then that gets scaled up to the size of the monitor. No idea how to get the game to actually run at the right resolution of my rig. The lock feature is a bit weird - I don't get what a lock has to do with changing all trees at once? Is there a way to define custom swatches?- 81 Replies
-
- mod
- development
-
(and 1 more)
Tagged with:
