Slightly Randomize Amount of XP Gained For Each Character (SOLVED)

Discussion in 'JS Plugin Requests' started by Tonedawg181, Sep 22, 2018.

Thread Status:
Not open for further replies.
  1. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    EDIT: Skip to my second to last comment on the thread for a working result. (near the middle of page 2)

    So, in most rpg games (not made by rpg maker) not every character receives the same amount of XP after every battle.

    For example:
    In Final Fantasy 8, whoever had the killing blow on the enemy received the most XP from the fight. The rest will still get XP, but slightly less.
    (edit, im keeping this example in the thread incase someone is reading the comments and wants context of the coversation, but the end result does NOT use this style of formula, its RNG based within a given range rather than killing blow based)

    So what I want, is basically say the monster gives (in the system database) 50 XP when it dies. Maybe one player will receive like 48 XP, another gains only 42 XP for example. (It doesn't have to follow final fantasy 8 logic where the killing blow determines it, i would actually prefer it doesn't)

    My reasoning for this is it kinda makes plugins such as yanfly's aftermath look bland and boring when you see all 4 player's bars fill up the same amount each time.

    If someone knows how to make a plugin like this, or knows of an already existing plugin to accomplish this task, or possibly a script call? please post it below!

    Sincerely,
    ~Tonedawg
     
    Last edited: Sep 26, 2018
    #1
    Maliki79 likes this.
  2. Grunwave

    Grunwave Veteran Veteran

    Messages:
    452
    Likes Received:
    114
    First Language:
    English
    What would determine the variance?
     
    #2
    Tonedawg181 likes this.
  3. jonthefox

    jonthefox Veteran Veteran

    Messages:
    1,268
    Likes Received:
    431
    Location:
    NYC
    this is a cool idea. i like the option to randomly vary the exp by a specified percentage, as well as the option to award bonus xp based on landing a killing blow.
     
    #3
    Tonedawg181 likes this.
  4. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Well lets just say for example, in the enemies database the monster is "supposed" to give 50, maybe make it a +10 / -10 variance, so like a randomly generated number between 40-60 for example.
     
    #4
  5. Grunwave

    Grunwave Veteran Veteran

    Messages:
    452
    Likes Received:
    114
    First Language:
    English
    So completely random? Not based on some variable or input/outcome?
     
    #5
  6. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    completely random is a strong term..

    more like random within a set amount of leniency... (like i said above, +10 / - 10 variance would actually work pretty well)

    I don't want one player receiving like 2 exp and the other one receiving 200 exp.

    But correct, no variable or input/outcome determining factor. The final fantasy thing was just an example, I think that system is actually flawed because then if the same character keeps getting the killing blow, they become over-leveled compared to the rest of the group and have a tendency to keep getting the killing blow, which would snowball that character out of control.
     
    Last edited: Sep 23, 2018
    #6
  7. Grunwave

    Grunwave Veteran Veteran

    Messages:
    452
    Likes Received:
    114
    First Language:
    English
    Could probably go into the source code and add a roll that multiples the EXP by "1.x" make the roll between 0-9
     
    #7
    Tonedawg181 likes this.
  8. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Do u know the exact process for doing that? Because I do not lol. That's a good idea though.
     
    #8
  9. kovak

    kovak Silverguard Veteran

    Messages:
    1,243
    Likes Received:
    1,546
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    I'm not a coder so i may screw up.
    It's in the rpg_objects.js and all i did was to add a small random number to the formula, it's pretty much a D6

    This is the source code
    This is the customized one
    A SS to prove that it works
    upload_2018-9-24_7-26-46.png
     
    #9
    Tonedawg181 likes this.
  10. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    I'll give that a shot as soon as im home from work! Thanks :D
     
    #10
  11. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright, so i tried what @kovak said and it DOES work. BUT I have to bite my own tongue here.... I got exactly what i asked for, it looks like a variance of around +10 / -10. But what I didnt take into consideration is when it's late into the game and were dealing with numbers in the thousands for exp, +10 / -10 turns into a pretty wimpy looking amount of variance, is there a way to do this multiplicative so it scales nicer?

    for example:
    around level 5 the +10/-10 variance makes sense
    but around level 60 for example it would make more sense to have a variance of maybe +100 / -100 (possibly higher)

    i feel like for this new concept to work the math HAS to be done in a multiplicative fashion, otherwise if a player back-tracked and went to an area with weak enemies while the party is already a high level, they could end up receiving no exp at all.
     
    Last edited: Sep 25, 2018
    #11
  12. kovak

    kovak Silverguard Veteran

    Messages:
    1,243
    Likes Received:
    1,546
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    I think i've found the solution

    upload_2018-9-25_8-21-11.png
     
    #12
    StrikerVT likes this.
  13. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    okay, so for some reason that new formula when the player is a low level there is no variance at all. (reference pictures below)
    [​IMG]
    and at a higher levels though this works slightly better than the original formula but still kinda a wimpy amount of variance, a monster giving 20,000 xp should have a variance of at least 100. Overall I would consider this new formula broken because of it giving no variance at all at low levels. (reference pictures below)
    [​IMG]
    I also tried bumping that 7 up to 70 in the formula which seemed to yield good variance results when the characters are higher levels but the same issue (no variance given) when they are low levels.

    So I think were on the right track but... I think more needs to be added to the math formula to make this work properly.
     
    Last edited: Sep 26, 2018
    #13
  14. kovak

    kovak Silverguard Veteran

    Messages:
    1,243
    Likes Received:
    1,546
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    Try this one

    I'm tired of quick editing it at work and i'm not sure if it's gonna work or not.
    DO NOT DO THIS AT WORK!!!
     
    Last edited: Sep 26, 2018
    #14
    Tonedawg181 likes this.
  15. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay this one fixes the low level players not receiving exp variance issue. But I wont lie to u its still not exactly what I had envisioned though.... I understand your at work and are doing this just out of generosity, so I can live with this, its pretty good if you wanna call it quits but...

    The way this is set up, were still only looking at a variance range of around 30.

    Like I said before, this makes sense when it's early in the game, like when a monster only gives u 200 xp, a range of 30 makes perfect sense.

    But when it's late in the game, and a monster is giving you 20,000 xp, a range of 30 looks super small, it should be a variance range of like 1000.

    Could this be fixed by adding like IF statements? I'm not a coder so thats kinda just a shot in the dark.
     
    #15
  16. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,451
    Likes Received:
    928
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @Tonedawg181 Just a suggestion -

    I read through this thread and it's kind of like you're shooting in the dark, it doesn't sound like you've defined what you actually want. It's not surprising, then, that the formulas that are being given to you don't meet those expectations. I think it would be best for you to think about it and define a mathematical formula that you want to be implemented. Then, somebody like @kovak can take your mathematical formula and translate it to Javascript.

    For example:
    ^^ These are two completely different things, in one post you are asking for the formula to be described in terms of the player's level, and in the next post you are asking for it to be relative to the amount of XP the monster is giving you.

    Both are possible (and indeed, it is even possible to have it together in the same formula), but you should really nail down what you're asking for.
     
    #16
    Tonedawg181 likes this.
  17. kovak

    kovak Silverguard Veteran

    Messages:
    1,243
    Likes Received:
    1,546
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    Wish i knew how to do it but i don't. I'd need to trully understand the source code and javascript to give a proper range based on level.
    I think i can make a final tweak but it won't increase it much as you wished for.

    Dun worry about me doing this at work, i'm just goofying around.

    Let's assume that at level 98 it gonna give a cap of 216 EXP.
    Also, it's giving extra EXP plus the reward you'd get from slaying an enemy.

    I have some hints about working directly with the EXP awarded but i'm not sure about how i'd do it without testing either.
    Also consider that you don't want your actors to have a huge gap of EXP between them. You'll never want your actors underleved because of bad RNG
     
    Last edited: Sep 26, 2018
    #17
    Tonedawg181 likes this.
  18. Tonedawg181

    Tonedawg181 Tonedawg Gaming Veteran

    Messages:
    65
    Likes Received:
    19
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV

    I know I kinda made this confusing sounding, I apologize. To be completely honest it's getting confusing in my head to even explain:rswt2:

    First off, I want the scaling formula to be be determined by the xp value awarded by the enemy in the database, NOT determined by the player's level.

    I just want the range to scale as the numbers get higher, rather than being one set variance range.

    for example:
    If a monster was to give 100 xp in the database, a variance range of roughly 10

    1000 xp, variance range of roughly 80

    5000 xp, variance range of roughly 200

    10,000 xp, variance range of roughly 600

    20,000 xp, variance range of roughly 1000

    those dont have to be exact numbers, but a system set up like that if that makes sense....

    basically the range is increasing as u get further into the game and are seeing enemies that yield higher amounts of xp. (within the limitations of not getting SO big of a variance that a little extra grinding wont fix it)

    I hope that makes sense lol. I feel like this should be possible with some sort of mathematical equation which makes me mad at myself for not paying closer attention in college lol.
     
    #18
  19. kovak

    kovak Silverguard Veteran

    Messages:
    1,243
    Likes Received:
    1,546
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    EDIT: tried to fix again, formula was a bit odd.
    Not sure if this is gonna work

    I'm not sure if "exp" stands for the exp you gain from killing a mob
    This formula is supposed to give up to 10% of the EXP
     
    Last edited: Sep 26, 2018
    #19
  20. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,451
    Likes Received:
    928
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    What you're asking for makes sense, but unless you ask for something specific, it's tough to get exactly what you want. This is kinda why since the first reply, people have been asking you to explain what would determine the variance.
    A formula could be written to express this, but it would be pretty complicated because the variances are not consistent. Also, it would be unclear how to handle the in-between examples.
    • What variance would a 3000 xp enemy receive?
    • What about a 50,000 xp enemy?
    • Should the % variance be both positive and negative?
    • Does the "experience rate" sp-parameter apply before or after the variance?
     
    #20
Thread Status:
Not open for further replies.

Share This Page