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

Fix For Mobs Not Always Scaling Properly In Raids #202

Open
whipowill opened this issue Jan 14, 2025 · 0 comments
Open

Fix For Mobs Not Always Scaling Properly In Raids #202

whipowill opened this issue Jan 14, 2025 · 0 comments

Comments

@whipowill
Copy link

Current Behaviour

I think this is a dupe of issue #172 but I wanted to make my own thread and post my theories on this bug.

The issue is cases where mobs are not scaled properly in an instance, despite all the settings being correct. I think the issue is limited to large instances, meaning only raids. I think it has to do with how mobs are loaded into memory, where in a dungeon maybe everything will load all at once bc it's relatively small, but in a raid the area is so large not every mob is loaded at once. I think it's the mobs loaded later who are failing to be scaled.

For a while, I would use a macro .ab setoffset 0 and just click it whenever I found a mob not properly scaled, and it would work fine. But after this became annoying, I amended the autobalance mod to add a 1 minute map update.

In ABPlayerScript.cpp:

void AutoBalance_PlayerScript::OnUpdate(Player* player, uint32 /*p_time*/)
{
    // if it's been less than 60 seconds since last check, bail...
    if (GetEpochTime().count() % 60 != 0) return;

    Map* map = player->GetMap();
    if (!map || !map->IsDungeon())
    {
        return;
    }

    // update the map's player stats
    UpdateMapPlayerStats(map);

    // schedule all creatures for an update
    AutoBalanceMapInfo* mapABInfo = map->CustomData.GetDefault<AutoBalanceMapInfo>("AutoBalanceMapInfo");
    mapABInfo->mapConfigTime = GetCurrentConfigTime();
}

So though I don't know why this bug exists, I can only speculate, this new onupdate method has resolved it. It just forces the map to check scaling on creatures every minute.

Expected Behaviour

I've presented a proposed fix for this bug.

Steps to reproduce the problem

I've experience scaling failures in large raids, such as AQ20 and AQ40.

Extra Notes

No response

AutoBalance Debug Commands

No response

AC rev. hash/commit

NA

Operating system

Ubuntu 24

Custom changes or Modules

No response

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

1 participant