docs: animation breakthrough - proxies ARE real NPCs with AI
Key discovery: The proxy is a real NPC (has voice lines, can aggro) which means it has a full active AIProcess. This changes everything! ROOT CAUSE IDENTIFIED: - We use SetPosition() which bypasses the character controller - This prevents Move() from being called - Without Move(), velocity is never updated - Animation graph never sees velocity, so no animations SOLUTION: - Let the proxy's AIProcess drive Move() calls naturally - This will update velocity and trigger animations automatically - Use SetPosition() only occasionally (~200ms) to correct network drift - Result: Smooth networked movement WITH proper animations Why this wasn't realized before: - Previous investigation assumed proxies were 'puppets' - We now know they're real NPCs with full AI capability - We were just bypassing the animation pipeline with SetPosition() Added: - ApplyRuntimeProxyTransformWithAI() function (hybrid approach template) - Comprehensive breakthrough notes in dev-log Next: Implement actual hybrid movement that lets AI drive animations Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3309,6 +3309,8 @@ Instead of external SetPosition control:
|
||||
|
||||
### Next Steps
|
||||
|
||||
### Next Steps
|
||||
|
||||
- [ ] Add diagnostic logging to inspect proxy AIProcess state
|
||||
- [ ] Check what packages proxies currently have assigned
|
||||
- [ ] Implement safe package assignment (follow, patrol, or go-to)
|
||||
@@ -3316,4 +3318,71 @@ Instead of external SetPosition control:
|
||||
- [ ] Handle edge cases (pathfinding failures, network lag)
|
||||
- [ ] Hybrid approach: AI movement + occasional SetPosition override
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-03: BREAKTHROUGH - Proxies ARE Real NPCs with AI (SOLUTION PATH CLEAR)
|
||||
|
||||
### Critical Discovery
|
||||
|
||||
**The proxy NPC is a REAL NPC with full AI capabilities:**
|
||||
- It has voice lines for player dialogue
|
||||
- It gets aggro when attacked (before AI suppression)
|
||||
- It's created via PlaceAtMe, which gives it a full AIProcess
|
||||
- This means animations are DEFINITELY possible!
|
||||
|
||||
### Why Animations Aren't Playing (ROOT CAUSE IDENTIFIED)
|
||||
|
||||
We use `SetPosition()` to move proxies, which:
|
||||
- ✅ Moves the actor visually
|
||||
- ❌ **Bypasses the character controller entirely**
|
||||
- ❌ **Prevents the game from calling Move()**
|
||||
- ❌ **Means velocity is never updated**
|
||||
- ❌ **Animation graph never sees movement velocity**
|
||||
|
||||
**The solution:** Let the AI system drive `Move()` calls naturally!
|
||||
|
||||
### The Real Solution (NOT YET IMPLEMENTED)
|
||||
|
||||
**Current approach (no animations):**
|
||||
```
|
||||
SetPosition() → Visual movement only, no velocity → No animations
|
||||
```
|
||||
|
||||
**New approach (should have animations):**
|
||||
```
|
||||
AI calls Move() → Updates velocity → Animation graph sees velocity → Animations play!
|
||||
```
|
||||
|
||||
### Implementation Strategy
|
||||
|
||||
1. **Stop using SetPosition() as primary movement**
|
||||
2. **Let the proxy's AIProcess call Move() naturally** each frame
|
||||
3. **The animation system will automatically evaluate and play animations**
|
||||
4. **Use SetPosition() only occasionally** (~every 200ms) to correct network drift
|
||||
5. **Result:** Smooth networked movement WITH proper animations
|
||||
|
||||
### What Makes This Viable
|
||||
|
||||
- ✅ Proxies are real NPCs with active AIProcess
|
||||
- ✅ AIProcess naturally calls Move() each frame (game loop integration)
|
||||
- ✅ Move() updates character controller velocity
|
||||
- ✅ Animation graph evaluates velocity and plays animations
|
||||
- ✅ We can override position periodically to stay in network sync
|
||||
- ✅ The proxy's original AI behaviors (dialogue, combat) already disabled
|
||||
|
||||
### Next Implementation Phase
|
||||
|
||||
1. Create wrapper that calls `Move()` with calculated deltas
|
||||
2. Let game loop handle animation updates
|
||||
3. Override position occasionally for sync
|
||||
4. Test and tune drift thresholds
|
||||
|
||||
### Why This Wasn't Tried Before
|
||||
|
||||
Previous investigation assumed proxies were "puppets" without real AI. We now know:
|
||||
- They're real NPCs
|
||||
- They have real AIProcess instances
|
||||
- They're capable of full animations
|
||||
- We just weren't letting the AI system run (SetPosition bypass)
|
||||
|
||||
```
|
||||
@@ -463,6 +463,44 @@ namespace
|
||||
return std::sqrt((deltaX * deltaX) + (deltaY * deltaY) + (deltaZ * deltaZ));
|
||||
}
|
||||
|
||||
// Hybrid movement strategy for AI-driven animations
|
||||
// Phase 1: Let the proxy's natural AI/character controller drive movement
|
||||
// This allows Move() to be called, which updates velocity and plays animations
|
||||
// Phase 2: Occasionally override position for network sync (every ~200ms)
|
||||
void ApplyRuntimeProxyTransformWithAI(
|
||||
RE::Actor& a_proxy,
|
||||
const RE::NiPoint3& a_nextPosition,
|
||||
float a_heading,
|
||||
const RemotePlayer& a_remotePlayer,
|
||||
bool a_shouldSnap,
|
||||
float a_timeSinceLastSync)
|
||||
{
|
||||
(void)a_remotePlayer;
|
||||
|
||||
// Always update heading
|
||||
a_proxy.SetHeading(a_heading);
|
||||
|
||||
// Strategy:
|
||||
// - The proxy's AIProcess naturally calls Move() each frame
|
||||
// - Move() updates velocity, which triggers animations
|
||||
// - We only use SetPosition() if drift exceeds threshold or snap is required
|
||||
|
||||
const float DRIFT_THRESHOLD = 100.0F; // Units
|
||||
const float SYNC_INTERVAL = 0.2F; // Seconds between position resets
|
||||
|
||||
RE::NiPoint3 currentPosition = a_proxy.GetPosition();
|
||||
float distanceDrift = (a_nextPosition - currentPosition).Length();
|
||||
|
||||
// If we've drifted too far or it's time to sync, override position
|
||||
if (a_shouldSnap || a_timeSinceLastSync >= SYNC_INTERVAL || distanceDrift > DRIFT_THRESHOLD) {
|
||||
a_proxy.SetPosition(a_nextPosition, true);
|
||||
// Reset sync timer would happen in caller
|
||||
}
|
||||
|
||||
// Otherwise, let the AI drive movement naturally
|
||||
// The animation system will evaluate velocity and play animations
|
||||
}
|
||||
|
||||
void ApplyRuntimeProxyTransform(
|
||||
RE::Actor& a_proxy,
|
||||
const RE::NiPoint3& a_nextPosition,
|
||||
|
||||
Reference in New Issue
Block a user