- Apply
karpathy-guidelinesfirst for all code edits: small, surgical, verified. - Use context-mode for exploration and analysis:
ctx_batch_execute,ctx_search,ctx_execute; avoid raw large output. - Headroom is configured as the repo MCP in
.codex/config.toml; provider settings stay in/root/.codex/config.toml. - Caveman mode active via Claude Code plugin; or is available as project skills under
.agents/skills; keep responses short when active. - For any MonoGame/client/rendering/performance work, MUST use
.codex/skills/monogame/SKILL.mdor.agents/skills/monogame/SKILL.mdplus relevant MuOnline skills. - Verify changes with the narrowest useful check:
dotnet build ./MuWinGL/MuWinGL.csproj -c Debug -p:MonoGameFramework=MonoGame.Framework.DesktopGL --nologo
- World coordinates use
Vector3(X, Y, Z)withZas height. - Terrain is
256 x 256tiles; one tile isConstants.TERRAIN_SCALE == 100fworld units. - Tile/network coordinates convert to world center as
tile * TERRAIN_SCALE + TERRAIN_SCALE / 2f; ground-level Z is usually0f. - Camera, visibility, wind, terrain, and world object placement use X/Y for map plane and Z for vertical offsets.
- Default camera constants live in
Client.Main/Constants.cs; yaw/pitch are radians viaMathHelper.ToRadians. - Runtime data loads from
Constants.DataPath, defaulting toAppDomain.CurrentDomain.BaseDirectory/Data. - Object transform flow: change
Position,Angle, orScale;WorldObjectrecalculatesWorldPosition. - Network handlers can run off the render thread; scene/UI/world mutations should go through
MuGame.ScheduleOnMainThread. - SpriteBatch state should be managed with
SpriteBatchScopewhen nesting or restoring graphics state. - For visual/effect parity, verify against
SourceMain5.2evidence before inventing MonoGame approximations.
ModelObject.Positionis Vector3 (world units).WalkerObject.Locationis Vector2 (tile coords). Convert:tile * TERRAIN_SCALE + TERRAIN_SCALE / 2f.GameSceneSkillController— handles all skill usage: right-click, area skills, teleport, Nova charging. Cooldowns tracked viaSkillCooldownTrackerstatic class.SkillDatabase— static utility loadingskill.bmd. ReturnsSkillBMDwith mana cost, damage, range, requirements, delay, mastery type.BuffManager— central buff state viaProcessMagicEffectStatus(playerId, effectId, isActive). FiresBuffStateChangedevent consumed byBuffEffectControllerfor visual effects.BuffEffectController— subscribes to BuffManager, applies Swell (scale ×1.25) viaWalkerObject.Scale, aura colors for Damage/Defense/ManaShield/Poison/Ice.PacketRouter— manually instantiates handlers with dependencies. BuffManager and PetManager created here; add new managers here and pass to relevant handlers.CharacterState.ClassisCharacterClassNumberenum (DarkKnight=16, DarkWizard=0, FairyElf=32, etc.). Knight classes: DarkKnight, BladeKnight, BladeMaster.- SourceMain energy formula for skills:
20 + (RequiredEnergy * Level * 4 / 100). Knight gets10 + .... Summon Explosion/Requiem:20 + (Energy * Level * 3 / 100). - Pet system:
PetObjectextendsModelObject, follows owner usingTilePosition(Vector2 from WorldPosition).PetManagertracks per-owner via_activePetsdict.