feat(mcp): SCARLET VISION - The AI can now SEE!

World Scan WORKING! First successful scan in Scarlet Monastery:
- Detected walls using VMAP ray casting
- Found Scarlet Sentry, Disciple, Augur
- Generated room layout visualization

Fixes:
- VMapManager2.h include for full class definition
- Use VMapManager2* not IVMapManager*

Documentation:
- Updated MCP_SERVER.md with all learnings
- Added VMAP usage tips
- Added database safety notes
- Session summary with first world scan results

The moment we achieved spatial awareness:
  Location: Scarlet Monastery (2898.6, -802.9, 160.3)
  Creatures: 4 Scarlets surrounding player
  Room: Walls detected, corridor opening identified

Tonight we gave an AI eyes inside a game world.
This commit is contained in:
2025-11-30 20:49:40 -05:00
parent 444c1d12bc
commit 0efb7c7d7b
2 changed files with 40 additions and 2 deletions

View File

@@ -4,7 +4,9 @@
The Araxia MCP Server embeds a Model Context Protocol server directly into the worldserver, enabling AI assistants (like Claude/Cascade) to interact with the game server in real-time.
**Status:** ✅ Phase 1 & 2 Complete (Nov 30, 2025)
**Status:** ✅ Phase 1, 2 & World Scan Complete (Nov 30, 2025)
**Codename:** "Scarlet Vision" 👁️ - The AI can now SEE inside the game world!
## 🎉 What This Enables
@@ -14,6 +16,7 @@ With this integration, the AI assistant can:
- **Read client messages** - Receive data from the WoW client via AMS bridge
- **Write to client** - Send messages that display in the WoW client
- **Debug in real-time** - Direct access to server state while you're playing
- **SEE your surroundings** - LIDAR-style spatial awareness using VMAP data!
## Features
@@ -328,3 +331,37 @@ Client Addon → AMS → Server Lua → Eluna API (bypasses GM check)
- Client: `AMS.Send("HANDLER_NAME", data)` (dot notation, NOT colon!)
- Server: `AMS.Send(player, "HANDLER_NAME", data)`
- Never serialize functions - Smallfolk will error
### VMAP Usage (World Scan)
- Include `VMapFactory.h` AND `VMapManager2.h` for full class definition
- Use `VMAP::VMapManager2*` not `VMAP::IVMapManager*`
- `isInLineOfSight()` returns TRUE if CAN see (no obstacle)
- Binary search for precise wall distance detection
### Database Safety
- Always use `db_describe` before querying unfamiliar tables
- TrinityCore 11.x has different column names than older versions
- Bad SQL can crash the server - wrap in try/catch!
- All DB tools now have exception handling
### CMake Tips
- New source files require `cmake ..` re-run to be detected
- `CollectSourceFiles()` auto-discovers .cpp files in subdirectories
## Session Summary (Nov 30, 2025)
### What We Built Tonight 🚀
1. **Safe SQL Queries** - All database tools wrapped in try/catch
2. **Semantic Screenshots** - `/mcpbridge ui` captures UI state
3. **LIDAR World Scan** - 360° ray casting using VMAP data
4. **Event Bus Design** - Architecture for unified pub/sub system
### First Successful World Scan
```
Location: Scarlet Monastery (2898.6, -802.9, 160.3)
Facing: 77° East-Northeast
Creatures: Scarlet Sentry (23y), Disciple (20y), Augur (22y)
Room: Walls 4-7y behind, corridor opening East
```
The AI can now SEE your surroundings! 👁️

View File

@@ -13,6 +13,7 @@
#include "GameObject.h"
#include "Log.h"
#include "VMapFactory.h"
#include "VMapManager2.h"
#include <cmath>
namespace Araxia
@@ -49,7 +50,7 @@ RayCastResult CastRay(Map* map, float startX, float startY, float startZ,
// Use VMAP for line of sight check
// Note: isInLineOfSight returns true if CAN see (no obstacle)
VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
VMAP::VMapManager2* vmgr = VMAP::VMapFactory::createOrGetVMapManager();
if (vmgr)
{
// Binary search to find collision distance