1.41 auto simulation

正在查看此主题的用户

It's overrode in CharacterObject, and that's the one is called in runtime. dnSpy shows you compile time stuff, not runtime. You can debug with dnSpy buy the way, and see it in runtime.
Okay, gotcha. Thanks for the help!
 
Also, where's the GetSimulationAttackPower function get called from that bigballz posted?


This is in Taleworlds.Campaign.CharacterObjects and it is used only in Tournaments.

This calculation is used only for skipping matches in tournaments.

Edit:
Look for this to see how autocalc works: ApplySimulationDamageToSelectedTroop
 
最后编辑:
This is in Taleworlds.Campaign.CharacterObjects and it is used only in Tournaments.

This calculation is used only for skipping matches in tournaments.

Edit:
Look for this to see how autocalc works: ApplySimulationDamageToSelectedTroop
Thanks!

Anyone know what the improvements mentioned in the patch notes are then? Are they to the calculation used for tournaments?
 
Thanks!

Anyone know what the improvements mentioned in the patch notes are then? Are they to the calculation used for tournaments?


I think they changed how the hit value in simulation is calculated. It's something like this now:

C#:
        public override int SimulateHit(CharacterObject strikerTroop, CharacterObject strikedTroop, PartyBase strikerParty, PartyBase strikedParty, float strikerAdvantage, MapEvent battle)
        {
            return (int)((0.5f + 0.5f * MBRandom.RandomFloat) * (40f * MathF.Pow(strikerTroop.GetPower() / strikedTroop.GetPower(), 0.7f) * strikerAdvantage));
        }

Before it was just Attacker PL (GetPower) * 50/Defender PL


Edit:

Everything else seems the same. Two parties are marked as attacker and defender, they fight in rounds by randomly choosing one troop from each side. Attacker troops gets damage calculated while defending troop gets health randomly decided and two values are compared.

Edit2:

And GetPower is calculated the same:

C#:
        // Token: 0x06000891 RID: 2193 RVA: 0x000286B4 File Offset: 0x000268B4
        public override float GetPower()
        {
            int num = this.IsHero ? (this.HeroObject.Level / 4 + 1) : this.Tier;
            return (float)((2 + num) * (10 + num)) * 0.02f * (this.IsHero ? 1.5f : (this.IsMounted ? 1.2f : 1f));

This code can be found in TaleWorlds.CampaignSystem. GetPower in TaleWorlds.Core is different.

Edit3:
I tested this and it basically gives higher chance to kill cav but that could be accomplished by reducing the cav flat buff so not sure why they decided on such solution.

Edit4:
To be more precise we now have more RNG system than before cause we're taking random unit to attack another random unit by comparing random DMG to random health. Previously at least DMG was stable xD
 
最后编辑:
Can you guys see from the code, the AI leaders strategy and tactics level? And would it have significance in sim battles?
For sieges I have seen the AI sometimes only make ladders and storm, other times the AI play out the siege engine ping pong game. Perhaps some leaders are better for sim battles?
Or do all leaders get a random AI like companions?
 
Can someone break down the code for us non-coders? How is equipment "power" or whatever we should be calling it calculated?
 
Before you all go into sideways let me note that the auto calculated battles only use the GetPower formula. The other one is for tournaments only.

C#:
public override float GetPower()
{
   int num = this.IsHero ? (this.HeroObject.Level / 4 + 1) : this.Tier;
   return (float)((2 + num) * (10 + num)) * 0.02f * (this.IsHero ? 1.5f : (this.IsMounted ? 1.2f : 1f));
}

I have played a bit with it, and made (through a personal mod) that in sieges the IsMounted part is not used - still Khuzait steamrolled the Northern Empire in a few years.

Ps.: What is not here, is that there is a another number called defender and attacker advantage that will be multiplied by this power number, which is used for perks, siege defense stats, walls etc.
not true and the whole formula is new in 1.41
 
Can you guys see from the code, the AI leaders strategy and tactics level? And would it have significance in sim battles?
For sieges I have seen the AI sometimes only make ladders and storm, other times the AI play out the siege engine ping pong game. Perhaps some leaders are better for sim battles?
Or do all leaders get a random AI like companions?
i ve not seen anything regrading tactics or perks or walls/sieges
 
Great, thanks!

So is the SimulateHit function the relevant bit?
Simulate-Hit.png


When I click GetPower (in dnSpy) it takes me to this function in TaleWorlds.Core.BasicCharacterObject:
GetPower.png


Which doesn't match the function you posted above. That function looks like it's in TaleWorld.CampaignSystem.CharacterObject class. Is dnSpy just taking me to the wrong function or something? Sorry, I'm not really savvy with how large software programs are structured haha, and not that familiar with C# either. Is a class unable to call a function outside of it's namespace?

Also, where's the GetSimulationAttackPower function get called from that bigballz posted?
are you on 1.41 or 1.4?
 
not true and the whole formula is new in 1.41

It doesn't matter if this formula is new or not. It's applied only for tournaments.
Only change in autocalc is how GetHit is calculated. And now it get attacker and defender bonuses and random multiplier.
 
后退
顶部 底部