You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UrbanDevKit (UDK) is a set of two SDKs (UI and .NET) that provide useful utilities and patterns for Cities: Skylines 2 mods.
25
+
It is carefully designed to be modular, robust, and as forward and backward compatible as possible.
26
+
27
+
Let's walk through a few reasons why this approach is better than traditional code sharing or dependency mods.
28
+
29
+
The often-used approach in C:S 1 was to copy and paste useful code from other mods, but this can become quickly impractical:
30
+
- Hard to track changes and bug fixes (*Who has the best version of that feature? Did someone fix this bug?*).
31
+
- Gives you more maintenance work as you have to track game updates for potential breakages and fix them yourself
32
+
- Clutters your project with third-party code.
33
+
- Forces you to adapt the code when something was not designed to be fully reusable/generic.
34
+
35
+
Another one was to create a dependency mod, however this has a few drawbacks:
36
+
- If it is broken for one feature (ex. after a game update) and does not load, all mods depending on it are broken.
37
+
- If it is not updated for a new game version, all mods depending on it are stuck.
38
+
- It forces you to update your mod when the dependency receives breaking changes, even if you don't need the new
39
+
features or don't have time to do it, increasing chances for your mod to be broken before its time.
40
+
- Load order/dependencies issues.
41
+
42
+
An SDK might often be a better solution because:
43
+
- It is included in your mod, so you can control when to update it.<br>
44
+
The .NET SDK is designed so that different mods can use a different, incompatible version, while the UI SDK is
45
+
directly integrated into the final bundle of your mod, and only the features you use thanks to
46
+
[tree shaking](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) making it potentially very light.
47
+
- If one feature is broken, only the mods using this feature are broken.
48
+
- Being modular, it is easier if you really need so to copy and paste a portion of the SDK's code into your mod and
49
+
adapt it to your needs.
50
+
- Thought for developers, it has superior documentation, examples and testing.
51
+
16
52
## Features
17
53
18
54
Features offered by UrbanDevKit (UDK) are covered in the repo's [Wiki](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki).
@@ -21,22 +57,56 @@ Here is however a quick overview of features provided by UrbanDevKit:
21
57
22
58
### .NET-only Features
23
59
24
-
-**[Shared State](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Shared-State)** Share state between assemblies without linking
25
-
-**[Coroutine Runner](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Coroutine-Runner)** Helper to start coroutines from anywhere or wrap them into Tasks.
Helper to start coroutines from anywhere or wrap them into Tasks.
26
64
27
65
### UI-only Features
28
66
29
-
None. For now!
67
+
-**[`cs2/*` Types as a Dependency](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/CS2-UI-Types-as-a-Dependency)**
68
+
Get rid of that `types/` folder from your codebase.
30
69
31
70
### .NET+UI Features
32
71
33
-
-**[Cooperative Preloading](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Cooperative-Preloading)** Prevent the user to load a game while mods are preloading
**These are instructions for modifying and building the UrbanDevKit modding libraries,
38
105
not the usage documentation of the libraries which is described above.**
39
106
107
+
> You have a cool snippet you think might be useful to other modders?
108
+
> Please open a PR or even join the project on our Discord!
109
+
40
110
Development Guides are maintained on the repo's [Wiki](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki) as well, but here's a quick access to development pages:
41
111
42
112
-**[Installing & Building UrbanDevKit](https://github.com/CitiesSkylinesModding/UrbanDevKit/wiki/Installing-&-Building-UrbanDevKit)**
0 commit comments