Jump to content

What is your preferred format for an introduction into C:SL mod development?  

55 members have voted

  1. 1. What is your preferred format for an introduction into C:SL mod development?



31 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Right now I only have little time, and I'm not able to write new mods. But I want to share my knowlege about Cities: Skylines mod development with you!

Mod Development Tutorials

 

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Is this a coincidence? I tweeted this a couple hours ago. :D

Although my video won't be about modding specifically, just about running scripts and changing some values for testing probably, for complete beginners. So it still could be useful since browsing mod tools and making temporary scripts is how I get mod ideas.

My vote was for the written one, since then you could explain the process of making a mod from scratch, depends how inexperienced your target audience is.

The problem I see with some tutorials in any field is that some things are not explained and it's "just do this because I said so". I guess there are people who want that but I'm not betting on those actually getting anywhere with modding. If people understand why the code is what it is, it's more likely they can apply this knowledge to their own modding ideas.

  • Like 2
  • Thanks 1

Ronyx rhymes with electronics...  

Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

As a noob in asset editing, I would be really interested in a tutorial about the basics of ModTools scripts.

About the format, I usually prefer text tutorials rather than videos, as you can get a better overview, e.g. skip the parts you already know about, easily find parts which you didn't understand at the first read, etc.
Of course there are exceptions where videos are more effective.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I think a start-up one would be super helpful, taking us right from the beginning to end on "how to create x mod". That would ideally include *everything*, like literally every step of the way from writing a script to running it in ModTools, etc.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I would also like to know how exactly Mod Loader works, specifically how to load files (textures, models) from mod's folder. 

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    4 hours ago, pauliaxz said:

    I would also like to know how exactly Mod Loader works, specifically how to load files (textures, models) from mod's folder. 

    That's a quite advanced topic, but I will try to cover it.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I've only barely started modding -  I found it easy enough to get started from looking at other mods, but documentation on the internal systems would be a massive help, so that gets my vote.

     

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I've only made assets so far but I would love to make a mod that changes how wealth works. Therefore, documentation would be greatly appreciated. With enough help and knowledge, I could tie wealth to jobs and possibly add a new wealth level (Elites, since we have working poor, middle class, and upper-middle class already) and a few new education levels (but that would require 2 new school buildings).


    Ocram's Razor: Though "more things shouldn't be used than are necessary," they're just too fun to pass up! Expect many verbose arguments from me. I will try to write abstracts before or short summaries after from now on.

    Words to live by:
    "Now there are varieties of gifts, but the same Spirit. But to each one is given the manifestation of the Spirit for the common good. For to one is given the word of wisdom through the Spirit, and to another the word of knowledge according to the same Spirit; to another faith by the same Spirit, and to another gifts of healing by the one Spirit... But one and the same Spirit works all these things, distributing to each one individually..." 1 Corinthians 4-11

    "Do not worry about tomorrow; for tomorrow will care for itself. Each day has enough trouble of its own." Matthew 6:34
    "Do not judge so that you will not be judged. For in the way you judge, you will be judged; and by your standard of measure, it will be measured to you." Matthew 7:1-3

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Are there any specific topics that you are interested in?

    Below are some of the topics I would like to cover with tutorials (with embedded extra documentation):

    • Setting up a Mod project in Visual Studio, creating a very basic Hello World Mod using only the official modding API
    • A mod that modifies prefabs, for example building props or networks (the typical "Replacer" mod)
    • A mod that lets you adjust the colour of street lights
    • A mod that displays the number of buildings/vehicles/trees in your city in a floating window
    • No Seagulls mod (using detours)
    • A mod that adds a new (simple) network type, like a new type of power line

    These are things I would like to explain in my tutorials:

    • Debugging and Viewing the Scene Graph with Mod Tools
    • Hooks provided by the game and the UnityEngine (loading, threading, economy, demand, chirper)
    • Structure of the game: Managers, Collections, Prefabs, Instances and ties with the unity engine.
    • Overview of the prefab types and their properties (Buildings, Props, Vehicles...)
    • Reverse Engineering and Detours: How to replace algorithms and functions
    • C#: Difference between classes, objects, structs, singletons and static members and when to use what
    • C#: Arrays, Lists, Dictionaries explained
    • Adding mod settings, saving and loading .xml files
    • Advanced User Interfaces (like Building Themes or Network Skins)
    • Saving Custom Data in Savegames
    • Asset Editor Modding
    • Manually Loading textures and meshes
    • Adding custom networks
    • Advanced Loading hooks
    • Modifying AI behavior

     

    • Like 3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Awesome initiative!

    I don't care much for tutorial video's, but that's just me, and in any case any additional bit of info regarding modding is more than welcome (it often feels like stabbing in the dark to me).

    One thing I'd like to learn a bit more about is detouring: I'm familiar with the basic concepts and methods, but even after studying lots of code snippets I'm still have problems working out what bits to detour and how to implement them (my personal White Whale is finding out if in any way it is possible to access props/trees/assets on instance level, so individual items can be customized without the changes applying to every instance [think road sign props, for example], and if so, how to trace the relevant bits of code that need to be detoured).

    Other things would be debugging methods (I usually just output stuff to the output log to check things - tedious doesn't even begin to describe it), and whether there are tips and tricks to fix issues that I can't reproduce locally.

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    3 hours ago, Judazzz said:

    (my personal White Whale is finding out if in any way it is possible to access props/trees/assets on instance level, so individual items can be customized without the changes applying to every instance [think road sign props, for example], and if so, how to trace the relevant bits of code that need to be detoured).

    NetworkSkins does it. For props and trees, it all happens in this detour class. It just detours multiple methods of NetLane. The code you see is the slightly modified source code of the game (changes are marked with //mod begin/end). You can apply the same method to buildings.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I think a series would be nice -- maybe having a video (or chapter, section, whatever works :p) on making something super basic, then adding one or two new features that you introduce/teach. For example, if the first "episode" is on bus stop replacement, the next "episode" can be on adding a UI to that mod, then the "episode" after that can be on using detours, etc. That way we build upon knowledge gained from previous "episodes" so we can eventually make our own super complex mods, :) instead of learning everything individually without examples showing us how to use them or combine them together.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Lots of great ideas here :yes:

    Would definitely agree with @Judazzz that some guidance on effective debugging would be real useful; not covered at all so far I don't think; and could save novices such as myself many hours trying to get meaningful feedback blundering between error messages, modtools, output logs and just basic trial and error *:???: 

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I'd really love to know how to get Catenary Replacer to work on segment-level, including option to have wires or not.

    Anyway, from your list I'm really interested in Adding Custom Networks, and setting up 'Replacer mods'. Video preferred, or text with images (I need something visual) 


    ekCYJKD.pngTim The Terrible's Steam Workshop

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 5/26/2017 at 8:54 AM, boformer said:

    Manually Loading textures and meshes

    does this mean importing different meshes into the editor that will then be saved with the asset? (right now if you copy meshes from other assets into the editor using modtools and hit save the mesh doesn't actually save)


    Come follow me on Twitter @CS_badpeanut 🥜 or Facebook!

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    7 hours ago, Scott.dft said:

    not covered at all so far I don't think; and could save novices such as myself many hours trying to get meaningful feedback blundering between error messages, modtools, output logs and just basic trial and error 

    That's basically how debugging works in C:SL :(

    3 hours ago, Bad Peanut said:

    does this mean importing different meshes into the editor that will then be saved with the asset? (right now if you copy meshes from other assets into the editor using modtools and hit save the mesh doesn't actually save)

    After the reverse engineering and asset editor mods tutorial, you might be able to find the reason why things are not saved (and how to fix it).

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    10 hours ago, Tim The Terrible said:

    I'd really love to know how to get Catenary Replacer to work on segment-level, including option to have wires or not.

    Anyway, from your list I'm really interested in Adding Custom Networks, and setting up 'Replacer mods'. Video preferred, or text with images (I need something visual) 

    Sounds like what you'll need is a bit like a combination of American Roadsigns and Prop it Up.
    If catenaries are the same as road network/lane props, and if rail segments each have a unique identifier (InstanceID?), then (as far as I know) that's all you need: use a network segment selection tool, open a UI window after selecting a segment containing a drop-down/combo box/whatever that lists all available catenaries, and after clicking the Apply button save it as a replacement in the config file (segment id, original prop name/id, replacement prop name/id), and then run the method that replaces the present prop with the selected replacement one in real time (can be the same method that handles the replacements OnLevelLoad).

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    1 hour ago, Judazzz said:

    and after clicking the Apply button save it as a replacement in the config file

    Please don't do that. Data like that belongs into the savegame. I will try to cover that as well.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    2 hours ago, Judazzz said:

    Sounds like what you'll need is a bit like a combination of American Roadsigns and Prop it Up.
    If catenaries are the same as road network/lane props, and if rail segments each have a unique identifier (InstanceID?), then (as far as I know) that's all you need: use a network segment selection tool, open a UI window after selecting a segment containing a drop-down/combo box/whatever that lists all available catenaries, and after clicking the Apply button save it as a replacement in the config file (segment id, original prop name/id, replacement prop name/id), and then run the method that replaces the present prop with the selected replacement one in real time (can be the same method that handles the replacements OnLevelLoad).

    They are lane props indeed and the wires are segments (next to rail and gravel). @boformer had an Alpha version of this functionality but that was before Mass Transit. If he doesn't have time, maybe another modder can have a look, with permission. Another thing was that removing the wires per segment didn't work. The final thing was that it was hard to remove the LOD of the wires (as is already the case in Catenary Replacer). 


    ekCYJKD.pngTim The Terrible's Steam Workshop

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 5/26/2017 at 2:43 PM, alborzka said:

    I think a series would be nice -- maybe having a video (or chapter, section, whatever works :p) on making something super basic, then adding one or two new features that you introduce/teach. For example, if the first "episode" is on bus stop replacement, the next "episode" can be on adding a UI to that mod, then the "episode" after that can be on using detours, etc. That way we build upon knowledge gained from previous "episodes" so we can eventually make our own super complex mods, :) instead of learning everything individually without examples showing us how to use them or combine them together.

    I really like the building on knowledge approach - when done right it establishes good patterns that allows you to move beyond the tutorials.

    On 5/25/2017 at 4:54 PM, boformer said:

     

    • C#: Difference between classes, objects, structs, singletons and static members and when to use what
    • C#: Arrays, Lists, Dictionaries explained

     

    Personally, I think the focus should be on learning how to build fun mods, not learning how to C# - there are already plenty of tutorials on that.  Let the community help with explaining programming concepts and questions.

     

    Something I see often requested is a mod that overrides the road name generation.  It could be a fun 'first' mod to make?

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    3 hours ago, AnotherAdo said:

    Personally, I think the focus should be on learning how to build fun mods, not learning how to C# - there are already plenty of tutorials on that.  Let the community help with explaining programming concepts and questions.

    There is a difference between normal/enterprise development and game/mod development.

    CO provides provides a singleton implementation and a high-performance fixed arraylist. They also use structs and ref parameters to modify them. It is all done to improve performance.

    That's why I would like to cover these topics

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    7 hours ago, boformer said:

    There is a difference between normal/enterprise development and game/mod development.

    CO provides provides a singleton implementation and a high-performance fixed arraylist. They also use structs and ref parameters to modify them. It is all done to improve performance.

    That's why I would like to cover these topics

    You are right - I've done my fair share of game dev to know that performance is king.   My apologies, the way it was worded made me think that it was more of an 'Intro to OO principles', rather than how to use those principles for CS.   Given the context, I should have realised that :)

    Also - thank you for taking the time to do this!

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 2017-5-27 at 5:33 PM, boformer said:

    After the reverse engineering and asset editor mods tutorial, you might be able to find the reason why things are not saved (and how to fix it).

    I think it's just a limitation in the game (like how we couldn't have sub buildings for a while) There's no reason why it shouldn't work apart from that fact that the game isn't built to do so.


    Come follow me on Twitter @CS_badpeanut 🥜 or Facebook!

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    7 hours ago, Bad Peanut said:

    I think it's just a limitation in the game (like how we couldn't have sub buildings for a while) There's no reason why it shouldn't work apart from that fact that the game isn't built to do so.

    You have to find out where which mesh is saved by the game, and where it is taken from. Then you might be able to replace it.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I just published the second tutorial:

     

    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I just finished the next tutorial:

     

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    And another one:

     

    • Like 1

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections