# Engine Integration

#### 🧰 Integration Summary

| Engine        | Language | SDK Path           | Notes                         |
| ------------- | -------- | ------------------ | ----------------------------- |
| Unity         | C#       | `bindings/unity/`  | Built with async support      |
| Unreal Engine | C++      | `bindings/unreal/` | C++ classes + Blueprint-ready |
| WebAssembly   | Rust     | `src/wasm.rs`      | Run NPCs in the browser       |
| Native Rust   | Rust     | CLI or game loop   | No engine required            |

***

#### 🕹️ Unity Integration

**Steps to integrate:**

1. Import the `OxydeUnity.cs` binding script.
2. Attach the `OxydeAgent` component to any game object.
3. Use `OxydeAgent.SendInput(string)` to send messages to the agent.
4. Subscribe to `.OnResponse` to handle LLM replies in dialogue UI.

**Example:**

```csharp
OxydeAgent agent = GetComponent<OxydeAgent>();
agent.SendInput("Hello there!");
```

* Emotion and memory are updated automatically.
* You can override agent config at runtime via C#.

***

#### 🧠 Unreal Engine Integration

**Setup:**

1. Include `OxydeUnreal.h` and `OxydeUnreal.cpp` in your project.
2. Use `UOxy`
3. `deAgentComponent` on any `AActor`.
4. Call `SendInput(FString Message)` to prompt the agent.
5. Bind to `OnResponseReceived` for callbacks.

**Blueprint Ready:** The plugin exposes input/output bindings via UFUNCTIONs and delegates.

***

#### 🌐 WebAssembly Integration

**For browser-based NPCs:**

1. Compile with `wasm32-unknown-unknown` target
2. Interface with `oxyde::Agent::new(...)` in JS/WASM
3. Use a web runtime to asynchronously query models or pre-baked prompts

> Great for visual novels, chatbots, or WebGL RPGs.

***

#### 🖥️ Native Rust

Use `agent.rs`, `main.rs`, and `cli.rs` to drive standalone agents in:

* Command line interfaces
* Dedicated servers
* Networked multiplayer backends
* Scripting-heavy worlds like Godot (via FFI)

***

#### 🧩 Engine Choice Guide

| Goal                                 | Recommended Engine |
| ------------------------------------ | ------------------ |
| 3D open-world RPG                    | Unreal             |
| Dialogue-driven simulation           | Unity              |
| Browser-based experiences            | WebAssembly        |
| Server-side brain w/ networked world | Native Rust        |

***

#### 🔗 Related Pages

* 7\. Advanced Topics → CLI, Voice, DB
* Examples → `rpg_demo`
