[Skyblock] Not receiving all the exp from multiple mob kills in a stack

Discussion in 'Help & Support / Errors & Bugs' started by Gluupor, Jun 6, 2018.

  1. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    Minecraft Username:
    Gluupor

    Brief Description:
    killing >1 mobs from a stack only yields exp for the first and a fraction for every other mob killed

    Instructions:
    have a stack of mobs (for the ease of testing i recommend blaze as they yield exactly 10exp per mob)
    kill >1
    see how you only get 10 for the first mob a fraction of exp for every additional mob killed

    How many times did you recreate this?:
    couple times, one time i took the following screenshots

    Result:
    gained 12 exp after killing 4 blazes

    Expected Result:
    gain 40 exp as supposed to (referring to the test i made the screenshots with)
    or whatever scaling the plugin config had before the update of the plugin (i know that kill-step in the config was messed up as well after updating)

    Evidence:

    i made sure the spawner was actually not spawning to avoid having faulty results due to restacking.

    amount in stack before:
    [​IMG]

    amount of exp before:
    [​IMG]

    amount in stack after:
    [​IMG]

    amount of exp after:
    [​IMG]
     
  2. Jdawger

    Jdawger Goes by Brass Scribe everwhere except MC & ECC
    ECC Sponsor EcoLeader ⛰️⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ VII ⭐ Gameplay Architect Premium Upgrade

    Joined:
    Dec 15, 2013
    Messages:
    4,700
    Trophy Points:
    92,160
    Gender:
    Male
    Ratings:
    +3,509
    Edit
     
    #2 Jdawger, Jun 7, 2018
    Last edited: Jun 7, 2018
  3. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    thx @andrewkm i added a comment to the report as to what i think might be the cause of the issue. bear with me tho i took java classes back during my apprenticeship but thats quite some time ago and i just occasionally do some silly more or less useful coding lol
     
    #3 Gluupor, Jun 7, 2018
    Last edited: Jun 7, 2018
  4. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    i added a comment to the github issue. maybe @JamieSinn is able to confirm if i am actually correct about my assumption or not.
     
  5. JamieSinn

    JamieSinn Retired Lead Administrator/Developer
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jun 4, 2011
    Messages:
    5,447
    Trophy Points:
    82,090
    Gender:
    Male
    Ratings:
    +4,567
    You're on the right track, but that's not exactly correct.
     
  6. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    before:
    [​IMG]

    killed 4; expected 40 got 27:
    [​IMG]

    killed another 3; expected 30 got 19:
    [​IMG]

    still not getting the exp the amount of mobs killed would actually give.
    tbh im not even sure what the change he made was supposed to do he added a (imo) random add to the calculation. is this supposed to be some sort of scaling? why is it hardcoded if it is ...
     
    #6 Gluupor, Jun 8, 2018
    Last edited: Jun 8, 2018
  7. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    https://github.com/Nathat23/StackMob-2/pull/62

    this should actually work now. he is doing the -1 on calling multiplication because the entity drops exp by default. then again the additional subtraction was giving faulty results.
    i also added a "multiply-exp-scaling" option to the config that gets used in the calculation when "multiply-exp-enabled" is true. so in case the need for scaling exp up or down for whatever reason: its possible.
     
    #7 Gluupor, Jun 8, 2018
    Last edited: Jun 8, 2018
  8. JamieSinn

    JamieSinn Retired Lead Administrator/Developer
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jun 4, 2011
    Messages:
    5,447
    Trophy Points:
    82,090
    Gender:
    Male
    Ratings:
    +4,567
    To expand on this - You should NEVER make edits to code on GitHub's website. They have no syntax checking/errors when you mistype something.
     
  9. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    i edited it in eclipse locally and tested it locally as well. with the scaling being 1 it gives exactly 10 xp per blaze killed. with scaling like 0.9 it gives 10 for the first blaze (as this is a default drop) and 9 for every additional blaze killed.
     
    #9 Gluupor, Jun 9, 2018
    Last edited: Jun 9, 2018
  10. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    i made a change so it actually provides a default in case the config isnt updated right away. again bear with me its been some time but i wanted to help and couldnt get over it lol
     
    #10 Gluupor, Jun 9, 2018
    Last edited: Jun 9, 2018
  11. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    the PR was merged hoping to see the fixes on the server soon :D
     
  12. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    confirmed: killing mobs now gives the expected amount of exp
     
  13. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    only receiving exp for one mob killed (killed 4 blazes received 10 exp as opposed to 40)

    if i am not mistaken this is the wrong way round:

    ExperienceOrb exp = (ExperienceOrb) dead.getWorld().spawnEntity(dead.getLocation(), EntityType.EXPERIENCE_ORB);

    exp.setExperience(sm.expTools.multiplyExperience(originalExperience, subtractAmount));

    he spawns the orb before setting its experience so i guess the orb spawns with 0 exp and the only 10 exp i get is the exp the entit(blaze) will drop on kill by default.
    it was actually done the other way round, calculate exp then spawn the orb, before the change.

    put it in spoiler since theres prolly some other issues after i did some testing one being the fact that hes still doing

    "multiply-exp-enabled"

    instead of

    "multiply-exp.enabled"

    after changing the config. i changed it to that and got multiplied exp but it was weird values that didnt reflect the amount of mobs i killed.

    and im actually too tired to test any other possibilities...
     
    #13 Gluupor, Jun 19, 2018
    Last edited: Jun 19, 2018
  14. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    yes its broken and i found the cause. create an issue please i will add my findings maybe submit a fix...

    hes doing an "add" instead of a "multiplication" when doing the calculation for the exp ... copy and paste error
     
  15. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    i added my findings so far.
    might submit a fix after work if i find some time.
     
  16. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    i submitted a PR. when this goes live the config needs to be like:

    multiply-exp:
    # Multiplies the experience dropped on kill-all/kill-step.
    enabled: true
    # Algorithms that should be used for multiplying experience.
    # LEGACY - algorithm used in StackMob v2.2.9 and older
    # MINIMAL - only add a small amount of extra experience.
    # NORMAL - the default amount of extra experience.
    # GENEROUS - adds a significant amount of extra expierence.
    # CUSTOM - use a custom multiplier for the extra experience.
    # CUSTOM_RANDOM - same as CUSTOM but makes multiplier a bit random.
    algorithm: CUSTOM
    # Used when the CUSTOM or CUSTOM_RANDOM mode is used above.
    custom-multiplier: 1.0

    algorithm: CUSTOM and multiplier to 1.0

    this will resemble what we had before. doing the config change without the fix i submitted will leave use with players getting exp for one additional mob that was actually never killed. (kill 3 get exp for 4 which isnt intended at least from your perspective i guess ^^)
     
  17. Gluupor

    Gluupor Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️ Prestige ⭐ I ⭐

    Joined:
    Jun 2, 2017
    Messages:
    189
    Trophy Points:
    7,940
    Gender:
    Male
    Ratings:
    +125
    works as intented .. again... not getting too little or too much (as you did recently) exp