14 KiB
ArgusCore — Analysis & Implementation Plan
Generated: 2026-05-30 Source of truth: ROADMAP.md + live codebase scan
Phase 0 — Documentation Discovery (Findings)
Sources consulted:
ROADMAP.md— full phase-by-phase plan with per-task statusREADME.md— build requirements and config layoutCMakeLists.txt— build system structure and module wiringmodules/cmake/AddModule.cmake—add_argus_module()API.github/workflows/build-linux.yml/build-windows.yml— CI pipelinesrc/server/scripts/— content script structurelogs/— reference codebase inventory
Current Phase Status:
| Phase | Title | Status |
|---|---|---|
| 1 | Safe Rebranding | Validated |
| 2 | Custom Script Integration | Complete |
| 3 | Build System Cleanup | Validated |
| 4 | Dependency Updates | Validated (MariaDB pending) |
| 5 | Code Modernization | Complete |
| 6 | CI, Testing, Profiling | Complete |
| 7 | Modular System | In progress |
| 8 | Safe Async Systems | Complete |
| 9 | Map Threading Research | Complete |
| 10 | World Layering | Complete (design only) |
| 11 | NPC Gameplay Systems | In progress |
| 12 | Class Spell Restoration | In progress |
Architecture Overview
ArgusCore/
├── src/
│ ├── common/ Networking (Asio), crypto, config, logging, threading, collision
│ ├── server/
│ │ ├── bnetserver/ Auth + realm selection (port 3724)
│ │ ├── worldserver/ Main game server (port 8085)
│ │ ├── game/ Core game logic (~52 subsystems: Units, Spells, Maps, AI, Handlers…)
│ │ ├── scripts/ Content scripts — organized by zone and class
│ │ │ ├── Spells/ spell_dk.cpp, spell_monk.cpp, spell_dh.cpp …
│ │ │ ├── BrokenIsles/, Argus/, Northrend/ … zone content
│ │ │ └── Custom/ standalone features (now empty — scripts moved to modules)
│ │ ├── database/ DB abstraction + schema updater (UpdateFetcher, DBUpdater)
│ │ └── shared/ Shared packet/network/realm code between servers
│ └── tools/
├── modules/ AzerothCore-style external module system
│ ├── cmake/AddModule.cmake add_argus_module() helper
│ └── (mod-* subdirs auto-discovered at configure time)
├── sql/
│ ├── base/ Initial schema (DO NOT modify post-import)
│ ├── updates/<db>/master/ RELEASED updates (committed)
│ ├── pending/<db>/ PENDING (WIP/pre-review, not committed)
│ ├── custom/<db>/ CUSTOM (server-local, never committed)
│ └── old/ ARCHIVED legacy
├── logs/ Reference codebases (read-only)
│ ├── LegionCore-7.3.5-merged/ Primary Phase 12 spell source
│ ├── TrinityCore-master/
│ ├── TrinityCore-Cata/
│ └── SkyFire_548-main/
└── .github/workflows/
├── build-linux.yml 4 jobs: Debug+tests, ASAN, UBSAN, Profile
└── build-windows.yml MSVC RelWithDebInfo + artifact ZIP
Module wiring: modules/ → add_argus_module() → global ARGUS_MODULE_LIBRARIES property → root CMakeLists.txt links into worldserver + generates modules_loader.cpp calling Add<NAME>Scripts().
Script registration: Each script class calls RegisterSpellScript(ClassName) (or similar) inside an AddSC_*() function, which is declared in the relevant *_script_loader.cpp.
SQL update states: RELEASED | ARCHIVED | CUSTOM | MODULE | PENDING — tracked in UpdateFetcher::State (src/server/database/).
Phase 7 — Modular System (Remaining Work)
What's done: Module infrastructure (CMake helper, auto-discovery, script loader generation, DB state enum expansion, sql/pending/ and sql/custom/ directories with .gitkeep).
One task remaining:
7A — Module SQL Auto-Discovery in DBUpdater
Goal: At startup, DBUpdater scans modules/mod-*/sql/<db>/ and registers discovered directories as MODULE-state include paths — no manual updates_include entries needed per module.
File to edit: src/server/database/Database/DBUpdater.cpp
Pattern to follow: Look at how sql/updates/<db>/master/ is registered as RELEASED; replicate the scan logic but walk modules/mod-*/sql/<db>/ via filesystem iteration.
Verification:
- Create a test module with a
sql/world/migration file - Start server — confirm the migration is applied without any manual DB row insertion
- Confirm
updatestable shows state =MODULE - No existing RELEASED updates affected
Anti-pattern: Do not hardcode module names — use directory glob/scan.
Phase 11 — NPC Gameplay Systems (Remaining Work)
Pathfinding and obstacle-jumping are done. All three power-type levels are unstarted.
11A — Level 1: Display (SQL only)
Goal: Set correct unit_class in creature_template for humanoid NPCs so the right power bar displays. No code changes.
Steps:
- Query
creature_templateforunit_class = 0on humanoid-type entries where class should not be 0 - Write SQL update →
sql/pending/world/rev_<timestamp>.sql - Validate in-game: mage NPC shows mana bar, warrior shows rage bar
Tool: tools/create_sql.ps1 generates the pending file.
Verification:
- Named humanoid NPCs display correct power bar type
11B — Level 2: Resource Consumption (Code)
Goal: NPC spells actually consume mana/rage/energy. A mage NPC can run OOM.
Steps:
- Grep
src/server/game/Spells/for where spell cost checks are bypassed for non-player units - Remove or conditionalize the bypass — NPCs with
unit_class != 0pay spell costs - Run full compile + boot test
- Validate: mage NPC mana depletes; no existing boss script regressions
Critical guard: Boss scripts that rely on infinite resources must not break. Audit any script in src/server/scripts/ that sets UNIT_FLAG_PACIFIED or adjusts power before casting.
Verification:
- NPC mana drains under sustained cast pressure
- All boss scripts in existing raid/dungeon directories unaffected
11C — Level 3: AI Resource Management (Code + AI)
Goal: NPCs regenerate resources naturally, build rage on hit, and adjust ability priority based on current resource level.
Steps:
- Implement class-appropriate regen rates per
unit_classin the creature update path - Expose
GetPowerPercent()helper on creature AI base class - Add resource-gated ability priority to key humanoid NPC scripts (opt-in per script)
Anti-pattern: Do NOT apply globally — Level 3 is opt-in per creature script to avoid AI overhead regression.
Verification:
- Warrior NPCs generate rage on hit/damage
- Mage NPCs use filler spells when low mana
- No measurable AI update time regression (check with profiling build)
Phase 12 — Class Spell Restoration (Remaining Work)
Source: logs/LegionCore-7.3.5-merged/src/server/scripts/Spells/
Target: src/server/scripts/Spells/
Rule: One struct per commit. Compile + in-game test before next. Commit format: feat(scripts/spell): port spell_<name> from LegionCore
12A — Blocked DK Spells (Requires API Extension First)
These 4 DK spells cannot be ported until the following hooks are added to ArgusCore's spell system:
| Hook needed | Spells blocked |
|---|---|
DoCalcMaxDuration |
spell_dk_bonestorm |
GetRndEffectTarget() |
spell_dk_blood_mirror, spell_dk_breath_of_sindragosa |
AddEffectTarget() |
spell_dk_breath_of_sindragosa |
ClearSpellTargets / AddDelayedEvent / ExistSpellTarget / AddSpellTargets |
spell_dk_glacial_advance, spell_dk_glacial_advance_damage |
Decision required: Either add these hooks to the spell script system (see TrinityCore-master for reference implementations), or design workarounds that achieve the same behavior using available hooks.
Verification before unblocking:
- New hook compiles cleanly
- Existing spell scripts using related hooks still pass CI
12B — Monk (30 spells — all pending)
All 30 Monk spells in logs/LegionCore-7.3.5-merged/src/server/scripts/Spells/spell_monk.cpp are unported. Port in this suggested order (simpler first):
spell_monk_disable— movement impair, simplespell_monk_zen_pilgrimage/spell_monk_zen_pilgrimage_return— teleport pairspell_monk_transcendence/spell_monk_transcendence_transfer— spirit copy pairspell_monk_zen_flight_check/spell_monk_remove_zen_flightspell_monk_flying_serpent_kickspell_monk_expel_harmspell_monk_zen_pulsespell_monk_chi_wave/spell_monk_chi_wave_dummy/spell_monk_chi_wave_filterspell_monk_power_strikesspell_monk_hurricane_strikespell_monk_whirling_dragon_punch_activater/spell_monk_whirling_dragon_punch_activatedspell_monk_storm_earth_and_fire/spell_monk_storm_earth_and_fire_clone_visual/spell_monk_clone_castspell_monk_gift_of_the_oxspell_monk_guardspell_monk_purifying_brew/spell_monk_purified_healingspell_monk_enveloping_mistspell_monk_sheiluns_giftspell_monk_touch_of_karmaspell_monk_touch_of_deathspell_monk_dampen_harmspell_monk_diffuse_magic
12C — Paladin (24 spells — all pending)
Port order (simpler/isolated first):
spell_pal_lay_on_handsspell_pal_divine_shieldspell_pal_hand_of_protectionspell_pal_divine_interventionspell_pal_divine_steedspell_pal_zealspell_pal_holy_wrathspell_pal_divine_stormspell_pal_holy_shockspell_pal_shield_of_the_righteousspell_pal_shield_of_vengeancespell_pal_ardent_defenderspell_pal_light_of_the_protectorspell_pal_last_defender/spell_pal_at_last_defenderspell_pal_at_aura_of_sacrificespell_pal_at_devotion_auraspell_pal_greater_blessing_of_kingsspell_pal_holy_shieldspell_pal_holy_prism/spell_pal_holy_prism_effect/spell_pal_holy_prism_heal/spell_pal_holy_prism_damagespell_pal_lights_hammer
12D — Warlock (16 spells — all pending)
Port order:
spell_warl_banishspell_warl_burning_rushspell_warl_demon_skinspell_warl_soul_harvestspell_warl_doom_boltspell_warl_corruptionspell_warl_unstable_affliction/spell_warl_unstable_affliction_R2spell_warl_streten_insanityspell_warl_seed_of_corruption_dotaspell_warl_demonic_circle_summon/spell_warl_demonic_circle_teleportspell_warl_demonic_gateway/spell_warl_demonic_gateway_cast/spell_warl_demonic_gateway_duration/spell_warl_demonic_gateway_at
12E — Hunter (15 spells — all pending)
spell_hun_tame_beastspell_hun_pet_heart_of_the_phoenixspell_hun_ancient_hysteriaspell_hun_masters_callspell_hun_fireworks/spell_hun_fetchspell_hun_kill_commandspell_hun_dire_beastspell_hun_cobra_shotspell_hun_beast_cleavespell_hun_flanking_strikespell_hun_a_murder_of_crowsspell_hun_explosive_shot/spell_hun_explosive_shot_detonatespell_hun_explosive_trap
12F — Warrior (12 spells — all pending)
spell_warr_charge_check_cast/spell_warr_charge_drop_firespell_warr_interceptspell_war_intervenespell_warr_shield_blockspell_warr_revengespell_warr_executespell_warr_bloodthirstspell_warr_heroic_leapspell_warr_fervor_of_battlespell_warr_ravager/spell_warr_ravager_visual
12G — Druid (12 spells — all pending)
spell_dru_cat_formspell_dru_travel_form/spell_dru_travel_form_removespell_dru_incarnation/spell_dru_incarnation_tree_of_lifespell_dru_lifebloomspell_dru_rakespell_dru_shredspell_dru_ripspell_dru_thrashspell_dru_ferocious_bitespell_dru_ashamanes_frenzy
12H — Mage (8 spells — all pending)
spell_elem_invisibilityspell_mage_displacementspell_mage_illusionspell_mage_flameglowspell_mage_cauterizespell_mage_erosionspell_mage_arcane_barragespell_mage_flurry
12I — DH Blocked Spells (Requires API Extension)
Requires GetAreaObjectList (6 spells) and GetAura()->GetRndEffectTarget() / m_whoHasMyAuras (4 spells). Same decision as 12A — add hooks or design workarounds.
12J — Rogue (1 spell)
spell_rog_shadowy_duel_main— verify nom_whoHasMyAurasdependency before porting
Phase 13 — Outstanding CI / Stability (Recommended Addition)
From Phase 6 outstanding items:
- Server profiling investigation — server is "noticeably slow"; run with InfluxDB metrics (map update times, DB latency, session update times) and profile before any optimization work
- 24h+ uptime test — CI only verifies compile + unit tests; a 24h stability run under load would validate Phase 8/9 async work
- 48h+ uptime test — required to close Phase 8 validation
Phase 14 — MariaDB LTS (Deferred)
From Phase 4: MariaDB LTS not yet tested. Floor stays 10.6.3 until a build is validated.
- Test MariaDB 11.x LTS on a Linux build
- Update minimum version in
README.mdandcmake/find scripts if needed
Phase 15 — Docker/CI Image (Deferred)
From Phase 1: Docker/container names still use upstream TrinityCore images. Needs own CI image build.
- Build ArgusCore-branded CI Docker image
- Push to Docker Hub or GHCR
- Update
build-linux.ymlto pull custom image
Execution Rules (from ROADMAP.md — apply to all phases)
- Every change: SMALL, ISOLATED, COMPILE, BOOT, TEST IN-GAME
- Never combine gameplay refactors with threading changes
- Never rewrite large systems at once
- Never optimize before profiling
- Stability > modernization speed
- Maintain backward compatibility
Immediate Next Steps (Priority Order)
- Phase 7A — Module SQL auto-discovery (unblocks all future modules from needing manual DB setup)
- Phase 12B–J — Continue spell ports class by class (simple spells first, blocked ones after API hooks are added)
- Phase 12A / 12I — Design API hook additions needed to unblock DK and DH remaining spells
- Phase 11A — NPC power type display (SQL only, low risk, high gameplay impact)
- Phase 13 — Profiling investigation (blocking any future performance work)
- Phase 11B — NPC resource consumption (after profiling baseline established)