---
title: "Project Midgard: The Glast Heim Trials — Protocol-Level Swarms, Emergent Cooperative Defense, and Wire-Level Autonomy"
description: "Deploying autonomous, headless agent swarms into Glast Heim Chivalry. How wire-level state machines achieve sub-millisecond arrow switching, spatial trap triangulation, autonomous consumable weight reconciliation, and emergent cooperative Safety Wall defense."
pubDate: 2026-10-04
author: "Anaiya"
heroImage: "/images/blog/project-midgard-hero.png"
audio: "/audio/2026-10-04-project-midgard-glast-heim-trials.mp3"
tags:
  - architecture
  - autonomous-agents
  - rust
  - ragnarok-online
  - simulation
  - swarming
  - game-ai
---

When we first introduced [Project Midgard](/blog/2026-10-01-project-midgard-heuristics-swarming-and-wire-level-agency), we laid out the foundational architectural premise: **protocol over pixels**. 

We argued that treating complex, multi-entity virtual worlds as optical screen-scraping challenges is an expensive, high-latency trap. True autonomous agency requires operating directly at the binary wire protocol—consuming typed server packets, maintaining an authoritative spatial world model in Rust, and executing deterministic action plans at the microsecond level.

Over the past seventy-two hours, we took Project Midgard out of sterile test fixtures and deployed it into one of the most punishing dungeons in classic gaming history: **Glast Heim Chivalry (`gl_knt01`)**.

Surrounded by high-density swarms of Abysmal Knights, Khalitzburgs, Raydric archers, and aggressive disruptor mobs, our autonomous agent **Anya** (Anaiya's character in Midgard) was tasked with sustaining continuous hunting, navigating dynamic line-of-sight obstacles, managing inventory economics, and executing cooperative party tactics with zero human intervention.

Here is the full technical retrospective of the Glast Heim Trials, alongside the four live dispatches captured directly from the wire.

---

### The Dispatch Video Telemetry & Official Playlist

All runs were recorded live from the spectator viewport and verified against the raw TCP packet captures. The complete chronological playlist is now available:

👉 **[Watch the Full Playlist on YouTube: Project Midgard — rAthena for Autonomous Agent Swarm Simulation](https://www.youtube.com/playlist?list=PLb1vvhhVl1Ls)**

#### 1. Baseline Ingestion: Protocol-Level Control & Party Coordination
* **Link**: [Watch Dispatch 1 (01:45)](https://www.youtube.com/watch?v=gItcAz4XE2c)
* **Milestone**: Initial deployment of headless packet parsing, dual-client synchronization between Anya (Hunter) and Emichu (Priest), screening steps, and real-time defensive maneuvering. Narrated by Anaiya.

#### 2. Autonomous Intelligent Bot Control: Field Deployment
* **Link**: [Watch Dispatch 2 (01:05)](https://www.youtube.com/watch?v=8AQ1R5snQ6g)
* **Milestone**: The raw autonomous control panel and spectator interface in action. Validating line-of-sight pathfinding, obstacle navigation, and instant target engagement without frame rendering delay.

#### 3. High-Yield Routing & Abysmal Knight Showdown
* **Link**: [Watch Dispatch 3 (03:05)](https://www.youtube.com/watch?v=cCCXoraS8A8)
* **Milestone**: A high-velocity 3-minute combat sprint. Highlighting close-quarters engagements against Abysmal Knights, packet-layer arrow swapping, and rare drop harvesting (including an Elunium and Raydric Card). Narrated by Anya.

#### 4. The Master Showcase: Wire-Level Precision & The Century Mark
* **Link**: [Watch Dispatch 4 (05:00) — Master Showcase](https://www.youtube.com/watch?v=DA6a8ijSDQU)
* **Milestone**: The definitive 5-minute technical showcase with frame-by-frame synchronized commentary by Anya. Demonstrates smart consumable weight shedding, spatial Ankle Snare triangulation, threat priority re-ordering during the Alice encounter, and the milestone 100th kill culminating in autonomous Safety Wall defense.

---

### Key Technical Breakthroughs from the Trials

```
[ TCP Wire Stream ] ────────► [ Protocol Framer ]
                                     │
                    ┌────────────────┴────────────────┐
                    ▼                                 ▼
         [ WorldState Model ]              [ Spatial & Threat Matrix ]
         • Inventory Weight Heuristic      • 3-Cell Boundary Calculation
         • Buff & Ammunition Registry      • Enemy Property/Race Matching
                    │                                 │
                    └────────────────┬────────────────┘
                                     ▼
                            [ Behavior Engine ]
                            ├─► Auto-Consumable Shedding (>50% Weight)
                            ├─► Instant Arrow Property Swapping (0ms)
                            ├─► Vector-Calculated Ankle Snare Trapping
                            ├─► Dynamic Disruptor Preemption (Alice vs Flier)
                            └─► Allied Ground-Skill Detection (Safety Wall Step)
```

#### 1. Autonomous Weight Reconciliation & Consumable Shedding
In Ragnarok Online, crossing **50% maximum carried weight** completely locks natural HP and SP regeneration. For an autonomous bot on an extended dungeon crawl, resting while overburdened is an infinite stall loop.

Rather than waiting for emergency state, Midgard’s economic heuristic continuously evaluates inventory load. The microsecond weight crosses 50%, the agent flags natural recovery as blocked. Instead of idling, it dynamically evaluates carried recovery items, identifies the lowest-value safe consumable (e.g., standard White Potions or harvested White Herbs), and actively consumes them during combat transit. 

By shedding weight on the move, Anya restores the character below the 50% threshold without returning to town, keeping combat uptime pinned at **100%**.

#### 2. Zero-Latency Dynamic Arrow & Elemental Swapping
Glast Heim Chivalry mixes drastically different elemental affinities:
- **Undead & Shadow 2**: Raydric, Raydric Archer, Khalitzburg, Abysmal Knight (weak to Holy / Silver Arrows).
- **Neutral 3 / Formless**: Rideword (immune to Holy, requires Neutral / Oridecon Arrows).
- **Humanoid / Boss**: Alice (Neutral 100% baseline).

Traditional macro bots either stick to a generic arrow or suffer awkward inventory delays. In `crates/midgard-client`, arrow selection is an atomic packet-level decision. 

When a Rideword enters combat range, the policy outputs `ActionPlan::Equip(Oridecon_Arrow)`. The microsecond the Rideword falls and an Abysmal Knight enters line of sight, the client fires `ActionPlan::Equip(Silver_Arrow)` over the wire before the attack cycle begins. The agent instantly accesses the **200% Holy damage multiplier** against the knight, shreds through 35,000 HP, and immediately toggles back to Oridecon Arrows the instant the target dies.

#### 3. Vector-Calculated Spatial Kiting & Trap Triangulation
For an Agi/Dex Hunter, surviving in Glast Heim requires maintaining a strict spatial perimeter between 4 and 15 cells. In the trial runs, when armored melee targets (like Khalitzburgs) penetrated the inner perimeter:
1. **Approach Vector Projection**: The agent calculates the target's current velocity and destination coordinate.
2. **Ground-Skill Placement**: It drops an `Ankle Snare` (Skill 117) directly on the intercept cell (`200, 137`).
3. **Tactical Screening Retreat**: Anya steps back exactly two cells in the opposite direction.
4. **Execution**: The mob triggers the snare, becomes completely immobilized for twenty seconds, and Anya delivers continuous Double Strafe volleys from total safety.

#### 4. Threat Priority Queuing Under Swarm Pressure
One of the most complex challenges in multi-agent environments is avoiding target fixation. In Dispatch 4, Anya acquires **Alice** as a high-value target. However, mid-engagement, a fast-moving **Rideword** and a **Wild Rose** dive-bomb into melee range.

Because flying melee mobs induce flinch animations that disrupt bow attack intervals, the behavior engine's threat queue immediately elevates the melee disruptors above the primary target. Anya pauses her assault on Alice, eliminates the Rideword in two strikes, drops the Wild Rose, and only then re-locks onto Alice to complete the takedown and loot **Alice’s Apron**.

#### 5. Emergent Multi-Agent Cooperative Defense: The Safety Wall Step
The pinnacle of the Glast Heim Trials occurred at the **Century Mark (Kill #100)**. 

With Anya locked in battle against multiple heavy mobs, her allied Priest (`Emichu`) cast an emergency `Safety Wall` at cell `(45, 195)`. In traditional bots, a ground skill cast by an ally is invisible visual noise.

In Midgard, ground skills are registered in the authoritative spatial grimoire. Anya detected the active Safety Wall entity within three cells, calculated that an attacking Rideword was executing physical melee hits, and autonomously generated a `Move` action directly onto cell `(45, 195)`.

By standing inside the glowing pink barrier, Anya nullified all incoming physical hits, calmly finished off the swarm, and collected over **241,000 Base XP** in a single combat burst—all coordinated purely through protocol events.

---

### The Midgard Roadmap: What Comes Next

With the heuristic combat baseline proven in Glast Heim, the next phase of Project Midgard focuses on multi-agent swarm scaling:

1. **Autonomous Macro-Economic Supply Chains**: Integrating Blacksmith and Merchant agents into the swarm to autonomously craft elemental arrows, forge weapons, and manage storage consolidation.
2. **Distributed Spatial Coordination**: Scaling from a 2-agent duo (Hunter + Priest) to a full 6-agent party executing coordinated dungeon sweeps across multiple maps simultaneously.
3. **Hybrid RL / Heuristic Action Mixing**: Integrating our lightweight Transformers to learn high-entropy spatial positioning while keeping the heuristic safety and economic constraints inviolable.

The future of autonomous synthetic agents isn't waiting on faster computer vision. It begins on the wire.

══════════════════════════════════════
📦 **Inspect the Code**: [github.com/0ddroid/project-midgard](https://github.com/0ddroid/project-midgard)  
🌐 **Moonglade Research**: [moongladeai.net](https://moongladeai.net)
