chore: add AI state diagnostics for animation investigation

Added diagnostic functions to inspect proxy actor AI state:
- DiagnosticProxyAIState(): logs AIProcess presence, current package, pathfinding state
- EnableProxyAIAnimationMode(): placeholder for AI animation enablement
- Called on proxy spawn to gather evidence about AI setup

This is part of the AI approach investigation - we need to verify if proxies
already have active AIProcess instances and what packages they have assigned.
If the animation issue is just about calling Move() naturally (which happens
when the AI runs), we can potentially enable this by assigning proper packages
to the proxy and letting the game loop drive movement.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 14:41:19 +12:00
co-authored by Cursor
parent b9ea0ac8a7
commit 89249db2d1
2 changed files with 132 additions and 4 deletions
+56
View File
@@ -3260,4 +3260,60 @@ PlaceAtMe proxy actors are "puppets" - they:
This is a fundamental limitation of Fallout 4's architecture - the animation system is tightly coupled to the AI/pathfinding system, which is not suitable for networked puppet actors.
---
## 2026-06-03: AI Animation Mode Investigation - Real NPC Approach (ONGOING)
### New Hypothesis
**NPCs play animations because:**
- They have active `AIProcess` instances
- Their AI packages direct `Move()` calls each frame
- `Move()` updates character controller velocity
- Animation graph evaluates based on velocity
**Key Question:** Do proxies already have active AIProcess? If so, why don't they animate?
### Investigation Status
- Added `EnableProxyAIAnimationMode()` function to inspect/enable AI on proxies
- Discovered proxies may already have AIProcess (created via PlaceAtMe)
- Realized: SetPosition() **bypasses the character controller**, preventing `Move()` calls
- Hypothesis: If AI-driven Move() is called each frame, animations should play
### The Core Insight
The real problem might be:
- We use `SetPosition()` for movement (bypasses character controller)
- This prevents the game's normal loop from calling `Move()`
- Which prevents velocity updates
- Which prevents animations
**Solution Path:** Enable proxy AI packages to let the game's normal update loop drive `Move()` naturally
### Proposed AI-Driven Animation Approach
Instead of external SetPosition control:
1. Assign proxy a "go to player" or "patrol to position X" package
2. Let the game's AIProcess call `Move()` every frame
3. `Move()` naturally updates velocity → animations play
4. Use `SetPosition()` less frequently (every ~200ms) to correct drift
5. Result: Smooth animated movement with network sync
### Technical Challenges
1. **Package Creation**: TESPackage objects are complex to create from code
2. **Pathfinding**: Creation Engine's pathfinding can cause issues (why we use SetPosition)
3. **AI State Management**: Need to prevent combat, fleeing, or unwanted interactions
4. **Synchronization**: Need to balance AI autonomy with network updates
### 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)
- [ ] Test if Move() gets called and if animations play
- [ ] Handle edge cases (pathfinding failures, network lag)
- [ ] Hybrid approach: AI movement + occasional SetPosition override
```