Pokecube AIO

Pokecube AIO

498k Downloads

nonPokemob EXP function improvement.

SebatheDragonbear opened this issue ยท 2 comments

commented

Is your feature request related to a problem? Please describe.

Over the years I wanted to improve the function for gathering EXP from non Pokemobs, of course this varies depending on context/ envrioment, mobs present and else.
however I've noticed that there isn't a one size fits all approach, which is okay, however, the current way the mod gathers data leaves edge cases which are way too common to ignore, like a glass cannon mob rewarding less than they should or a tank mob giving more than they should, meaning you can't set a function for a single playtrough.

Describe the solution you'd like

I want to pull more values from the mobs that the exp function wants to call.

Describe alternatives you've considered

  • Since mobs don't follow the norm of the pokemon system, I thought of just adding a function that gathers the Attributes from the mobs, and then on the exp function itself, grab those values, and have.
    Armor Toughness, Knockback Resistance, Damage, Damage Speed, movement Speed and Flying Speed.
    ...and base XP* (this value has inconsistent usage, due to the decision making when choosing this value.)

on top of the already existing max Health, and Armor.

  • of course, movement speed might not be that important, and attack speed might not be always used, but I feel like Armor toughness, and damage is a bit important to have.

Additional context

  • Most of the context is at the top, however, looking at the code I noticed that the mod (still) uses getMaxHealth to get the health of the mobs, Im really unsure of why is this the case.
    Originally I thought of just doing this myself but I lack complete knowledge over forge and the mod, so I open the Issue while I work on it.

  • Ideally getMaxHealth would be replaced with their Attribute version on the I HAS STATS and elsewhere.

Solution Suggestion

  • The process I would go for solving this would be.
  1. What stats matter?
    It would be pointless including stuff like movement speed, until you remember baby zombies and alike exist.
    you would think flying speed is dumb, but many of the more OP mobs have flying in them.

  2. Implement the functions using the Attribute system.
    something like

h = attacked.getAttribute(Attributes.MAX_HEALTH).getValue();
a = attacked.getAttribute(Attributes.ARMOR).getValue();
at= attacked.getAttribute(Attributes.ARMOR_TOUGHNESS).getValue();
kr= attacked.getAttribute(Attributes.KNOCKBACK_RESISTANCE).getValue();
d = attacked.getAttribute(Attributes.ATTACK_DAMAGE).getValue();
k = attacked.getAttribute(Attributes.ATTACK_KNOCKBACK).getValue();
ds= attacked.getAttribute(Attributes.ATTACK_SPEED).getValue();
bxp= attacker.getExperiencePoints(player);
  1. Fix it because it is very likely that they are undefined, as they are optional to define on a mob...
    This could easily be fixed with a if variable =! null{ do the thing }.
    However a fallback mechanism could be implemented.

And then that would be it.

then I would redo the default function so it uses the new variables, which includes more steps.

  1. Find how much do each variable impact the gameplay
    4.1. Compare them against pokemons.
    4.2. Review the amount of EXP gathered while looking at the experience groups.

  2. Look and Rank the Mobs and compare them against Pokemobs.
    5.1 look at their stats and exp yeld.

    • Regarding to exp yeld, values are often chosen not by pure stats but by importance of the mob, so an angry wolf would drop less than an endermite.
      5.2 Get some examples from modded mobs.
  3. Rank the Variables

  4. Build the function besd of the previous research.

commented

I can look into this for adjustments for the MC 1.21+ versions of the mod, the original code here was done before attributes were a standard or reliable thing, so much of it can now be re-factored to use them

commented

Oh, also note that getMaxHealth internally calls getAttribute(Attributes.MAX_HEALTH).getValue(), as does the call for getting armour used by the mod