User Tools

Site Tools


speedcalc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
speedcalc [2022/09/02 15:15] – created frethspeedcalc [2022/09/03 23:27] (current) freth
Line 1: Line 1:
-NOTE:  The reason that horses are inconsistent with speed is because they have to pass soul strength checks in order for traits to kick.+====== Speed Calculator ======
  
-/* 
  
-Original post text provided from author (https://forum.wurmonline.com/index.php?/topic/162331-horse-speed-calculator/)+ 
 +* This speed calculator does not factor in Ebony (+2.5%) and Silver/black bonuses (?).  You will have to add those percentages yourself. 
 + 
 + 
 +* Based on the creature's soul strength the traits will flip on and off at random, so in-game you can expect the actual speed to fluctuate anywhere between the min and max values. 
 + 
 +* The author (below) thinks unicorns are immune to soul strength checks, but he's not definite. 
 + 
 +---- 
 + 
 +Credit: [[https://forum.wurmonline.com/index.php?/topic/162331-horse-speed-calculator/)|Wulvarik]], April 11, 2018
  
 I butchered together some decompiled WU code into a horse speed calculator to see how much of an effect the various factors (traits, weight, gear QL) can have. I butchered together some decompiled WU code into a horse speed calculator to see how much of an effect the various factors (traits, weight, gear QL) can have.
Line 30: Line 39:
  
 <code> <code>
-*/ 
- 
-*(code from above pastebin link)* 
- 
 public class MyClass { public class MyClass {
- +    public static void main(String args[]) { 
- public static void main(String args[])  +  
- { +        boolean horse = true; 
- boolean horse = true; +        boolean hellHorse = false; 
- boolean hellHorse = false; +        boolean unicorn = false; 
- boolean unicorn = false; +        // Unicorns are exempt from SoulStrength checks on traits, not modeled here. 
- +  
- // Unicorns are exempt from SoulStrength checks on traits, not modeled here. +        boolean isRidden = true; 
- boolean isRidden = true; +        boolean isSecondRider = false; 
- boolean isSecondRider = false; +        boolean isSaddled = false; 
- boolean isSaddled = false; +        boolean isShoed = false; 
- boolean isShoed = false; +  
- float saddleQL = 70.0F; +        float saddleQL = 70.0F; 
- byte saddleRarity = 0; //0 normal, 1 rare, 2 supreme, 3 fantastic +        byte saddleRarity = 0;    //0 normal, 1 rare, 2 supreme, 3 fantastic 
- float saddleWoA = 0.0F; +        float saddleWoA = 0.0F; 
- float horseShoe1QL = 70.0F; +  
- byte horseShoe1Rarity = 0; +        float horseShoe1QL = 70.0F; 
- float horseShoe1WoA = 0.0F; +        byte horseShoe1Rarity = 0; 
- float horseShoe2QL = 70.0F; +        float horseShoe1WoA = 0.0F; 
- byte horseShoe2Rarity = 0; +  
- float horseShoe2WoA = 0.0F; +        float horseShoe2QL = 70.0F; 
- float horseShoe3QL = 70.0F; +        byte horseShoe2Rarity = 0; 
- byte horseShoe3Rarity = 0; +        float horseShoe2WoA = 0.0F; 
- float horseShoe3WoA = 0.0F; +  
- float horseShoe4QL = 70.0F; +        float horseShoe3QL = 70.0F; 
- byte horseShoe4Rarity = 0; +        byte horseShoe3Rarity = 0; 
- float horseShoe4WoA = 0.0F; +        float horseShoe3WoA = 0.0F; 
- boolean trait1 = false; //It has fleeter movement than normal +  
- boolean trait3 = false; //It has a strong body +        float horseShoe4QL = 70.0F; 
- boolean trait4 = false; //It has lightning movement +        byte horseShoe4Rarity = 0; 
- boolean trait5 = false; //It can carry more than average +        float horseShoe4WoA = 0.0F; 
- boolean trait6 = false; //It has very strong leg muscles +  
- boolean trait8 = false; //It has malformed hindlegs +  
- boolean trait9 = false; //The legs are of different length +        boolean trait1 = false;      //It has fleeter movement than normal 
- boolean trait11 = false; //It looks very unmotivated +        boolean trait3 = false;      //It has a strong body 
- boolean trait23 = false; //Color is ebony black +        boolean trait4 = false;      //It has lightning movement 
- float mountCarriedWeight = 6500; // Assumes four 500 gram shoes and one 4500 saddle +        boolean trait5 = false;      //It can carry more than average 
- float riderOneFatLevel = 125; // 0 - 125, Only matters if under 30 +        boolean trait6 = false;      //It has very strong leg muscles 
- float riderOneCarriedWeight = 50000; // Weight in grams +        boolean trait8 = false;     //It has malformed hindlegs 
- float riderTwoFatLevel = 0; +        boolean trait9 = false;     //The legs are of different length 
- float riderTwoCarriedWeight = 0; +        boolean trait11 = false;    //It looks very unmotivated 
- int hungerPercent = 0; +        boolean trait23 = false;    //Color is ebony black 
- int damagePercent = 0; +  
- +  
- //The below are calculated values, do not change +        float mountCarriedWeight = 6500;    // Assumes four 500 gram shoes and one 4500 saddle 
- float mountStrength = 0; +        float riderOneFatLevel = 125;       // 0 - 125, Only matters if under 30 
- float mountMaxSpeed = 0; +        float riderOneCarriedWeight = 50000;    // Weight in grams 
- boolean isHorse = false; +        float riderTwoFatLevel = 0; 
- boolean isUnicorn = false; +        float riderTwoCarriedWeight = 0; 
- float shoeBonus = 0; +  
- float saddleBonus = 0; +        int hungerPercent = 0; 
- +        int damagePercent = 0; 
- if (horse) +  
- +  
-   mountStrength = 25; +  
-   mountMaxSpeed = 30; +  
-   isHorse = true; +  
-   isUnicorn = false; +        //The below are calculated values, do not change 
- +        float mountStrength = 0; 
- +        float mountMaxSpeed = 0; 
- if (hellHorse) +        boolean isHorse = false; 
- +        boolean isUnicorn = false; 
-   mountStrength = 35; +        float shoeBonus = 0; 
-   mountMaxSpeed = 32; +        float saddleBonus = 0; 
-   isHorse = true; +  
-   isUnicorn = false; +        if (horse) 
- +        
- +            mountStrength = 25; 
- if (unicorn) +            mountMaxSpeed = 30; 
- +            isHorse = true; 
-   mountStrength = 30; +            isUnicorn = false; 
-   mountMaxSpeed = 33; +        
-   isHorse = false; +        if (hellHorse) 
-   isUnicorn = true; +        
- +            mountStrength = 35; 
- +            mountMaxSpeed = 32; 
- int hunger = hungerPercent * 65535 / 100; +            isHorse = true; 
- int damage = damagePercent * 65535 / 100; +            isUnicorn = false; 
- float factor = 0.5F; +        
- +        if (unicorn) 
- if (hunger < 45000)  +        
- +            mountStrength = 30; 
-   factor += 0.2F; +            mountMaxSpeed = 33; 
- +            isHorse = false; 
- +            isUnicorn = true; 
- if (hunger < 10000)  +        
- +  
-   factor += 0.1F; +        int hunger = hungerPercent * 65535 / 100; 
- +        int damage = damagePercent * 65535 / 100; 
- +  
- if (damage < 10000)  +        float factor = 0.5F; 
- +        if (hunger < 45000) { 
-   factor += 0.1F; +          factor += 0.2F; 
- } else if (damage > 20000)  +        
- +        if (hunger < 10000) { 
-   factor -= 0.5F; +          factor += 0.1F; 
- } else if (damage > 45000)  +        
- +        if (damage < 10000) { 
-   factor -= 0.7F; +          factor += 0.1F; 
- +        } else if (damage > 20000) { 
- +          factor -= 0.5F; 
- if ((isHorse) || (isUnicorn)) +        } else if (damage > 45000) { 
- +          factor -= 0.7F; 
-   if (isShoed) +        
-   +        if ((isHorse) || (isUnicorn)) 
- shoeBonus += Math.max(10.0F, horseShoe1QL) / 2000.0F; +        
- shoeBonus += horseShoe1WoA / 2000.0F; +            if (isShoed) 
- shoeBonus += horseShoe1Rarity * 0.03F; +            
- shoeBonus += Math.max(10.0F, horseShoe2QL) / 2000.0F; +              shoeBonus += Math.max(10.0F, horseShoe1QL) / 2000.0F; 
- shoeBonus += horseShoe2WoA / 2000.0F; +              shoeBonus += horseShoe1WoA / 2000.0F; 
- shoeBonus += horseShoe2Rarity * 0.03F; +              shoeBonus += horseShoe1Rarity * 0.03F; 
- shoeBonus += Math.max(10.0F, horseShoe3QL) / 2000.0F; +  
- shoeBonus += horseShoe3WoA / 2000.0F; +              shoeBonus += Math.max(10.0F, horseShoe2QL) / 2000.0F; 
- shoeBonus += horseShoe3Rarity * 0.03F; +              shoeBonus += horseShoe2WoA / 2000.0F; 
- shoeBonus += Math.max(10.0F, horseShoe4QL) / 2000.0F; +              shoeBonus += horseShoe2Rarity * 0.03F; 
- shoeBonus += horseShoe4WoA / 2000.0F; +  
- shoeBonus += horseShoe4Rarity * 0.03F; +              shoeBonus += Math.max(10.0F, horseShoe3QL) / 2000.0F; 
- factor += shoeBonus; +              shoeBonus += horseShoe3WoA / 2000.0F; 
-   +              shoeBonus += horseShoe3Rarity * 0.03F; 
- +  
- +              shoeBonus += Math.max(10.0F, horseShoe4QL) / 2000.0F; 
- float postperc = 0; +              shoeBonus += horseShoe4WoA / 2000.0F; 
- float negtperc = 0; +              shoeBonus += horseShoe4Rarity * 0.03F; 
- float tperc = 0; +              factor += shoeBonus; 
- float poswmod = 0; +            
- float negwmod = 0; +        
- float wmod = 0; +  
- float weightPenalty = 0; +        float postperc = 0; 
- +        float negtperc = 0; 
- if (trait1) { postperc += 0.1; } +        float tperc = 0; 
- if (trait3) { poswmod += 10000; } +        float poswmod = 0; 
- if (trait4) { postperc += 0.2; } +        float negwmod = 0; 
- if (trait5) { poswmod += 20000; } +        float wmod = 0; 
- if (trait6) { postperc += 0.1; } +        float weightPenalty = 0; 
- if (trait6) { poswmod += 10000; } +  
- if (trait8) { negtperc -= 0.1; } +  
- if (trait9) { negtperc -= 0.3; } +        if (trait1) { postperc += 0.1; } 
- if (trait11) {negwmod -= 30000; } +        if (trait3) { poswmod += 10000; } 
- if (trait23) {postperc += 0.025; } +        if (trait4) { postperc += 0.2; } 
-  +        if (trait5) { poswmod += 20000; } 
- if (isRidden) +        if (trait6) { postperc += 0.1; } 
- +        if (trait6) { poswmod += 10000; } 
-   if (isSaddled) +        if (trait8) { negtperc -= 0.1; } 
-   +        if (trait9) { negtperc -= 0.3; } 
- saddleBonus += Math.max(10.0F, saddleQL) / 1000.0F; +        if (trait11) {negwmod -= 30000; } 
- saddleBonus += saddleRarity * 0.03F; +        if (trait23) {postperc += 0.025; } 
- saddleBonus += saddleWoA / 2000.0F; +  
-   +  
- +        if (isRidden) 
-   factor += saddleBonus; +        
-   mountCarriedWeight += Math.max(30000, riderOneFatLevel * 1000); +            if (isSaddled) 
-   mountCarriedWeight += riderOneCarriedWeight; +            
- +              saddleBonus += Math.max(10.0F, saddleQL) / 1000.0F; 
-   if (isUnicorn) +              saddleBonus += saddleRarity * 0.03F; 
-   +              saddleBonus += saddleWoA / 2000.0F; 
- if (isSecondRider) +            
- +            factor += saddleBonus; 
-   mountCarriedWeight += Math.max(30000, riderTwoFatLevel * 1000); +  
-   mountCarriedWeight += riderTwoCarriedWeight; +            mountCarriedWeight += Math.max(30000, riderOneFatLevel * 1000); 
- +            mountCarriedWeight += riderOneCarriedWeight; 
-   +  
- +  
- +            if (isUnicorn) 
- float allFactor = 0; +            
- float minFactor = 0; +                if (isSecondRider) 
- float maxFactor = 0; +                
- float allWeightPenalty = 0; +                    mountCarriedWeight += Math.max(30000, riderTwoFatLevel * 1000); 
- float minWeightPenalty = 0; +                    mountCarriedWeight += riderTwoCarriedWeight; 
- float maxWeightPenalty = 0; +                
- +            
- //factor += tperc; +        
- allFactor = factor + negtperc + postperc; +  
- minFactor = factor + negtperc; +        float allFactor = 0; 
- maxFactor = factor + postperc; +        float minFactor = 0; 
- +        float maxFactor = 0; 
- if (mountCarriedWeight > (mountStrength * 5000 + poswmod + negwmod)) +  
- +        float allWeightPenalty = 0; 
-   allWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod - negwmod) / 50000.0D); +        float minWeightPenalty = 0; 
- +        float maxWeightPenalty = 0; 
- +  
- allFactor -= allWeightPenalty; +  
- +        //factor += tperc; 
- if (mountCarriedWeight > (mountStrength * 5000 + negwmod)) +        allFactor = factor + negtperc + postperc; 
- +        minFactor = factor + negtperc; 
-   minWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - negwmod) / 50000.0D); +        maxFactor = factor + postperc; 
- +  
- +  
- minFactor -= minWeightPenalty; +  
- +        if (mountCarriedWeight > (mountStrength * 5000 + poswmod + negwmod)) 
- if (mountCarriedWeight > (mountStrength * 5000 + poswmod)) +        
- +            allWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod - negwmod) / 50000.0D); 
-   maxWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod) / 50000.0D); +        
- +        allFactor -= allWeightPenalty;  
- +  
- maxFactor -= maxWeightPenalty; +        if (mountCarriedWeight > (mountStrength * 5000 + negwmod)) 
- +        
- int allSpeed = (int)Math.max(0.0D, Math.min(127.0D, allFactor * mountMaxSpeed)); +            minWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - negwmod) / 50000.0D); 
- int minSpeed = (int)Math.max(0.0D, Math.min(127.0D, minFactor * mountMaxSpeed)); +        
- int maxSpeed = (int)Math.max(0.0D, Math.min(127.0D, maxFactor * mountMaxSpeed)); +        minFactor -= minWeightPenalty;        
- +  
- System.out.println(If the mount is classified as a horse, all traits (even negative ones) must pass); +        if (mountCarriedWeight > (mountStrength * 5000 + poswmod)) 
- System.out.println(intermittent Soul Strength checks to stay active.); +        
- System.out.println(""); +            maxWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod) / 50000.0D); 
- System.out.println(""); +        
- System.out.println("shoeBonus = " + shoeBonus); +        maxFactor -= maxWeightPenalty; 
- System.out.println("saddleBonus = " + saddleBonus); +  
- System.out.println(""); +        int allSpeed = (int)Math.max(0.0D, Math.min(127.0D, allFactor * mountMaxSpeed)); 
- System.out.println("All traits active weight penalty = " + allWeightPenalty); +        int minSpeed = (int)Math.max(0.0D, Math.min(127.0D, minFactor * mountMaxSpeed)); 
- System.out.println("Worst traits active weight penalty = " + minWeightPenalty); +        int maxSpeed = (int)Math.max(0.0D, Math.min(127.0D, maxFactor * mountMaxSpeed)); 
- System.out.println("Best traits active weight penalty = " + maxWeightPenalty); +  
- System.out.println(""); +        System.out.println("If the mount is classified as a horse, all traits (even negative ones) must pass"); 
- System.out.println("All traits active speed = " + allSpeed); +        System.out.println("intermittent Soul Strength checks to stay active."); 
- System.out.println("Worst traits active speed = " + minSpeed); +        System.out.println(""); 
- System.out.println("Best traits active speed = " + maxSpeed); +        System.out.println(""); 
-  }+        System.out.println("shoeBonus = " + shoeBonus); 
 +        System.out.println("saddleBonus = " + saddleBonus); 
 +        System.out.println(""); 
 +        System.out.println("All traits active weight penalty = " + allWeightPenalty); 
 +        System.out.println("Worst traits active weight penalty = " + minWeightPenalty); 
 +        System.out.println("Best traits active weight penalty = " + maxWeightPenalty); 
 +        System.out.println(""); 
 +        System.out.println("All traits active speed = " + allSpeed); 
 +        System.out.println("Worst traits active speed = " + minSpeed); 
 +        System.out.println("Best traits active speed = " + maxSpeed); 
 +    }
 } }
 </code> </code>
speedcalc.1662149736.txt.gz · Last modified: by freth

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki