Modding in C# feels incredibly boring and tedious.

Users who are viewing this thread

I am also learning C# to try and mod Bannerlord and I have to agree with OP's assessment of the language. Coming from Python, Lisp, even C it seems like a TON of boilerplate to do even simple tasks. If I understand the paradigm correctly, in order to mod any feature you have to override the entire class? What a waste. In Python for example, you can just monkey patch in a specific method or attribute and avoid blasting an entire base class. Seems overriding classes is just going to create unnecessary conflicts between mods and between different versions. The whole public/private layout of the code I have viewed so far in dotPeek seems arbitrary and entirely unnecessary. Tons of getters and setters that do nothing but retrieve an attribute or set that attribute.
 
I am also learning C# to try and mod Bannerlord and I have to agree with OP's assessment of the language. Coming from Python, Lisp, even C it seems like a TON of boilerplate to do even simple tasks. If I understand the paradigm correctly, in order to mod any feature you have to override the entire class? What a waste. In Python for example, you can just monkey patch in a specific method or attribute and avoid blasting an entire base class. Seems overriding classes is just going to create unnecessary conflicts between mods and between different versions. The whole public/private layout of the code I have viewed so far in dotPeek seems arbitrary and entirely unnecessary. Tons of getters and setters that do nothing but retrieve an attribute or set that attribute.

To be fair, python,Lisp and C were not designed for complex gameplay programming. Can you imagine writing gameplay code in Unreal Engine 4 with these languages? It would be a nightmare. C# is the right choice because it offers scalability and maintainability of complex code but has a much easier learning curve than C++. Out of all the object oriented programming languages out there that offers a balance of scalability and ease of use, C# strikes the right balance. I agree there might be more boilerplate for some cases compared to say Python, but you have to understand we need to cater for all kinds of projects large or small. Every language has its weaknesses and strengths and we can't please everyone for all cases. If you are making a small and simple mod, then C# is overkill but if you are making a complex overhaul, then C# is the way to go... or C++ or even Rust.
 
To be fair, python,Lisp and C were not designed for complex gameplay programming. Can you imagine writing gameplay code in Unreal Engine 4 with these languages? It would be a nightmare. C# is the right choice because it offers scalability and maintainability of complex code but has a much easier learning curve than C++. Out of all the object oriented programming languages out there that offers a balance of scalability and ease of use, C# strikes the right balance. I agree there might be more boilerplate for some cases compared to say Python, but you have to understand we need to cater for all kinds of projects large or small. Every language has its weaknesses and strengths and we can't please everyone for all cases. If you are making a small and simple mod, then C# is overkill but if you are making a complex overhaul, then C# is the way to go... or C++ or even Rust.
Eh I'm not really impressed by what I've seen so far. There's entire DLLs in Bannerlord of several hundred lines that could be boiled down to basically a C struct. I think this language forces you to over engineer everything. I agree about it being easier to use than C++ though. If it was C++ or Rust I wouldn't even bother to try.
 
Eh I'm not really impressed by what I've seen so far. There's entire DLLs in Bannerlord of several hundred lines that could be boiled down to basically a C struct. I think this language forces you to over engineer everything. I agree about it being easier to use than C++ though. If it was C++ or Rust I wouldn't even bother to try.

That is because you are reverse engineering a DLL and you are not getting the code as it was written. If the original code is released for modding purposes, I would hope that they wrote it using the proper tools (such as inheritance and all that fun stuff). And if they don't, that's on who wrote the code, not the language.

Then of course we all have languages that we like and languages that we don't like (and we usually prefer what we started writing code in). But rest assured, what you are going through now is made much worse than it needs to be by the fact that we don't have proper modding tools.
 
I have to say C# is a massive improvement. Sure, I liked Monty/MABL's ease of use and quirks that allowed for out-of-the-box thinking and gimmicks a lot, but the same dependence on gimmicky workarounds limited it greatly (having to rely on parties or troop inventories to simulate arrays, no way to work with strings apart from joining them together and some other stuff that should have been trivial otherwise). Monty just can't handle such a supposedly ambitious game. It's not 2012 anymore.

Not to mention it allowed for a limited amount of scripts/tuples, making it harder to read and work with. With C#, you can create as many functions, classes or objects as you like, organizing your code better. It's also supported by a lot of common IDEs, which helps with debugging and reviewing.
 
This thread feels incredibly boring and tedious. I programmed in dozens of modding languages over the past 2 decades. Where you have prominent languages with massive amounts of threads on the Internet about and where they are as advanced and high-level like C# you get stuff done. Period.
 
so far all ive touched is notepad++ editing Xmls - and well pig monsters, flying witches , tactical crusie goose missiles are just a matter of text lines. Maybe that it C++ , no idea and dont really care, i mod i dont bother much with I.T. Modding is a logic puzzle and creative venture whatever language its in as long as i can get to it, it don't matter.
 
Last edited:
I have been a programmer for quite some time and Bannerlord has finally got me excited about modding.

I only have two asks, apart from good docs:
  1. I need unit test support. Currently, in my code there is no way for me to do any dependecy injection or mocking, meaning I would have to run the whole thing in order to know if my 10 line new class function works... I don't know how the devs are doing their unit testing, but please open it up for us as well.
  2. UI-less E2E testing support. I would like to test tha my mod works within the context of the larger codebase without having to launch the whole UI. This helps me sniff out runtime errors and mod incompatibilities that are not possible to catch with unit testing and iterate on my code quicker.

You have us a full big-boy programming language to use for mods, please let us use best practices in our programming then.


(My apologies if this is already possible and I just didn't find it)
 
I have been a programmer for quite some time and Bannerlord has finally got me excited about modding.

I only have two asks, apart from good docs:
  1. I need unit test support. Currently, in my code there is no way for me to do any dependecy injection or mocking, meaning I would have to run the whole thing in order to know if my 10 line new class function works... I don't know how the devs are doing their unit testing, but please open it up for us as well.
  2. UI-less E2E testing support. I would like to test tha my mod works within the context of the larger codebase without having to launch the whole UI. This helps me sniff out runtime errors and mod incompatibilities that are not possible to catch with unit testing and iterate on my code quicker.

You have us a full big-boy programming language to use for mods, please let us use best practices in our programming then.


(My apologies if this is already possible and I just didn't find it)
Agree with this guy, I hope that TW does unit test and mocking support, if not maybe that's the reason why we see feature regression in every version.
 
I think that this thread is more than ever up to date.

No interesting mods have been released since its creation. Most people here are at best tweakers. Even the developers remove most of their work in the patches because they fail to correct their absolutely insane work.

I've never seen that. This is terrible. It could have been so simple, yet they decided to make it the worst architecture ever.
 
Hindsight is a powerful tool. I don't think I have ever had a software project in my career where I looked back and didn't wish I could do it all over again.

I do want testing support baked into TW's modding tools or at least supported by the code architecture. They have to be writting unit tests themselves (I hope), just open this up for modders please.
 
I think that this thread is more than ever up to date.

No interesting mods have been released since its creation. Most people here are at best tweakers. Even the developers remove most of their work in the patches because they fail to correct their absolutely insane work.

I've never seen that. This is terrible. It could have been so simple, yet they decided to make it the worst architecture ever.
Modding isn't officially supported, and we don't even have (official) access to textures/models yet. Complaining there's no big mods for a game that doesn't support modding (yet) is moronic. Complaining compatibility with the existing smaller mods/tweaks breaks when TW does refactoring/updates their game even more so.
 
two mods that i use as defacto mod editor utilities are the excellent

Enhanced Battle Test - can set any map and pick any unit in custom battle

Real Time Strategy Camera - allows free camera any time, jump into any unit plus slow or freeze time

Im focused on battle and new models but for me these two are life changers.

You can edit xml with BL2 open just need to exit then join the custom battle - for changing gear or moving heads cm's its an awesome time saver

Maybe it helps maybe it dont just thought id post
 
Personally I like that the game is in C#. Having gone to school for programming several years ago, all they taught us really was java. I don't know if they're still doing that now, but going from java to C# is a cake walk so I was able to pick up this language very quickly. Nobody seems to actually use java from what I've found, but a lot of companies including mine are using C# to make software. That means us programmers can easily draw from our work experience and apply that to modding this game.

That said, I also don't think that is the end all. Hopefully modding tools make it a lot easier. Especially if it contains a C# script editor/maker/manager of some kind. C# can be made a lot easier by implementing a scripting tool for it within your framework. I think then people will find it a lot less tedious. Typically scripts can't cover very large changes, but playing with a lot of it could be made easier. The professional software I work with for example has a built-in script manager and a scripting template for VS, and the scripts can be installed to modify most of the functionality of the software.
 
Java is dying. From what I understand it is mostly used by Government contractors because of military guidelines.

.NET does everything that Java EE does but better with better cloud support.

Also, NodeJS took a lot out of it too. Personally I am happy about that.

If you don't mind, I'll keep banging on my drum "Please give us unit testing support for mods!!!!"
 
Back
Top Bottom