Petition to release module source code for modders after the code refactor

Do you support this petition?

  • Yes!

    Votes: 67 77.0%
  • No!

    Votes: 14 16.1%
  • Don't care.

    Votes: 6 6.9%

  • Total voters
    87
  • Poll closed .

Users who are viewing this thread

While I understand Taleworlds may not be very keen to support modding while the game is unfinished and in early access, the fact is that there's already a very large group of players that use mods. The most popular mods on nexusmods have well over 200k downloads. It is clear that for many players they are a great addition to their game.

However, in particular the maintenance of mods is currently a heavy task on us mod authors due to the lack of access to the module source code. While we can decompile the DLL's back into C#, the resulting code is often convoluted and comments and local variable names are lost in the process. After every official update we have to decompile the new DLL's and painstakingly analyse what has changed and what impact the changes have on our mods.

This has resulted in a lot of popular mods lagging behind in updates, breaking people's running games or causing them to stick to earlier game versions. A popular sentiment among the community currently seems to be that people rather not play the game at all until this situation improves.

Therefore I'd like to petition Taleworlds for an earlier-than-planned release of the module source code to the community. I think the extra work (which could be made a mostly automated process) would be very much worth it to both Taleworlds and the community for the following reasons:

  • The community (in particular mod authors) could make more detailed bug reports. It happens often that people report bugs to mod authors that on investigation turn out to be vanilla bugs. Access to the module source code would allow us to debug them faster and point to the exact line numbers when we report these bugs to Taleworlds devs, making their jobs easier.
  • It would be a lot easier and faster to update mods after releases of official patches. More people would play on the latest game branches, improving the experience of many players.
  • We would be able to make better mods in general. The modding community functions very much like a meritocracy with extremely fast and parallel iteration of ideas. This information provides invaluable feedback to Taleworlds. It shows which concepts work well and which don't, which issues are in most need of fixing and what features the community is generally interested in.
  • A sizeable group of players have expressed their discontent with the general lack of features in Bannerlord's early access and roadmap compared to Warband and Viking Conquest. Enabling us modders to be a better part of the solution would show Taleworlds is doing everything it can to improve customer satisfaction. In the end, the modding community will produce much more features anyway than one dev studio ever could. Why not unleash that force as soon as possible?

At the time of writing, the Taleworlds developers are completing a major code refactor. That sounds like a perfect opportunity to share the result with the modding community. For the reasons stated above, I'm convinced this would a be a win-win for both players and developers. If you agree, please voice your support for this petition!
 
Maybe just because the code of this primary version game is unfinished. If they need to update developer documents while they are coding this game, they will pay more time for those that can be publish in the future. As you know, some codes are in a mess. So now, they decided to start code refactor, a major reason is to support modding community, I guess.
 
They already said in the last blogpost that they're planning on releasing some mod tools in the near future. I wouldn't be surprised if the decision to refactor the code now rather than later is in preparation for that.
 
The thing is, this game had already several major patch releases and yet it's missing some very esencial contents. In most cases the solution recommended by the community is - use mods.
It seems the modding community can deliver lot more effective coding as game devs.
Maybe TW should take advantage of this great modding community.
I am really curious what will be the extent of the new patch...
 
Really don't care about that since its super easy to decompile and read.

What i would love to see @MArdA TaleWorlds, probably forgetting some:
- Less variables that are private set, especially Item and Weapon flags, would be nice to change them during run-time

- Make most methods public and not internal, can't count how many times ended up copying Taleworlds code straight from the decompiler, because unable to call the original Taleworlds method from my own class.

- Rewrite MissileHitCallback so it calls sub-functions to decide particles and collision reaction like MeleeHitCallBack

- Rewrite all of the Callbacks such as MeleeHit, Missile, Defend, HorseCharge, etc, to be abstract functions with overrides like you have set up with methods such as OnPreMissionTick, OnAgentHit and OnRegisterBlow, etc, that way we don't have to use Harmony to patch it

- Same with MissionScreen methods and variables that deal with the camera. Make camera values accessible so we don't have to use Harmony to patch grab and patch instance variables if we want to make a camera mod.

- Bring back a Callback for weapons hitting world. This probably got patched out as a performance issue, but i would love to see an empty client side call to that collision that does not do anything, but modders can overwrite.

- Abstract over-writable method such as OnAgentHit, do not carry sufficient data to be useful, it needs to pass the collision data. Plus not sure what the point of that is when we have OnRegisterBlow

- Code for fields such as Items and weapons needs to be more easily extendable than using enums, maybe a dictionary to which we can add custom fields in conjunction with loading CraftingPieces and Items / Weapons from .xml needs to be over-writable. As modders we may want to add our own data fields and load them into items/weapons, would make things a lot easier and open up treasure chest of possibilities.

- Expose more ground level functionality and variables from Game.dll especially "native_parameters.xml". Meaning some way on adding custom collision logic / collision event handlers.

EDIT:

- UI, almost forgot, this is huge.
- Currently no way to modify UI except for using Harmony. There is a great library out already "UIExtender" lib that handles the functionally for you using Harmony patches on the other end. Would love to see some official love from the developers on trying to make this extendable without patches.

EDIT 2 :
- Item usage flags.
- Instead of "No shield", make some that are "no bow" or no "x bow", that way we can have more advanced functionallity with using bows and select shields by just configuriong the xml files and not having to weed out shields in code that we dont want to use with bows.

If we only could have one thing from the refactor:

Make all of the ground level callbacks (MeleeHit, etc), abstract over-writable functions, which would allow us to skip executing Taleworlds code entirely and running our own logic if needed without having to revert to messy Harmony patches, using static methods to try to mess with instance variables. With Mission and MissionScreen class variables and methods more accessible without messy Harmony patchwork.
 
Last edited:
Really don't care about that since its super easy to decompile and read.

Depends entirely on what you're looking at. Take for example the AiMilitaryBehavior.AiHourlyTick method with 17 unnamed local variables and plenty of literal numbers that were most likely constant variables that the compiler inlined.

I also would hope methods like that have some comments in the source code, because many AI behaviour methods are quite big.
 
Yes, although source code isn't really a "tool" per se. When I read that I expected something like a scene editor, or maybe something export/import models.
Ah, I see. I thought you were talking about the modding tools. Is full source code something that commercial games usually release, though? I mean I haven't seen any indication that they were planning on releasing that much of the game to us, but it would be awesome if they did.
 
Source code for games is almost never released. What people call the "source code" in warband is more like a simple code injector that the hidden base classes (written in C or C++ or whatever) can call. The code people make warband mods in isn't the same language as the game is written in.

I remember there being a Q&A where they said that some features would never be editable, implying that they'll never release more than is currently exposed to C#.
 
With source code I mean the rough equivalent of Warband's module system and hopefully a little more. So, the source code of the DLL's of the official modules (Native, Sandbox, etc.) and hopefully also some of the client DLL's like TaleWorlds.CampaignSystem.dll. So yeah, the stuff needed to make total conversions a la Prophesy of Pendor.

The code people make warband mods in isn't the same language as the game is written in.

A distinction should be made between the core engine and "the game". A lot of higher level game mechanics (especially campaign) of Warband are made just like mods are.
 
Last edited:
Ah, I see. I thought you were talking about the modding tools. Is full source code something that commercial games usually release, though? I mean I haven't seen any indication that they were planning on releasing that much of the game to us, but it would be awesome if they did.

No, and you don't really want everything out for security reasons / proprietary work.

Don't get me wrong what we have is great. A lot of games usually only expose some basic event handlers to modders, aka "If something interesting happens --> execute your mod code".
 
Depends entirely on what you're looking at. Take for example the AiMilitaryBehavior.AiHourlyTick method with 17 unnamed local variables and plenty of literal numbers that were most likely constant variables that the compiler inlined.

I also would hope methods like that have some comments in the source code, because many AI behaviour methods are quite big.

I would not be opposed to that and comments, although it seems like the comments are cleaned up, since sometimes decomplier does capture those. And release it with each major update of the game / mod tools.

C# source is functionally not different from anyone decompiling and copy-pasting code with dnSPY.

Except for core engine functionality in places like Game.dll (C++ lib)
 
I'm definitely not against to this idea. And since we live in 2020, it would be also better to upload that stuff to Github perhaps - so people can get the latest version automatically. Or perhaps see some upcoming changes in branches, this also separates modding/coding related questions from the forum and people could ask questions on there right away to the "source" ( devs ). Although Its really up to them I think. This is a huge step towards transparency and they don't have to do that and I personally don't expect them to do that. But the code/module is somewhat unprotected and open to anyone already.

It would be better to have proper documentation between Gameplay base(C# code) and Core Engine interface(RGL/C++)
Some stuff is just a blackbox. We don't have to know it's copyrighted code entirely but it would be better to know capabilities of the engine and/or their functionality without reading their currently unstructured code.
I think the first thing they will do is giving access to in-game editor and material/object viewer etc. Then perhaps they can create an example starter submodule and start contributing to that one with more tutorials like "We are going to add a new castle in this tutorial" - but even this will happen by the community quite fast anyway so perhaps they won't even bother to do that.
 
While I understand Taleworlds may not be very keen to support modding while the game is unfinished and in early access, the fact is that there's already a very large group of players that use mods. The most popular mods on nexusmods have well over 200k downloads. It is clear that for many players they are a great addition to their game.
They're not just additions. In many cases, they are essentials for enjoying the game or even to make it playable.

However, in particular the maintenance of mods is currently a heavy task on us mod authors due to the lack of access to the module source code. While we can decompile the DLL's back into C#, the resulting code is often convoluted and comments and local variable names are lost in the process. After every official update we have to decompile the new DLL's and painstakingly analyse what has changed and what impact the changes have on our mods.

This has resulted in a lot of popular mods lagging behind in updates, breaking people's running games or causing them to stick to earlier game versions. A popular sentiment among the community currently seems to be that people rather not play the game at all until this situation improves.

Therefore I'd like to petition Taleworlds for an earlier-than-planned release of the module source code to the community. I think the extra work (which could be made a mostly automated process) would be very much worth it to both Taleworlds and the community for the following reasons:

  • The community (in particular mod authors) could make more detailed bug reports. It happens often that people report bugs to mod authors that on investigation turn out to be vanilla bugs. Access to the module source code would allow us to debug them faster and point to the exact line numbers when we report these bugs to Taleworlds devs, making their jobs easier.
  • It would be a lot easier and faster to update mods after releases of official patches. More people would play on the latest game branches, improving the experience of many players.
  • We would be able to make better mods in general. The modding community functions very much like a meritocracy with extremely fast and parallel iteration of ideas. This information provides invaluable feedback to Taleworlds. It shows which concepts work well and which don't, which issues are in most need of fixing and what features the community is generally interested in.
  • A sizeable group of players have expressed their discontent with the general lack of features in Bannerlord's early access and roadmap compared to Warband and Viking Conquest. Enabling us modders to be a better part of the solution would show Taleworlds is doing everything it can to improve customer satisfaction. In the end, the modding community will produce much more features anyway than one dev studio ever could. Why not unleash that force as soon as possible?

At the time of writing, the Taleworlds developers are completing a major code refactor. That sounds like a perfect opportunity to share the result with the modding community. For the reasons stated above, I'm convinced this would a be a win-win for both players and developers. If you agree, please voice your support for this petition!
Agree on everything.
 
- Make most methods public and not internal, can't count how many times ended up copying Taleworlds code straight from the decompiler, because unable to call the original Taleworlds method from my own class.

You can use Harmony to access internal classes/methods btw. It's a better solution than copying the code, which would not be updated by official patches.
 
Yes, problem is harmony patch has to be a static method.

You can generally always make it work, with instance variables etc, but it can be much cleaner using native pathways.

There are so many mods on Nexus using Harmony for every little thing when there is literally no need, where there are behaviors and event handlers meant to be extended without it.
 
I HOPE there is very little coding (none) involved with these Mod Tools ! Most players aren't programmers, they need Visual drag-drop screens - UI to change stuff. In this day and age, no gamer should need to do low level coding to mod a game. This is not the 80s where you needed to know ASM ! (yes, painful memories)

.
 
I HOPE there is very little coding (none) involved with these Mod Tools ! Most players aren't programmers, they need Visual drag-drop screens - UI to change stuff. In this day and age, no gamer should need to do low level coding to mod a game. This is not the 80s where you needed to know ASM ! (yes, painful memories)

.
It's not a requirement that the average player is able to create all kinds of mods. I do agree that the modding tools should be as user friendly as possible, but there will always people who are going to achieve more than others because of expertise and creativity.
 
I HOPE there is very little coding (none) involved with these Mod Tools ! Most players aren't programmers, they need Visual drag-drop screens - UI to change stuff. In this day and age, no gamer should need to do low level coding to mod a game. This is not the 80s where you needed to know ASM ! (yes, painful memories).

I am all for visual tools being available to people who need them, but you will always have more modding power making changes from code. Access to code is a good thing, not a bad thing.
 
Back
Top Bottom