View difference between Paste ID: hRqDDZ4q and 5DAbyiwy
SHOW: | | - or go back to the newest paste.
1
NOTE:  This came from a WO forum post (https://forum.wurmonline.com/index.php?/topic/162331-horse-speed-calculator/).  It's not mine.
2
3
---
4
5
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.
6
7
To use it, go to the link below:
8
https://pastebin.com/5DAbyiwy
9
10
Copy the code presented there, then go to this link:
11
https://www.jdoodle.com/online-java-compiler
12
13
Erase anything in the box, and paste the code you copied.
14
15
Click Execute at the bottom to make sure it gives some output.  That'll be for an untraited, ungeared horse, being ridden by somebody carrying 50 Kg of gear.  Even if it's not being factored in for the speed boost, the horse's weight value still has saddle/shoes added in since I assumed that would be the most likely thing tested.  Set mountCarriedWeight to 0 for a true reading of an ungeared horse.
16
17
(My comments say that unicorns are exempt from soul strength checks, but don't take that as a hard truth.)
18
19
Set the values in the first little bit to whatever you'd like to see, then Execute.  Make sure to set isSaddled, isShoed to true to see those values have an effect. 
20
21
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.
22
23
Feedback and reports of any inaccuracies are appreciated.
24
25
Disclaimer:  This comes from WU code, who the hell knows what WO code really says, but they're usually pretty similar. 
26
27
---
28
29
public class MyClass {
30
    public static void main(String args[]) {
31
 
32
        boolean horse = true;
33
        boolean hellHorse = false;
34
        boolean unicorn = false;
35
        // Unicorns are exempt from SoulStrength checks on traits, not modeled here.
36
   
37
        boolean isRidden = true;
38
        boolean isSecondRider = false;
39
        boolean isSaddled = false;
40
        boolean isShoed = false;
41
       
42
        float saddleQL = 70.0F;
43
        byte saddleRarity = 0;    //0 normal, 1 rare, 2 supreme, 3 fantastic
44
        float saddleWoA = 0.0F;
45
       
46
        float horseShoe1QL = 70.0F;
47
        byte horseShoe1Rarity = 0;
48
        float horseShoe1WoA = 0.0F;
49
       
50
        float horseShoe2QL = 70.0F;
51
        byte horseShoe2Rarity = 0;
52
        float horseShoe2WoA = 0.0F;
53
       
54
        float horseShoe3QL = 70.0F;
55
        byte horseShoe3Rarity = 0;
56
        float horseShoe3WoA = 0.0F;
57
       
58
        float horseShoe4QL = 70.0F;
59
        byte horseShoe4Rarity = 0;
60
        float horseShoe4WoA = 0.0F;
61
       
62
       
63
        boolean trait1 = false;      //It has fleeter movement than normal
64
        boolean trait3 = false;      //It has a strong body
65
        boolean trait4 = false;      //It has lightning movement
66
        boolean trait5 = false;      //It can carry more than average
67
        boolean trait6 = false;      //It has very strong leg muscles
68
        boolean trait8 = false;     //It has malformed hindlegs
69
        boolean trait9 = false;     //The legs are of different length
70
        boolean trait11 = false;    //It looks very unmotivated
71
        boolean trait23 = false;    //Color is ebony black
72
   
73
 
74
        float mountCarriedWeight = 6500;    // Assumes four 500 gram shoes and one 4500 saddle
75
        float riderOneFatLevel = 125;       // 0 - 125, Only matters if under 30
76
        float riderOneCarriedWeight = 50000;    // Weight in grams
77
        float riderTwoFatLevel = 0;
78
        float riderTwoCarriedWeight = 0;
79
       
80
        int hungerPercent = 0;
81
        int damagePercent = 0;
82
       
83
       
84
       
85
       
86
       
87
        //The below are calculated values, do not change
88
        float mountStrength = 0;
89
        float mountMaxSpeed = 0;
90
        boolean isHorse = false;
91
        boolean isUnicorn = false;
92
        float shoeBonus = 0;
93
        float saddleBonus = 0;
94
       
95
        if (horse)
96
        {
97
            mountStrength = 25;
98
            mountMaxSpeed = 30;
99
            isHorse = true;
100
            isUnicorn = false;
101
        }
102
        if (hellHorse)
103
        {
104
            mountStrength = 35;
105
            mountMaxSpeed = 32;
106
            isHorse = true;
107
            isUnicorn = false;
108
        }
109
        if (unicorn)
110
        {
111
            mountStrength = 30;
112
            mountMaxSpeed = 33;
113
            isHorse = false;
114
            isUnicorn = true;
115
        }
116
       
117
        int hunger = hungerPercent * 65535 / 100;
118
        int damage = damagePercent * 65535 / 100;
119
   
120
        float factor = 0.5F;
121
        if (hunger < 45000) {
122
          factor += 0.2F;
123
        }
124
        if (hunger < 10000) {
125
          factor += 0.1F;
126
        }
127
        if (damage < 10000) {
128
          factor += 0.1F;
129
        } else if (damage > 20000) {
130
          factor -= 0.5F;
131
        } else if (damage > 45000) {
132
          factor -= 0.7F;
133
        }
134
        if ((isHorse) || (isUnicorn))
135
        {
136
            if (isShoed)
137
            {
138
              shoeBonus += Math.max(10.0F, horseShoe1QL) / 2000.0F;
139
              shoeBonus += horseShoe1WoA / 2000.0F;
140
              shoeBonus += horseShoe1Rarity * 0.03F;
141
             
142
              shoeBonus += Math.max(10.0F, horseShoe2QL) / 2000.0F;
143
              shoeBonus += horseShoe2WoA / 2000.0F;
144
              shoeBonus += horseShoe2Rarity * 0.03F;
145
             
146
              shoeBonus += Math.max(10.0F, horseShoe3QL) / 2000.0F;
147
              shoeBonus += horseShoe3WoA / 2000.0F;
148
              shoeBonus += horseShoe3Rarity * 0.03F;
149
             
150
              shoeBonus += Math.max(10.0F, horseShoe4QL) / 2000.0F;
151
              shoeBonus += horseShoe4WoA / 2000.0F;
152
              shoeBonus += horseShoe4Rarity * 0.03F;
153
              factor += shoeBonus;
154
            }
155
        }
156
       
157
        float postperc = 0;
158
        float negtperc = 0;
159
        float tperc = 0;
160
        float poswmod = 0;
161
        float negwmod = 0;
162
        float wmod = 0;
163
        float weightPenalty = 0;
164
165
166
        if (trait1) { postperc += 0.1; }
167
        if (trait3) { poswmod += 10000; }
168
        if (trait4) { postperc += 0.2; }
169
        if (trait5) { poswmod += 20000; }
170
        if (trait6) { postperc += 0.1; }
171
        if (trait6) { poswmod += 10000; }
172
        if (trait8) { negtperc -= 0.1; }
173
        if (trait9) { negtperc -= 0.3; }
174
        if (trait11) {negwmod -= 30000; }
175
        if (trait23) {postperc += 0.025; }
176
           
177
 
178
        if (isRidden)
179
        {
180
            if (isSaddled)
181
            {
182
              saddleBonus += Math.max(10.0F, saddleQL) / 1000.0F;
183
              saddleBonus += saddleRarity * 0.03F;
184
              saddleBonus += saddleWoA / 2000.0F;
185
            }
186
            factor += saddleBonus;
187
           
188
            mountCarriedWeight += Math.max(30000, riderOneFatLevel * 1000);
189
            mountCarriedWeight += riderOneCarriedWeight;
190
           
191
           
192
            if (isUnicorn)
193
            {
194
                if (isSecondRider)
195
                {
196
                    mountCarriedWeight += Math.max(30000, riderTwoFatLevel * 1000);
197
                    mountCarriedWeight += riderTwoCarriedWeight;
198
                }
199
            }
200
        }
201
       
202
        float allFactor = 0;
203
        float minFactor = 0;
204
        float maxFactor = 0;
205
        
206
        float allWeightPenalty = 0;
207
        float minWeightPenalty = 0;
208
        float maxWeightPenalty = 0;
209
        
210
       
211
        //factor += tperc;
212
        allFactor = factor + negtperc + postperc;
213
        minFactor = factor + negtperc;
214
        maxFactor = factor + postperc;
215
        
216
       
217
       
218
        if (mountCarriedWeight > (mountStrength * 5000 + poswmod + negwmod))
219
        {
220
            allWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod - negwmod) / 50000.0D);
221
        }
222
        allFactor -= allWeightPenalty; 
223
        
224
        if (mountCarriedWeight > (mountStrength * 5000 + negwmod))
225
        {
226
            minWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - negwmod) / 50000.0D);
227
        }
228
        minFactor -= minWeightPenalty;       
229
       
230
        if (mountCarriedWeight > (mountStrength * 5000 + poswmod))
231
        {
232
            maxWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod) / 50000.0D);
233
        }
234
        maxFactor -= maxWeightPenalty;
235
       
236
        int allSpeed = (int)Math.max(0.0D, Math.min(127.0D, allFactor * mountMaxSpeed));
237
        int minSpeed = (int)Math.max(0.0D, Math.min(127.0D, minFactor * mountMaxSpeed));
238
        int maxSpeed = (int)Math.max(0.0D, Math.min(127.0D, maxFactor * mountMaxSpeed));
239
        
240
        System.out.println("If the mount is classified as a horse, all traits (even negative ones) must pass");
241
        System.out.println("intermittent Soul Strength checks to stay active.");
242
        System.out.println("");
243
        System.out.println("");
244
        System.out.println("shoeBonus = " + shoeBonus);
245
        System.out.println("saddleBonus = " + saddleBonus);
246
        System.out.println("");
247
        System.out.println("All traits active weight penalty = " + allWeightPenalty);
248
        System.out.println("Worst traits active weight penalty = " + minWeightPenalty);
249
        System.out.println("Best traits active weight penalty = " + maxWeightPenalty);
250
        System.out.println("");
251
        System.out.println("All traits active speed = " + allSpeed);
252
        System.out.println("Worst traits active speed = " + minSpeed);
253
        System.out.println("Best traits active speed = " + maxSpeed);
254
    }
255
}