Modding in C# feels incredibly boring and tedious.

Users who are viewing this thread

And for what reason would they release the compiled code?

It is not stated that there will be scripting tools.

I guess we shall see. And don't get me wrong, it is indeed extremely easy to tweak things or add a new feat and so on and so fourth. But as I said, adding a party that starts at a certain IMapPoint with custom heroes is extremely tedious, as well as modifying the damage system or modifying the heroes' attributes that are deserialized from the xml files. It doesn't seem possible to me to modify the individual AI behavior, which is something that was really easy to do in Warband.

You are not answering my concerns at all, and your arguments are clearly pointless.

Those are just examples . But indeed, it is a great architecture for 'tweakers'. If you aim at something else, you will take much more time to achieve it (although I admit it may not be the case for menus).
 
C# : private Dictionary<string, string> testDictionary = new Dictionary<string, string>();
Godot : var testDictionary = {}

InformationManager.DisplayMessage(new InformationMessage("Blah blah."));
In any prog langage I know, you don't have "new InformationMessage". You just add the godammn message, and don't have to tell to create a "new" message. Bull****.
This tells me you're just new to programming, probably with a dynamically typed language like Python,ruby,js, etc. Which is great (Python is the main language we use at work and I love it), but you have to gain more experience before making comments like this.

With that said, the game's code is indeed a little restrictive, but with Harmony it's not so bad.
 
Last edited:
You are not answering my concerns at all, and your arguments are clearly pointless.
Hopefully the following will help to address your concerns.

But as I said, adding a party that starts at a certain IMapPoint with custom heroes is extremely tedious
Then create a method (or extension method) to do exactly this. These are beginner concepts...

as well as modifying the damage system
Easy to do through an AgentApplyDamageModel, which will allow you to access the AttackCollisionData as well for extra logic.

modifying the heroes' attributes that are deserialized from the xml files
You can do this quite easily by overriding the heroes with your own module's heroes. No programming experience required.

It doesn't seem possible to me to modify the individual AI behavior, which is something that was really easy to do in Warband.
Needs clarification on what you mean by "individual AI behavior" (e.g. combat AI, campaign AI, etc.)
 
Decompiling mountains of C# is far from ideal, but I'm genuinely shocked that people think opcode written in python lists for a state machine written in python is a better approach
 
Decompiling mountains of C# is far from ideal, but I'm genuinely shocked that people think opcode written in python lists for a state machine written in python is a better approach
They don't know any better. There's literally a guy saying he's never seen a statically typed language as a reason for C# being bad ?
 
You can't even load a text file into memory with Lua, and extremely slow if not using the latest LUA JIT compiler. Python is slow as all hell and a janky mess. Don't get me started on Ruby.

C# Is a much better choice. I learned how to program just by making a couple lines of code for the Skyrim TES5Edit modding tool. It used Delphi, the syntax being designed by the same guy that did C#'s. It was very easy to switch to that without any prior experience with the language.

The main problem with C# is the garbage collector. It causes stutters all the bloody time, so we have to hope TaleWorlds is competent enough to handle it properly. Eight years of work and with what they've come up with, though, isn't instilling confidence.
 
Technically C# is an upgrade from what MB had but its still outdated and bogged down for a modern game. Its disappointing but we still should, should get better mods with this game unless for some reason this current .DLL nonsense isnt just from not having an official modding tool...lol, requiring a .DLL is worst idea ever for modding and about as big of a risk to a persons computer as any other file type and no company should ever be making a game based on modding that uses them.
that's why your mods has to be open source
 
but you have to gain more experience before making comments like this
I am indeed a novice programmer, it's not my job to code, but from what I have seen so far, toying with python, lua , and other PL, C# is the most unintuitive, over complex, piece of I have come across. Now once you know it, or if you are very smart, or learnt it at school, or whatever, it is probably a great engine, and VB and intellisense are great, but it is, once again, imho, and overcomplex piece of . Just creating a function is freaking unintuitive. In what kind of freaking world is a PL so dumb that I have to create a var, and then tell again the PL I created a var. I am so mad after this piece of PL atm...
I just want to create a freaking function, and this stupid ask to give it a "body" ? An then it won't recognize the vars I am passing through this function ? Seriously ? WTF ?
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rigale2RoC;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;
using TaleWorlds.CampaignSystem;


namespace Rigale2RoC.Systems
{
    class Rigale2Systems
    {
        public int Rig2_getAttributeCheckResult(CharacterAttributesEnum attributeToCheck, String difficulty);
        {
        int result;
        int AttributeValue = Hero.MainHero.GetAttributeValue(attributeToCheck);
        int randomCheck = new Random().Next(1, 20);
        result = randomCheck + AttributeValue;
        return result;
        }
    }
}
Just this very simple function won't work because whatever godammit.
 
I am indeed a novice programmer, it's not my job to code, but from what I have seen so far, toying with python, lua , and other PL, C# is the most unintuitive, over complex, piece of I have come across. Now once you know it, or if you are very smart, or learnt it at school, or whatever, it is probably a great engine, and VB and intellisense are great, but it is, once again, imho, and overcomplex piece of . Just creating a function is freaking unintuitive. In what kind of freaking world is a PL so dumb that I have to create a var, and then tell again the PL I created a var. I am so mad after this piece of PL atm...
I just want to create a freaking function, and this stupid ask to give it a "body" ? An then it won't recognize the vars I am passing through this function ? Seriously ? WTF ?
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rigale2RoC;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;
using TaleWorlds.CampaignSystem;


namespace Rigale2RoC.Systems
{
    class Rigale2Systems
    {
        public int Rig2_getAttributeCheckResult(CharacterAttributesEnum attributeToCheck, String difficulty);
        {
        int result;
        int AttributeValue = Hero.MainHero.GetAttributeValue(attributeToCheck);
        int randomCheck = new Random().Next(1, 20);
        result = randomCheck + AttributeValue;
        return result;
        }
    }
}
Just this very simple function won't work because whatever godammit.

The semicolon at the end of the function header will be giving you an error.

Try this.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rigale2RoC;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.MountAndBlade;
using TaleWorlds.CampaignSystem;


namespace Rigale2RoC.Systems
{
    public class Rigale2Systems
    {
        public int Rig2_getAttributeCheckResult(CharacterAttributesEnum attributeToCheck, String difficulty)
        {

        int AttributeValue = Hero.MainHero.GetAttributeValue(attributeToCheck);

        int randomCheck = new Random().Next(1, 20);

        return randomCheck + AttributeValue;
        }
    }
}


I personally hate vars, if you know what type you want a variable to be just make it that type. Vars lead to lazy programming and less readable code.
 
@Nunu Programming a game like Bannerlord with all those systems and components that interact with each other NEEDS a strong typed language at its core. The main advantage of this is, that many errors are already throwing at compile time. This is what you experience, when your IDE tells you what you cannot do. Like calling a method that requires a String as a parameter with another type, like an integer.
It is understandably frustrating, that you cannot write down a function as quickly as in python. But it is basically protecting the programmer making mistakes, that would otherwise come at him at runtime. In massive projects, this can save you alot of headache later on.
 
that's why your mods has to be open source

What mods are not open source? The only games I can think of that are heavily modded that had more people try to claim their mods cannot be modded more than M&B mods are the Sims games where people were fighting hard to monetize their mods.It also has nothing to do with what I said. C# and .DLL are a horrible idea for modding.I really do hope they put some legit work into making official tools handle the bulk of the legwork and give an end result that is not a .DLL. They are messy, cause way too many conflicts when you start having more than a few mods and they are all kinds of security risks. This is why the over-whelming majority of mod based games do not use them and its rather gob-smacking that Taleworlds went this route knowing their game is going to be heavily mod reliant.
 
I do understand the replies stating that it is a far better programming langage overall, and I'm not against that.

The problem that I see is that it seems very easy to add tweaks, but it would be extremely hard for example to modify the individual combat AI, the spawn of a party, the properties of the hero class, the formula to output damages when in warband it was extremely simple.

I am worried for many reasons, but also because they designed some systems to be incredibly black box and difficult to tweak such as the melee damage output in the code. If you fiddle with it, you will see a bunch of goto functions, of variables defined one after the other and it doesn't seem that it can be modified easily without using harmony. Seriously??


public static float CalculateStrikeMagnitudeForSwing(
float swingSpeed,
float impactPointAsPercent,
float weaponWeight,
float weaponLength,
float weaponInertia,
float weaponCoM,
float extraLinearSpeed)
{
float num1 = weaponLength * impactPointAsPercent - weaponCoM;
float num2 = swingSpeed * (0.5f + weaponCoM) + extraLinearSpeed;
double num3 = 0.5 * (double) weaponWeight * (double) num2 * (double) num2;
float num4 = swingSpeed;
double num5 = (double) (0.5f * weaponInertia * num4 * num4);
double num6 = num3 + num5;
float num7 = (float) (((double) num2 + (double) num4 * (double) num1) / (1.0 / (double) weaponWeight + (double) num1 * (double) num1 / (double) weaponInertia));
float num8 = num2 - num7 / weaponWeight;
float num9 = num4 - num7 * num1 / weaponInertia;
float num10 = 0.5f * weaponWeight * num8 * num8 + 0.5f * weaponInertia * num9 * num9;
double num11 = (double) num10;
double num12 = num6 - num11;
float num13 = num10 * 0.5f;
return 0.067f * (float) (num12 + 0.5);
public static float CalculateStrikeMagnitudeForThrust(
float thrustWeaponSpeed,
float weaponWeight,
float extraLinearSpeed,
bool isThrown)
{
float num = thrustWeaponSpeed + extraLinearSpeed;
if (!isThrown)
weaponWeight += 2.5f;
return 0.125f * (0.5f * weaponWeight * num * num);
}
public static float ComputeRawDamageNew(
DamageTypes damageType,
float magnitude,
float armorEffectiveness,
float absorbedDamageRatio)
{
float num1 = 0.0f;
float factorByDamageType = CombatStatCalculator.GetBluntDamageFactorByDamageType(damageType);
float num2 = magnitude * factorByDamageType;
float num3 = (float) (100.0 / (100.0 + (double) armorEffectiveness));
float num4 = num1 + num2 * num3;
float num5;
switch (damageType)
{
case DamageTypes.Cut:
num5 = Math.Max(0.0f, (float) ((double) magnitude * (double) num3 - (double) armorEffectiveness * 0.5));
break;
case DamageTypes.Pierce:
num5 = Math.Max(0.0f, (float) ((double) magnitude * (double) num3 - (double) armorEffectiveness * 0.330000013113022));
break;
case DamageTypes.Blunt:
label_5:
return num4 * absorbedDamageRatio;
default:
return 0.0f;
}
num4 += num5 * (1f - factorByDamageType);
goto label_5;
}
private static float GetBluntDamageFactorByDamageType(DamageTypes damageType)
{
float num = 0.0f;
switch (damageType)
{
case DamageTypes.Cut:
num = 0.1f;
break;
case DamageTypes.Pierce:
num = 0.25f;
break;
case DamageTypes.Blunt:
num = 1f;
break;
}
return num;
}

Well this looks incredibly bad to me, on top of the fact that it is not easily modifiable. And it is just a small part of the code for damage output calculation in melee. And it is also not balanced, because cutting damage will deal natively less damages than piercing damages because of the wrong formulae they implemented, spears will be overpowered when swung from a horse and so on and so forth.

So they decided to "fix" the problem by implementing a multiplier of damages of every blade of the game that you can build in the forge (you can see that in the xml files). If you know how to code, this is INCREDIBLY bad design. I'm really afraid that most of the code is difficult to read, difficult to modify and not balanced at all.

It is really good to try to simulate the physical properties of the real world, the economy etc etc but please do that when you have some knowledge in that, not just when you like fiddling around with wrong numbers and terrible simulations... And C# doesn't help by being the most difficult language to read for many reasons, with a really convoluted syntax for many things.

This game is not horribly bad, but it looks like they ported the code of warband to a better architecture but they understood that their architecture was actually really bad to make further progress (for example, dialogs with characters are boring and rare, and it is because their system to implement them looks just so wrong...). I must admit that having all the dialogs in one file in warband was much more convenient.


You do realize that this is only because of dnSpy or whatever tool you used? It's not like that in the original code.
 
C# : private Dictionary<string, string> testDictionary = new Dictionary<string, string>();
Godot : var testDictionary = {}

InformationManager.DisplayMessage(new InformationMessage("Blah blah."));
In any prog langage I know, you don't have "new InformationMessage". You just add the godammn message, and don't have to tell to create a "new" message. Bull****.

So of course I will get used to it, but please don't tell me this is, for a basic and self taught coder like myself, in any way an improvement.

Lol it's object oriented programming. Write your own DisplayMessage method?

public void ShowMessage(string Message) {
InformationManager.DisplayMessage(new InformationMessage(Message));
}

Then call your own method: ShowMessage("Blah Blah");

Better? You have the freedom to do this. Object Oriented is tidy but comes with a price.

EDIT: Most people in here just need to learn C#. It's really a easy language compared to other programm languages like c++.
 
Back
Top Bottom