[LivingWorld]Add grid occupancy diagnostic commands#362
Merged
billy1arm merged 6 commits intoJun 10, 2026
Merged
Conversation
GM-only, in-game-only diagnostic commands that measure how many of a grid's 256 cells contain DB-backed spawns, to quantify whether future cell-cluster object loading is worthwhile (LivingWorld Phase 1.5). No behavior change. - .grid info [gridX gridY]: per-grid static spawn-definition occupancy (occupied/256 cells, creature/gameobject/corpse GUID totals, top cells); no args = current grid, two args = grid index on the current map. - .grid anchors: occupancy of the enabled startup anchor grids on the current map (CREATURE_FLAG_EXTRA_ACTIVE + enabled LivingWorld anchors) plus a min/median/max sparsity aggregate. All counts are static DB spawn-definition counts, not live object counts. The commands never load/create grids, spawn objects, query the DB, or mutate state: - ObjectMgr::GetCellObjectGuidsReadOnly(): find-based, non-inserting per-cell lookup (the existing GetCellObjectGuids() would operator[]-insert empties). - Map::IsGridLoaded(gx,gy): read-only grid-load check; never loads. - anchors read via the existing GetActiveCreatureGuids() accessor. No DB/schema/config changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GM-only, in-game-only diagnostic commands that measure how many of a grid's 256 cells contain DB-backed spawns, to quantify whether future cell-cluster object loading is worthwhile (LivingWorld Phase 1.5). No behavior change. - .grid info [gridX gridY]: per-grid static spawn-definition occupancy (occupied/256 cells, creature/gameobject/corpse GUID totals, top cells); no args = current grid, two args = grid index on the current map. - .grid anchors: occupancy of the enabled startup anchor grids on the current map (CREATURE_FLAG_EXTRA_ACTIVE + enabled LivingWorld anchors) plus a min/median/max sparsity aggregate. All counts are static DB spawn-definition counts, not live object counts. The commands never load/create grids, spawn objects, query the DB, or mutate state: - ObjectMgr::GetCellObjectGuidsReadOnly(): find-based, non-inserting per-cell lookup (the existing GetCellObjectGuids() would operator[]-insert empties). - Map::IsGridLoaded(gx,gy): read-only grid-load check; never loads. - anchors read via the existing GetActiveCreatureGuids() accessor. No DB/schema/config changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…github.com/MadMaxMangos/serverZero into livingworld/grid-cell-occupancy-diagnostic
- Fix line length violations (>80 chars) in GridCommands.cpp - Split long PSendSysMessage and SendSysMessage calls with proper continuation indentation - Split comments in ObjectMgr.h and Map.h to stay under 80 chars
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 28 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
billy1arm
reviewed
Jun 10, 2026
billy1arm
reviewed
Jun 10, 2026
billy1arm
reviewed
Jun 10, 2026
billy1arm
reviewed
Jun 10, 2026
billy1arm
reviewed
Jun 10, 2026
billy1arm
requested changes
Jun 10, 2026
- Add brackets around continue statements in GridCommands.cpp - Add brackets around return statements in ObjectMgr.h - Per MaNGOS coding standards: use brackets for non-obvious constructs
- Align string continuation lines with opening quote per coding standard - Re-wrap comments in ObjectMgr.h and Map.h to stay under 80 chars - Remove 3 extra spaces from string continuation indentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is work for the upcoming living world work that is being performed, we are releasing commands ahead of the actual world changes, so people can get familiar with the commands. These are diagnostic commands to check grids/cells within an active server.
Adds GM-only grid occupancy diagnostics:
.grid info [gridX gridY].grid anchorsThese commands report static DB spawn-definition occupancy by grid/cell without loading grids or changing world state.
Details
.gridcommand group.Safety
Testing
Verified in-game:
.grid info.grid info 22 26.grid infoon unloaded/far grid reportsloaded=nowithout loading it..grid anchorsThis change is