Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPCs scaling up level when they should not based on defined LevelScaling.SkipLowerLevels #176

Closed
Zerkenn opened this issue Dec 25, 2023 · 5 comments

Comments

@Zerkenn
Copy link

Zerkenn commented Dec 25, 2023

Current Behaviour

When entering dungeons where the players level vs the map creature average level is greater than the defined AutoBalance.LevelScaling.SkipLowerLevels = defined amount , randomly some or all of the npcs are scaling up when they should not be.

Expected Behaviour

With the default config with of AutoBalance.LevelScaling.SkipLowerLevels = 5 if the players level is more than 5 levels above the instance average creature level than the levels of the npcs in the dungeon should NOT scale up.

Steps to reproduce the problem

  1. Be a higher level than lower level dungeons are suppose to scale up to.(Ex. be level 80 and go in stockades. Should not scale levels up with default config for skipLowerLevels of 5)
  2. Go in the stockades(or any dungeon where the player level is greater than 5 levels(default conf) above the average map creature level)
  3. Sometimes when entering the instance half the npc scale up and other times all of them scale up when they are not suppose to.

Extra Notes

image
image

AutoBalance Debug Commands

Map stats
12:30:23 Stormwind Stockade (5-player Normal) | ID 34-6
12:30:23 Players on map: 1 (Lvl 80 - 80)
12:30:23 Adjusted Player Count: 1
12:30:23 LFG Range: Lvl 20 - 30 (Target: Lvl 24)
12:30:23 Map Level: 23 (Level Scaling Disabled)
12:30:23 World health multiplier: 1.000
12:30:23 World hostile damage and healing multiplier: 1.000
12:30:23 Original Creature Level Range: 23 - 25 (Avg: 23.44)
12:30:23 Active | Total Creatures in map: 93 | 93

Targeting a npc that did not scale to 80 and stayed level 23
Defias Inmate (23), Active for Map Stats
Creature difficulty level: 1 player(s)
Health multiplier: 0.123
Mana multiplier: 0.000
Armor multiplier: 0.123
Damage multiplier: 0.123
CC Duration multiplier: 1.000
XP multiplier: 0.123 Money multiplier: 0.123

Targeting a npc that scaled to 80 standing right next to a level 23
Defias Prisoner (23->79), Active for Map Stats
Creature difficulty level: 1 player(s)
Health multiplier: 0.123 -> 2.484
Mana multiplier: 0.000 -> 0.000
Armor multiplier: 0.123-> 1.238
Damage multiplier: 0.123 -> 1.830
CC Duration multiplier: 1.000
XP multiplier: 2.157 Money multiplier: 2.157

AC rev. hash/commit

AC> AzerothCore rev. 03d06da87b85 2023-12-15 09:43:24 -0300 (master branch) (Unix, RelWithDebInfo, Static)
Connected players: 2. Characters in world: 2.
Connection peak: 2.
Server uptime: 8 hour(s) 35 minute(s) 15 second(s)
Update time diff: 1ms, average: 3ms.
Using SSL version: OpenSSL 3.0.11 19 Sep 2023 (library: OpenSSL 3.0.11 19 Sep 2023)
Using Boost version: 1.74.0
Using CMake version: 3.25.1
Using MySQL version: 101104
Found MySQL Executable: /usr/bin/mysql
Compiled on: Linux 6.1.0-13-amd64
Worldserver listening connections on port 8085
Realmlist (Realm Id: 1) configured in port 8085
VMAPs status: Enabled. LineOfSight: 1, getHeight: 1, indoorCheck: 1
MMAPs status: Enabled
maps directory located in /home/josh/azeroth-server/data/maps. Total size: 291014951 bytes
vmaps directory located in /home/josh/azeroth-server/data/vmaps. Total size: 658130721 bytes
mmaps directory located in /home/josh/azeroth-server/data/mmaps. Total size: 2192910844 bytes
Default DBC locale: enUS.
All available DBC locales: enUS
Using World DB: ACDB 335.10-dev
Latest LoginDatabase update: 2023_04_24_00.sql
Latest CharacterDatabase update: trasmorg.sql
Latest WorldDatabase update: trasm_world_texts.sql
LoginDatabase queue size: 0
CharacterDatabase queue size: 0
WorldDatabase queue size: 0

List enable modules:

  • DungeonRespawn
  • mod-autobalance
  • mod-eluna
  • mod-solo-lfg
  • mod-transmog

Operating system

Debian 12

Custom changes or Modules

DungeonRespawn mod
SoloLFG mod
Eluna
Transmog mod
Leveluprewards.lua

@Zerkenn Zerkenn changed the title NPCs scaling up when they should not based on defined LevelScaling.SkipLowerLevels NPCs scaling up level when they should not based on defined LevelScaling.SkipLowerLevels Dec 29, 2023
@pangolp
Copy link
Contributor

pangolp commented Mar 14, 2024

Greetings, thanks for the report. We will have to see where the fault may be. The truth is that it is a module that, until now, I have seen very little of. It is "complex", since you have to take many things into account. However, we hope that the report serves as information for the people who modify the module and can, with it, find the problem.

@kewinrausch
Copy link
Contributor

Greetings, I'm experiencing the same problem.
I have set the module configuration to scale all the instances regardless of the levels with the current commands

AutoBalance.LevelScaling.SkipHigherLevels = 0
AutoBalance.LevelScaling.SkipLowerLevels = 0

But the mobs seems to not being affected by this.
In addition the statistics seems to report the incorrect level for the player (in this case me, level 53)

1

2

@kewinrausch
Copy link
Contributor

I've tested this and realized two things:

  • I was testing in GM mode on; when this is the case the mod does no take you into account. If the highest level player remains zero then the mod automatically revert on the LFG level of the map.
if (thisPlayer && !thisPlayer->IsGameMaster())
{
    if (thisPlayer->getLevel() > highestPlayerLevel || highestPlayerLevel == 0)
    {
        highestPlayerLevel = thisPlayer->getLevel();
    }

    if (thisPlayer->getLevel() < lowestPlayerLevel || lowestPlayerLevel == 0)
    {
        lowestPlayerLevel = thisPlayer->getLevel();
    }
}
  • When I enter non GM, I still getting the issue with the mobs present around the starting are of the dungeon. I have the suspect that the update mechanism is not engaged early enough to handle already present mobs and works on the spawning one. This is just a guess since I just started looking in the mod internals. When this happens the mobs are adjusted if you .reload config, but this is not an operation a normal player can perform.

@kewinrausch
Copy link
Contributor

Hey everyone, after some testing I might have found the issue about this problem.

The problem seems to be that the creatures are dynamic leveled before the OnPlayerEnterAll is triggered by the system.
This cause the level of the highest player on the map to be 0 and the module use then the avg level obtained by LFG.

How can the maintainers test this?

  • Add a log entry at line 4572 like the following:
LOG_ERROR("module", "Player enter all");
  • Add a log entry at line 5386 like the following:
LOG_ERROR("module", "{} dynamic leveled to {} = ({} + {}) - ({} - {})", creature->GetCreatureTemplate()->Name, selectedLevel, mapABInfo->highestPlayerLevel, mapABInfo->levelScalingDynamicCeiling, mapABInfo->highestCreatureLevel, creatureABInfo->UnmodifiedLevel);
  • Enter a low level instance (Wailing Caverns for example) with a 50+ player, a character which is way higher than the average LFG assigned range.

You should be able to see on the console log the following trace:

Druid of the Fang dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Viper dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Viper dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Python dynamic leveled to 19 = (19 + 2) - (20 - 18)
Deviate Python dynamic leveled to 19 = (19 + 2) - (20 - 18)
Deviate Python dynamic leveled to 19 = (19 + 2) - (20 - 18)
Deviate Python dynamic leveled to 19 = (19 + 2) - (20 - 18)
Deviate Python dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Python dynamic leveled to 20 = (19 + 2) - (20 - 19)
Druid of the Fang dynamic leveled to 20 = (19 + 2) - (20 - 19)
Druid of the Fang dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Adder dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Adder dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Viper dynamic leveled to 20 = (19 + 2) - (20 - 19)
Deviate Viper dynamic leveled to 20 = (19 + 2) - (20 - 19)
Player enter all
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Druid of the Fang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Druid of the Fang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Lasher dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Dreadfang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Dreadfang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Dreadfang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Deviate Dreadfang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Evolving Ectoplasm dynamic leveled to 53 = (53 + 2) - (20 - 18)
Evolving Ectoplasm dynamic leveled to 53 = (53 + 2) - (20 - 18)
Druid of the Fang dynamic leveled to 54 = (53 + 2) - (20 - 19)
Druid of the Fang dynamic leveled to 54 = (53 + 2) - (20 - 19)

So the module start leveling before all the players are actually inside the instance, causing the issue.
There is actually an update that is invoked which will cause the mobs to be correctly aligned, but when you are inside the dungeon solo the condition is never triggered since if (prevAdjustedPlayerCount == mapABInfo->adjustedPlayerCount) is always 1 = 1, and the update is not forced upon the existing creatures.

I'm preparing a Pull request with the proposed fix from my fork.

@Helias
Copy link
Member

Helias commented Aug 22, 2024

closed by #188

@Helias Helias closed this as completed Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants