[BUG??] Damage on Higher Difficulties is Weird.

Discussion in 'Empire Help & Support' started by CraftyCosmic, Dec 3, 2020.

  1. Critical hits on diff 7 don't do more damage than their regular counterparts- I believe that this also makes the Smite and Bane of Arthropods enchantments completely nullified on the afformentioned difficulties.
    I have not personally tested any difficulties aside from 7, but Smite and Bane not doing more damage to their specific monsters is definitely a bug though- EG my smite 5 diamond sword takes 5 hits to kill a diff 7 normal skeleton (no armor, 20 hp), and through a mod, I can confirm it does 4 damage. It takes 5 hits to kill a diff 7 pillager (no armor, 24 hp), and through the same mod it deals 5 damage. What? My Smite sword does more damage to non-undead monsters? This just doesn't make sense.
  2. Nothing is done to critical damage specifically, it all is just formulas to scale the difficulty, but there is also damage caps which is likely what you are noticing.

    Currently that formula is

    Code:
        static double handlePlayerDamageOut(Player player, Mob entity, double damage) {
            final CustomLivingMob<? extends LivingEntity> type = CustomMobs.getType(entity);
            if (entity instanceof Animals && type == null) {
                return damage;
            }
            final int playerDifficulty = getPlayerDifficulty(player);
    
            if (playerDifficulty < 5) {
                if (type == null) {
                    // 0.5% damage bonus to normal mobs per difficulty level reduction
                    damage *= 1 + (.005 * (5 - playerDifficulty));
                } else {
                    // 2.5% damage bonus to custom mobs per difficulty level reduction
                    damage *= 1 + (.025 * (5 - playerDifficulty));
                }
            } else if (playerDifficulty > 5) {
                // 12% reduction for every level over 5.
                damage *= 1 - (.12 * (-5 + playerDifficulty));
                // Damage Caps
                double maxDamage = entity.getMaxHealth() * (.08 + (0.04 * (10 - playerDifficulty)));
                if (damage > maxDamage) {
                    damage = maxDamage;
                }
            }
    
            return damage;
        }
    
    farmerguyson, 607, __Devil_ and 3 others like this.
  3. I love it when you give us snippets of code... maybe the algorithm for bosses to spawn ?
  4. would love to see that!
    CranberRhySauce likes this.
  5. I honestly didn't realize there was a damage cap above level 5, I thought damage was just scaled down super far. That might explain why crits don't seem to do more damage: If the cap is already being reached before the crit, then the extra crit damage will be nullified by the cap.

    Slightly clearer damage cap amounts:
    6: 24% of the mob's health, takes 5 hits to kill
    7: 20% of the mob's health, takes 5 hits to kill
    8: 16% of the mob's health, takes 7 hits to kill
    9: 12% of the mob's health, takes 9 hits to kill
    10: 8% of the mob's health, takes 13 hits to kill

    This means that on diff 10, spam clicking and bowspamming with powerful weapons might actually be a viable strategy. I'll let someone else look into that though.

    Although, this might be why Aikar doesn't post code snippits more often...
    607 likes this.
  6. Because this applies to max heath, it makes the damage cap on higher HP monsters (such as enraged and non-marlix minibosses) a lot higher- for example, let's attack Sorgina, with 102 HP on diff 7, making the max damage 20.4- effectively, this means the "durability" of higher HP monsters doesn't increase all too much until reaching diff 9 or 10, when the max damage is reduced to 8.
    Considering the possible targets on higher difficulties that have this property aren't undead or arthropods all too often, sharpness is the desired sword enchantment on swords.
  7. lol that's over like 10 different methods and many many input factors into it.... way too complex to share.
  8. I'm curious though- why not just use a flat damage reduction for higher difficulties?
  9. - cant be "away"
    - cant be in a box / under a low roof limit
    - one every 45 odd mins
    - uses a enraged mob spot to spawn?
    - other bosses in world?
    - night time only (no dark rooms)
    - difficulty??
  10. To not have to worry about every potential OP combination that may exists creating the potential to rapidly dispose of a custom mob.

    Enraged having lower health could become 1 shot potential.
  11. probs because differnt damage from differnt tools, wepons?

    presidental pen has a really fast wepon cooldown, pretty good for diff 10 it would seem. high dps
  12. yes but I mean the complexities of how all those factors are registered are spread out. each individual mob can register its own spawn validating methods, and override percentages. There's factors like players nearby, max player difficulty of all nearby players, has all players been marked for causing a mob of that type to spawn recently, per world, per player time delays between spawns, too close to another mob of the same type, spawning to replace a mob of the same vanilla type, player settings, biome restrictions, etc.

    it's a very abstract system.
    607 likes this.
  13. it really is, have been very interested to know the workings of it, and so have a few other players. spent my whole emc life around bosses and trying to figure out the most efficient way to get spawns. Feel like we have it, but probs now.
    It seems, judging by your post group / player difficulty influences boss spawn alot more than originally thought. "per player time delays between spawns," seems intresting... and biome restrictions, never knew this ether :0
  14. I don't see how that applies to the fact that this only applies to difficulty 6 and up when a flat HP boost or damage resistance can do the trick without having a weird effect on low health enemies like slimes becoming absurdly difficult to kill by hand (weapon w/o fire), but still taking the same 1 damage tick and dying to fire.
    Envine likes this.
  15. pretty sure its same for damage potions, posion, etc