Skip to content

fix(Core/Entities): reduce visibility range in Dalaran for performanc…#25695

Open
sudlud wants to merge 6 commits intoazerothcore:masterfrom
sudlud:reduce-dalaran-visibility-1
Open

fix(Core/Entities): reduce visibility range in Dalaran for performanc…#25695
sudlud wants to merge 6 commits intoazerothcore:masterfrom
sudlud:reduce-dalaran-visibility-1

Conversation

@sudlud
Copy link
Copy Markdown
Member

@sudlud sudlud commented May 3, 2026

…e improvements

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

AI-assisted Pull Requests

Important

While the use of AI tools when preparing pull requests is not prohibited, contributors must clearly disclose when such tools have been used and specify the model involved.

Contributors are also expected to fully understand the changes they are submitting and must be able to explain and justify those changes when requested by maintainers.

  • AI tools (e.g. ChatGPT, Claude, or similar) were used entirely or partially in preparing this pull request. Please specify which tools were used, if any.

Issues Addressed:

  • Closes

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

Known Issues and TODO List:

  • [ ]
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

…e improvements

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 3, 2026 07:43
@github-actions github-actions Bot added CORE Related to the core file-cpp Used to trigger the matrix build labels May 3, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces server-side visibility/sight distances while players are in Dalaran (Northrend) to improve performance in a high-density city zone.

Changes:

  • Add WorldObject::IsInDalaran() helper (zone-based check).
  • Clamp WorldObject::GetVisibilityRange() for gameobjects in Dalaran to VISIBILITY_DISTANCE_SMALL.
  • Clamp WorldObject::GetSightRange() for players in Dalaran to VISIBILITY_DISTANCE_SMALL (with existing Wintergrasp/override handling).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/server/game/Entities/Object/Object.h Adds IsInDalaran() helper for zone detection.
src/server/game/Entities/Object/Object.cpp Applies Dalaran-specific sight/visibility distance reductions.
Comments suppressed due to low confidence (1)

src/server/game/Entities/Object/Object.cpp:1717

  • GetVisibilityRange() only applies the new Dalaran reduction for IsGameObject(). Calls that use GetVisibilityRange() on players/units (e.g., ranged messaging and various range-based searches) will still use the full map visibility in Dalaran, which makes the Dalaran-specific optimization inconsistent. Consider applying the Dalaran check to the non-gameobject path as well (and, if intended, also aligning GetGridActivationRange() for players so grid activation matches the reduced visibility).
    else if (IsGameObject())
    {
        if (IsInWintergrasp())
            return VISIBILITY_DIST_WINTERGRASP;
        else if (IsVisibilityOverridden())
            return GetVisibilityOverrideDistance();
        else if (IsInDalaran())
            return VISIBILITY_DISTANCE_SMALL;
        else
            return GetMap()->GetVisibilityRange();
    }
    else
        return IsInWintergrasp() ? VISIBILITY_DIST_WINTERGRASP : GetMap()->GetVisibilityRange();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server/game/Entities/Object/Object.cpp Outdated
Comment thread src/server/game/Entities/Object/Object.h Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server/game/Entities/Object/ObjectDefines.h Outdated
Comment thread src/server/game/Entities/Object/Object.cpp Outdated
sudlud and others added 2 commits May 3, 2026 11:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sudlud sudlud requested a review from Copilot May 3, 2026 09:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1686 to +1691
if (IsInDalaran())
return VISIBILITY_DIST_DALARAN;
else if (IsInWintergrasp())
return VISIBILITY_DIST_WINTERGRASP;
else
return GetMap()->GetVisibilityRange();
Comment thread src/server/game/Entities/Object/Object.h Outdated
#define DEFAULT_VISIBILITY_DISTANCE 100.0f // default visible distance, 100 yards on continents
#define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards
#define VISIBILITY_DIST_WINTERGRASP 175.0f
#define VISIBILITY_DIST_DALARAN 84.0f // visible distance in dalaran due to the city's dense/compact layout
#define DEFAULT_VISIBILITY_DISTANCE 100.0f // default visible distance, 100 yards on continents
#define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards
#define VISIBILITY_DIST_WINTERGRASP 175.0f
#define VISIBILITY_DIST_DALARAN 84.0f // visible distance in dalaran due to the city's dense/compact layout
sudlud and others added 2 commits May 3, 2026 13:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core file-cpp Used to trigger the matrix build Ready to be Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants