Recent content by zenDzee

  1. zenDzee

    Part of the problem with Sturgia getting rolled early:

    I made a test mod that sets ScoreOfDeclaringWar to zero if the (attacker) faction is already at war. So clans will not support the new war.
    NOTE: this mod made just for tests, it probably incompatible with the other "Diplomacy" mods.

    The mod overrides DefaultDiplomacyModel method GetScoreOfDeclaringWar
    C#:
        internal class TestDiplomacyModel : DefaultDiplomacyModel
        {
            public override float GetScoreOfDeclaringWar(IFaction factionDeclaresWar, IFaction factionDeclaredWar, IFaction evaluatingClan)
            {
                if (Kingdom.All.Any(k => k.IsAtWarWith(factionDeclaresWar)))
                {
                    return 0;
                }
    
                return base.GetScoreOfDeclaringWar(factionDeclaresWar, factionDeclaredWar, evaluatingClan);
            }
        }

    You can download compiled DLL from the GitHub:
    File: https://github.com/zenDzeeMods/zenD...ad/v1.0.0.2/zenDzeeMods_TestDiplomacyModel.7z
    Source code: https://github.com/zenDzeeMods/zenDzeeMods_ZenFixes/tree/master/zenDzeeMods_TestDiplomacyModel
  2. zenDzee

    Part of the problem with Sturgia getting rolled early:

    I am trying to find where is defined that "Every day, each clan that has > 200 influence has a random chance of putting forth a vote to declare war for a faction".
    Class KingdomDecisionProposalBehavior
    Method GetRandomWarDecision(Clan clan)

    I would like to change this to happens every 3-5 days.
    War/Peace decisions made by clans, and there a lot of blood-thirsty clans. Statistically, nothing will change if you change the rate to every 5 days.
  3. zenDzee

    Part of the problem with Sturgia getting rolled early:

    Do you know if there is a way to increase the relevance of one active war, to try to avoid kingdoms currently fighting one war to declare a new one? Thanks!
    Previously I thought that score of current wars is calculated in the function GetScoreOfWarInternal()
    C#:
                float num8 = 100f * Kingdom.All.Sum(delegate(Kingdom k)
                {
                    if (!k.IsAtWarWith(factionDeclaresWar) || !k.IsAtWarWith(factionDeclaredWar))
                    {
                        return 0f;
                    }
                    return Math.Min(k.TotalStrength, factionDeclaredWar.TotalStrength);
                });
                float num9 = topDogScore - num8 - warFatiqueScoreNew;

    However, after converting this piece of code into a human-readable format, I see that I was wrong.
    C#:
                float num8 = 100f * Kingdom.All.Sum(delegate(Kingdom k)
                {
                    if (k.IsAtWarWith(factionDeclaresWar) && k.IsAtWarWith(factionDeclaredWar))
                    {
                        return Math.Min(k.TotalStrength, factionDeclaredWar.TotalStrength);
                    }
                    return 0f;
                });
                float warsScore = topDogScore - num8 - warFatiqueScoreNew;
    num8 here is just a sum of the strength of the common enemies.

    Clans do not take current wars into account when they propose a new war or when they vote for war.

    I can make a mod that decreases the ScoreOfDeclaringWar if the faction is already at war. But later, now I'm busy with other things.
  4. zenDzee

    Part of the problem with Sturgia getting rolled early:

    BBTW, just checking in game and Derthert has Mercy trait, while Lucon (Northern Empire) and Garios (Western Empire) has Valor trait. It is maybe not the main reason because these factions are constantly going to war against everyone, but who knows.
    These are traits of the clan leaders who proposing or supporting the war.

    Concerning Sturgia, I think the main reason because this faction gets usually wrecked is because strenght calculation. Sturgia starts at war against Vlandia, which is always one of the strongest factions in early, mid, and late game. Vlandia starts with more clans and fiefs than anyone (well, just Aserai starts with one more fief).
    Agree.
  5. zenDzee

    Part of the problem with Sturgia getting rolled early:

    Lol, that sounds like a cue or something 🤔.

    I'll look into it and get back to you guys. Just from skimming it I can tell you that it's semi-random; there are a few elements of randomness, but the most important parts are very much not random, and definitely complex. I don't think I'll be able to properly explain it more than just the surface details because there is a lot that goes into it.

    Some code analysis here. Most of calculations done in GetScoreOfWarInternal() function. From that, we can tell which factors will increase score and which will decrease the score of war. If score > 50 then war will be declared.

    Factors that increase the score:
    • Clan leaders Valor trait;
    • Target faction aggressiveness;
    • Benefit Score for the attacker faction;
    • Top Dog score;
    • The negative relationship between rulers of the factions;
    • Add score if total strength of the attacker faction > total strength of the target faction;
    • Number of settlements in Target faction with the culture same as the attacker's culture;

    Factors that decrease the score:
    • Clan leaders Mercy trait;
    • Benefit Score for the target faction;
    • The positive relationship between rulers of the factions;
    • War fatigue score;
    • Decrease score if the attacker of the target faction is already in war;

    Also, there one very suspicious function - CalculateBenefitScore(), this function calculates if the faction can get some benefit of the war.
    C#:
            private float CalculateBenefitScore(ref DefaultDiplomacyModel.WarStats faction1Stats, ref DefaultDiplomacyModel.WarStats faction2Stats, bool calculatingRisk = false)
            {
                float num = MathF.Clamp(faction2Stats.ValueOfSettlements + 1f, DefaultDiplomacyModel._MinValue, DefaultDiplomacyModel._MaxValue);
                float num2 = (faction2Stats.Strength + 10f) / (faction1Stats.Strength + 10f);
                float num3 = (faction2Stats.Strength + 0.3f * faction1Stats.TotalStrengthOfEnemies + 10f) / (faction1Stats.Strength + 0.3f * faction2Stats.TotalStrengthOfEnemies + 10f);
                float num4 = MathF.Pow(num2 * num3, 0.4f);
                float num5 = MathF.Sqrt(faction1Stats.DistanceToClosestEnemyFief / faction2Stats.DistanceToClosestEnemyFief);
                num4 *= num5;
                if (!calculatingRisk)
                {
                    float x = Math.Min(1f, 2f * (faction1Stats.Strength + 10f) / (faction1Stats.Strength + faction1Stats.TotalStrengthOfEnemies + 10f));
                    num4 /= MathF.Pow(x, 0.5f);
                }
                float num6 = 1f / (1f + num4);
                num6 = MathF.Clamp(num6, 0.01f, 0.99f);
                float num7 = num * num6;
                float num8 = 150f / (150f + faction1Stats.DistanceToClosestEnemyFief);
                return num7 * num8;
            }
    It looks very obscured, however, we do not need to know what exactly it does, we only need to understand the general idea.

    Result of this function is:
    Target faction Settlements value * Strength Factor / Distance to Closest Enemy Fief;

    And the suspicious part of it is a Strength Factor that in the code "num6".

    Strength Factor ~ (Total strength of Attacker faction + Total strength of all enemies of Target faction) / (Total strength of Target faction + Total strength of all enemies of Attacker faction);

    The Strength Factor has a greater score when the Target faction is in war with multiple factions. And it's even greater if Target faction is weakened by war.

    This explains why everyone in Calradia gang banging weak factions.
  6. zenDzee

    Issues being granted a town

    Thanks so much!
    With this installed hopefully I may finally make proper use of the anarchy rebellion in Separatism.
    There also many other little mods that I haven't published yet.

    This mod allows AI parties to enter the castle as they flee from enemy parties.
    https://github.com/zenDzeeMods/zenDzeeMods_ZenFixes/releases
    File: zenDzeeMods_FleeIntoCastle.7z

    This feature was very annoying in Warband, but I do miss it in Bannerlord.
  7. zenDzee

    Issues being granted a town

    Greetings your mighty zenDzee.
    Could you please upload the code into a mod so plebs like me who know nothing about coding can have it too?
    Many Thanks! :oops:

    https://github.com/zenDzeeMods/zenDzeeMods_ZenFixes/releases/tag/v1.0.0
    Download file: zenDzeeMods_GenerousRuler.7z

    NOTE: this mod does more than just assigning the default owner of the captured castle. It also lets the AI kingdom ruler give away fiefs if his vassals have no fiefs.

    NOTE2: e1.4.3 already has a fix for this bug.
  8. zenDzee

    Issues being granted a town

    One thing I forgot to post earlier, but the Balancing Issues forum gets like, zero feedback at all. The higher level (Tech Support) Singleplayer forum does though.
    Could you please re-post it on a higher level forum so developers can see it?
  9. zenDzee

    Faction ruler takes all fiefs. Analysis and root cause.

    Game version: e1.4.1. Issue: Faction ruler takes all newly captured towns and castles. Reproducibility: Very often. Analysis: User @Bannerman Man analyzed this issue and found the root cause: https://forums.taleworlds.com/index.php?threads/issues-being-granted-a-town.427276/#post-9488060...
  10. zenDzee

    Issues being granted a town

    I tend to think that including the newly captured settlement in the calculation at all was just an oversight. Doesn't seem intended to me.
    Probably you are right. But I believe that the capturer should have more merit to own the settlement than the ruler, who is already able to overrule the decision.
  11. zenDzee

    Issues being granted a town

    There's a lot more that goes into being granted a fief than just distance. There is an equation that is used to determine who gets on the ballot based on "Merit." The merit scores of all clans in a faction are tallied up and the top 3 clans with the best merit scores get on the ballot. Here's that equation:

    Ballot-Merit-Equation.png

    Thanks for the detailed analysis. (y)

    Edit:
    Finally, because the fief up for grabs is given to the ruler's clan initially, it is used as 1 of the 2 closest fiefs in the Distance Factor; and because the distance is 0, the average distance just becomes half their next closest fief's distance.
    I just made a small mod that fixes this, by changing default owner to capturer
    C#:
            private void OnSettlementOwnerChanged(Settlement settlement, bool openToClaim, Hero newOwner, Hero oldOwner, Hero capturerHero, ChangeOwnerOfSettlementAction.ChangeOwnerOfSettlementDetail detail)
            {
                if (settlement.IsFortification
                    && newOwner != capturerHero
                    && detail == ChangeOwnerOfSettlementAction.ChangeOwnerOfSettlementDetail.BySiege)
                {
                    ChangeOwnerOfSettlementAction.ApplyBySiege(capturerHero, capturerHero, settlement);
                }
            }
    And it really works! Other lords began to vote for me.
  12. zenDzee

    Game children with negative experience - game over

    Edit: however I think the problem will be with the diplomacy reworked. Maybe it's in conflict with Community patch.
    diplomacy reworked does not work on 1.4.x versions
  13. zenDzee

    Game children with negative experience - game over

    Which seems to be not changing at all.
    Children have no initial attribute points, this is why their experience multiplier is zero. You can install my mod "Heritage", which will give children some attribute points so that they can get experience. When their attributes are set, you can remove the mod if you prefer to play without mods. Or you can install the "Character export/import" mod and fix the attributes manually.
Top Bottom