Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Community Event Let's Find How Spell Cost Is Calculated, 8le!

Discussion in 'Wynncraft' started by dukioooo, Dec 17, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    https://forums.wynncraft.com/threads/help-us-solve-how-spell-cost-functions.259078/
    ^
    This thread by @Xavi should help you figure out how spell cost is calculated.

    Reward: 8le to the first player who writes in this thread the correct formula

    The formula must:
    - Work with any spell base mana value for every class
    - Work with any spell cost % id
    - Work with any spell cost raw id
    - Work with any intelligence skill point value

    Example formula (that doesn't work):
    Code:
    roundDown( round( (spellBaseMana * intPct / 100) + idSpellCostRaw ) * (1 + idSpellCostPct / 100) )
    roundDown = round the value down
    roundUp = round the value up
    round = round the value normally (1.49 -> 1, 1.5 -> 2)
    spellBaseMana = spell base mana value
    intPct = intelligence skill point value converted to percentage, example 150 intel = 80.8%
    idSpellCostRaw = raw value of spellCost (new id)
    idSpellCostPct = % value of spellCost (new id)

    Example test:
    Build (blue mask + vaward + spring)
    140 Intel
    -1 3rd spell cost
    +1 4th spell cost
    no spellCost % values

    Arrow Storm should cost 2
    Escape should cost 1
    Bomb should cost 1
    Arrow Shield should cost 3
     
    Asther, xSkiing, Jacquie and 5 others like this.
  2. SnapDoomy

    SnapDoomy Well-Known Adventurer HERO

    Messages:
    350
    Likes Received:
    410
    Trophy Points:
    85
    Minecraft:
    major couldnt figure it out and he is the most smartest smarty in the world so goo luck guys i love u major also hi @Mergual
     
    dukioooo likes this.
  3. Asthae

    Asthae ... HERO

    Messages:
    2,152
    Likes Received:
    1,831
    Trophy Points:
    175
    Guild:
    Minecraft:
    Wait what.


    Who coded this?
     
  4. Mac N Cheese Man

    Mac N Cheese Man First Official Member Of The Mac N Cheese Club

    Messages:
    1,628
    Likes Received:
    2,870
    Trophy Points:
    164
    Ok, but first we need to talk about parallel universes.
     
  5. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
  6. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    What do you mean? I want the math formula
     
  7. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    What does 140 int translate into for mana reduction
    ________________________________
    Figured out your mistake, you need to subtract int spell ccost reduction by 1, because then you are multiplying by the reduction, not the full reduction


    Formula truncate(round((spellCost * (1-intMod)) + rawSpellCost) * (1+spellCostPercent));
     
  8. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    0': 0
    1': 1
    2': 2
    3': 2.9
    4': 3.9
    5': 4.9
    6': 5.8
    7': 6.7
    8': 7.7
    9': 8.6
    10' = 9.5
    11' = 10.4
    12' = 11.3
    13' = 12.2
    14' = 13.1
    15' = 13.9
    16' = 14.8
    17' = 15.7
    18' = 16.5
    19' = 17.3
    20' = 18.2
    21' = 19
    22' = 19.8
    23' = 20.6
    24' = 21.4
    25' = 22.2
    26' = 23
    27' = 23.8
    28' = 24.6
    29' = 25.3
    30' = 26.1
    31' = 26.8
    32' = 27.6
    33' = 28.3
    34' = 29
    35' = 29.8
    36' = 30.5
    37' = 31.2
    38' = 31.9
    39' = 32.6
    40' = 33.3
    41' = 34
    42' = 34.6
    43' = 35.3
    44' = 36
    45' = 36.6
    46' = 37.3
    47' = 37.9
    48' = 38.6
    49' = 39.2
    50' = 39.9
    51' = 40.5
    52' = 41.1
    53' = 41.7
    54' = 42.3
    55' = 42.9
    56' = 43.5
    57' = 44.1
    58' = 44.7
    59' = 45.3
    60' = 45.8
    61' = 46.4
    62' = 47
    63' = 47.5
    64' = 48.1
    65' = 48.6
    66' = 49.2
    67' = 49.7
    68' = 50.3
    69' = 50.8
    70' = 51.3
    71' = 51.8
    72' = 52.3
    73' = 52.8
    74' = 53.4
    75' = 53.9
    76' = 54.3
    77' = 54.8
    78' = 55.3
    79' = 55.8
    80' = 56.3
    81' = 56.8
    82' = 57.2
    83' = 57.7
    84' = 58.1
    85' = 58.6
    86' = 59.1
    87' = 59.5
    88' = 59.9
    89' = 60.4
    90' = 60.8
    91' = 61.3
    92' = 61.7
    93' = 62.1
    94' = 62.5
    95' = 62.9
    96' = 63.3
    97' = 63.8
    98' = 64.2
    99' = 64.6
    100 = 65
    101 = 65.4
    102 = 65.7
    103 = 66.1
    104 = 66.5
    105 = 66.9
    106 = 67.3
    107 = 67.6
    108 = 68
    109 = 68.4
    110 = 68.7
    111 = 69.1
    112 = 69.4
    113 = 69.8
    114 = 70.1
    115 = 70.5
    116 = 70.8
    117 = 71.2
    118 = 71.5
    119 = 71.8
    120 = 72.2
    121 = 72.5
    122 = 72.8
    123 = 73.1
    124 = 73.5
    125 = 73.8
    126 = 74.1
    127 = 74.4
    128 = 74.7
    129 = 75
    130 = 75.3
    131 = 75.6
    132 = 75.9
    133 = 76.2
    134 = 76.5
    135 = 76.8
    136 = 77.1
    137 = 77.3
    138 = 77.6
    139 = 77.9
    140 = 78.2
    141 = 78.4
    142 = 78.7
    143 = 79
    144 = 79.2
    145 = 79.5
    146 = 79.8
    147 = 80
    148 = 80.3
    149 = 80.5
    150 = 80.8
     
  9. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    THank you! I should have posted the right equation
     
  10. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    I'll test in a bit, builder is having issue and idk what happened .-.
     
  11. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    just a bit of clarification, intMod and spellCostPercent are both the %'s divided by 100
     
  12. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    so floor(round(($spellBaseMana * (1-$intPct / 100)) + $idSpellCostRaw / 100) * (1+$idSpellCostPct / 100)) ?

    this is with variables but you should be able to understand, floor is round down

    With this it doesn't work:
    upload_2019-12-17_23-3-51.png
    Values should be (in order: 2 1 1 3)

    The formula with numbers applied (arrow storm)
    upload_2019-12-17_23-4-5.png

    The formula with numbers applied (arrow shield)
    upload_2019-12-17_23-4-58.png

    Simple blue mask + vaward + spring build, adding just +100 int for a total of 140
    ________________________________
    If for your calculation this should work, let me know
     
  13. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    I didn’t use floor, I hust casted it in an int. But you’re dividing the raw spell cost by 100, since rawspellcost is just the -1 arrow bomb cost for example it should be left alone


    EDIT: weird, that shouldn’t break arrow storm, it should cost 2? I’ll take another look, but the proposed equation might be wrong that they gave
     
  14. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    Wops my bad... I fixed and now is almost correct:
    1 1 1 3
    Arrow storm should be 2

    upload_2019-12-17_23-18-22.png

    EDIT: how do I round at the end (after all multiplications)? up, down, normal?
     
  15. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    I rounded at the end just by converting the double value into a int, which truncates. Floor should in theory work the exact same way, so that should work.

    Im confused why arrow storm is costing 2, are you testing it in game i assume?
     
  16. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    yes:

    upload_2019-12-17_23-22-47.png
    (+20 int from spring in hand)
    upload_2019-12-17_23-23-3.png
    Blue mask + vaward + spring (all the ids that matter are static / not ranged)

    upload_2019-12-17_23-23-32.png
     
  17. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    Is it possible they put a hard minimum on spell costs of certain abilities reduced purely by int values?
    ________________________________
    Because the only thing affecting arrow storm is the int reduction, and if you reduce it by 78.2% the non rounded value is 1.3, which should round down to 1. But clearly that isnt the case, All other classes (according to your chart) cant have their first ability reduced to one by purely intelligence, minus shaman. So there might be a check in place to prevent reducing the cost further. @dukioooo
     
  18. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    nope
    upload_2019-12-17_23-27-24.png

    switched to a nightwalk + sp spam build (still spring)

    144int
    nightwalk gives -1 raw 1st spell (arrow storm)

    so it can reach 1
     
  19. Enderman1234

    Enderman1234 Famous Adventurer VIP+

    Messages:
    1,021
    Likes Received:
    728
    Trophy Points:
    117
    Minecraft:
    I know it can reach 1, Im saying when JUST reduced by int, thats also being reduced by raw spell cost reduction.
     
  20. dukioooo

    dukioooo Creator of WynnData HERO

    Messages:
    3,311
    Likes Received:
    2,526
    Trophy Points:
    136
    Guild:
    Minecraft:
    upload_2019-12-17_23-31-6.png

    with 139+20 intel (just sp spam, no more -1 raw spellCost)

    so to reach 1 it requires another -1 raw spellCost item
     
Thread Status:
Not open for further replies.