Modding Horses

Users who are viewing this thread

Lord Earl

Karen
Regular
I'm doing some work modding the horses for SP, making them more like real horses: Fast, agile, powerful, tough but not invincible, great acceleration and deceleration.

The thing is, I'm not sure how their stats are calculated. All I have access to at the present is the singleplayer items. I was wondering if some people were familiar with these formulas, or where I could find them.


This thread could also be used for general research and discussion about modding horses.
 
Solution
Hello!
Currently we can't use the modding tools, but we have dnspy for example :smile:
(https://github.com/0xd4d/dnSpy)


Search in these dlls: TaleWorlds.Core, TaleWorlds.MountAndBlade, TaleWorlds.CampaignSystem

Calculating horse acceleration in TaleWorlds.Core:
Code:
namespace TaleWorlds.Core
{
    // Token: 0x02000032 RID: 50
    public class DefaultRidingModel : RidingModel
    {
        // Token: 0x06000328 RID: 808 RVA: 0x0000B3F4 File Offset: 0x000095F4
        public override float CalculateAcceleration(ItemObject horseItem, BasicCharacterObject rider)
        {
            float num = (float)horseItem.HorseComponent.Maneuver * 0.008f;
            if (rider != null)
            {
                num *= 0.7f + 0.003f *...
Hello!
Currently we can't use the modding tools, but we have dnspy for example :smile:
(https://github.com/0xd4d/dnSpy)


Search in these dlls: TaleWorlds.Core, TaleWorlds.MountAndBlade, TaleWorlds.CampaignSystem

Calculating horse acceleration in TaleWorlds.Core:
Code:
namespace TaleWorlds.Core
{
    // Token: 0x02000032 RID: 50
    public class DefaultRidingModel : RidingModel
    {
        // Token: 0x06000328 RID: 808 RVA: 0x0000B3F4 File Offset: 0x000095F4
        public override float CalculateAcceleration(ItemObject horseItem, BasicCharacterObject rider)
        {
            float num = (float)horseItem.HorseComponent.Maneuver * 0.008f;
            if (rider != null)
            {
                num *= 0.7f + 0.003f * ((float)rider.GetSkillValue(DefaultSkills.Riding) - 1.5f * (float)horseItem.Difficulty);
            }
            return MathF.Clamp(num, 0.15f, 0.7f);
        }
    }
}

in TaleWorlds.Core dll you will find HorseComponent class.
 
Upvote 0
Solution
Thanks so much! I'll having to investigate those core files closely to see what I can do to fix them up.

It took a second read to get the formula. Calculating it... With 300 riding, the formula in the if statement would come to 1.195, with a 90 difficulty mount. The Tyall and the Battanian Thoroughbred have 76 maneuver, giving us 0.608 multiplied by 1.195 for a total of 0.72656. But the number clamp restricts us to 0.7 at most, so that extra doesn't matter.

To compare, with a 0 difficulty Sumpter Horse with 41 maneuver, your result should be 0.5248. I wasn't expecting that, I figured a difficulty of 0 and a high riding skill would make a bigger difference.


That said, I'm still not sure what this convoluted mess is for. I'm kind of surprised weight isn't a factor. Based off my edit, I should've gotten to the maximum of 0.7. And if it works for deceleration as well, then it is still not high enough.


Thanks against for the help. This is a really motivating find. I'll discuss with some friends of mine, to try and get reasonable estimates for the horses.
 
Upvote 0
Back
Top Bottom