# Adding Generative AI Features to Games

> Source: https://aiwiki.ai/wiki/adding_generative_ai_features_to_games
> Updated: 2026-10-30
> Fact-checked: 2026-10-30
> Categories: AI in Gaming, Developer Tools, Generative AI, Software Development
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) - attribute to "AI Wiki (aiwiki.ai)"
> Cite as: AI Wiki. "Adding Generative AI Features to Games." aiwiki.ai, 30 Oct 2026. https://aiwiki.ai/wiki/adding_generative_ai_features_to_games
> From AI Wiki (https://aiwiki.ai), the free encyclopedia of artificial intelligence. Reuse freely with attribution.

**Adding generative AI features to games** means shipping a game in which a [generative AI](https://aiwiki.ai/wiki/generative_ai) model runs while people play: a non-player character (NPC) that answers free-form speech or text, generated quest or flavor text, a voiced companion that takes orders, or an assistant that explains the game's systems. This is a different job from using AI to build the game. A coding assistant or asset generator is finished once the build exists; a runtime model becomes a live dependency with its own response time, cost per interaction, failure modes, moderation duties and store disclosure. Valve's Steamworks documentation draws the same line: it defines "Live-Generated" content as "Any kind of content created with the help of AI tools while the game is running" and asks developers to describe their guardrails.[1]

The central design rule is that the model proposes and game code decides: the model writes a line or picks from a list of allowed actions, and the engine checks and applies it. Product names, prices, rate limits and model lists below come from vendor documentation checked on 30 October 2026 and change often; vendor statements about their own products are attributed. Tools for building the game are covered in [Developing Games with AI](https://aiwiki.ai/wiki/developing_games_with_ai) and its engine guides, and the history of conversational characters is in [AI in gaming](https://aiwiki.ai/wiki/ai_in_gaming).

*Part of the [Developing Games with AI](https://aiwiki.ai/wiki/developing_games_with_ai) series. Previous: [Game assets](https://aiwiki.ai/wiki/creating_game_assets_with_ai). Next: [Testing and release](https://aiwiki.ai/wiki/testing_and_releasing_ai_assisted_games).*

> **At a glance**
>
> - **For:** developers who want a model to run during play, for NPC dialogue, generated text, voice or a player-facing assistant
> - **You need:** a working game, a model provider account or an on-device runtime, and a server you control if the model is in the cloud
> - **You will end with:** a design in which the model proposes, game code validates and applies, and every failure has an authored fallback
>
> **Steps:** 1. [Decide whether a model is needed](#when-a-runtime-model-is-worth-it) 2. [Pick cloud, on-device or hybrid](#choose-where-the-model-runs) 3. [Build the safe request loop](#a-minimal-safe-design) 4. [Ground the character in game facts](#prompts-grounding-and-memory) 5. [Budget latency and cost](#latency-and-cost) 6. [Add moderation and test failures](#safety-and-moderation) 7. [Disclose it to stores and players](#disclosure-and-platform-rules)

## When a runtime model is worth it

A runtime model earns its cost when players need responses that cannot be written in advance: open-ended questions to a character, spoken orders to a companion, or text that reacts to a game state nobody scripted. It is a poor fit when inputs or outputs form a small set. OpenAI's latency guide advises developers not to "default to an LLM": highly constrained outputs such as confirmations and refusals can be hard-coded, and when inputs are constrained, responses can be generated in advance.[2] Much of what players call enemy AI is conventional game AI that needs no generative model; see the hub's [comparison of development tools, pre-generated content and runtime generation](https://aiwiki.ai/wiki/developing_games_with_ai#separate-development-tools-from-runtime-ai).

This guide's summary of where a model changes the design, and what to try first:

| Feature | What a runtime model adds | Try first |
| --- | --- | --- |
| Conversational NPC | Replies to questions the writers did not anticipate | Branching dialogue with many authored lines |
| Companion that takes voice orders | Maps free speech to game actions | A fixed command set or a radial menu |
| Generated quests, item text, barks | Variety tied to the current state | Templates, or text generated and reviewed before release (see the [asset guide](https://aiwiki.ai/wiki/creating_game_assets_with_ai)) |
| Player-facing help | Answers about the rules in the player's own words | Tooltips and a searchable manual |
| Character behavior choices | A choice among actions from a text description of the situation | Behavior trees, utility AI or planners |

## Choose where the model runs

There are three basic placements: a cloud API called from a server you run, inference on the player's hardware, or a model hosted by a platform or middleware vendor. Hybrid designs combine them. NVIDIA's description of ACE autonomous game characters uses a [small language model](https://aiwiki.ai/wiki/small_language_model) for frequent decisions and says agents can "reach out to larger models that can provide a higher level, lower frequency strategy", often a cloud LLM API.[3]

| Option | Where inference runs | Per-use cost | Main constraints | Examples |
| --- | --- | --- | --- | --- |
| Cloud API via your server | Provider's data centers | Per token, character or audio minute | Network round trip, rate limits, outages, model changes | Commercial model APIs |
| Platform-managed | The platform's servers | Set by the platform | Platform rules and limits; little control of the model | Roblox TextGenerator, Fortnite conversations |
| Middleware | Vendor cloud, on-device or both | Vendor plan | Vendor SDK, pricing and roadmap | NVIDIA ACE, [Inworld](https://aiwiki.ai/wiki/inworld_ai), Convai |
| On-device | Player's CPU, GPU or NPU | None per request | Download size, memory, hardware floor, shares the GPU with rendering | [llama.cpp](https://aiwiki.ai/wiki/llama_cpp), ONNX Runtime, Sentis, NNE, NVIGI, Apple Foundation Models |
| Hybrid | Both | Mixed | Two code paths to test | NVIDIA's ACE design notes |

### Keep provider keys off the player's device

Anything shipped in a client can be extracted. OpenAI's help center says "Never deploy your key in client-side environments like browsers or mobile apps" and that "Requests should always be routed through your own backend server where you can keep your API key secure."[4] Inworld's security guide applies this to "game builds", says TLS does not protect a key stored in the app, and documents two safe patterns: proxy every request through your backend, or have the backend authenticate the player and mint a token so latency-sensitive audio can connect directly: a single-use one-time token (15 minutes by default) where possible, or a multi-use session token, which Inworld marks deprecated but still requires for Realtime sessions.[5] Convai says its Unity SDK's API Key mode "is for local development, not for a build you distribute", because the key ships "obfuscated but not encrypted", and tells developers to switch to Auth Token mode before shipping.[6]

The same reasoning covers the [system prompt](https://aiwiki.ai/wiki/system_prompt): the OWASP GenAI Security Project says it "should not be considered a secret, nor should it be used as a security control".[7] Your server is also where per-player authentication, quotas, logging and moderation live.

### On-device inference

Running the model on the player's machine removes the per-request bill and the network round trip and can work offline. The costs move to download size, memory and GPU requirements, a smaller model, and more hardware to test.

| Runtime | What its documentation says |
| --- | --- |
| llama.cpp | MIT-licensed C/C++ inference with 1.5-bit to 8-bit quantization and an OpenAI-compatible server; GBNF grammars and JSON-schema conversion constrain output[8][9] |
| ONNX Runtime | A "cross-platform machine-learning model accelerator" with mobile and web targets; its generate() API "is in preview and is subject to change"; Microsoft warns that a malicious model can consume excessive memory or compute[10][11] |
| Unity Sentis | Runs [ONNX](https://aiwiki.ai/wiki/onnx), LiteRT and exported PyTorch models on all Unity runtime platforms; in Sentis 2.4 the package display name changed from Inference Engine to Sentis (see [Developing Unity Games with AI](https://aiwiki.ai/wiki/developing_unity_games_with_ai))[12] |
| Unreal Engine NNE | "A common API to access different neural network runtimes"; Epic labels it Beta and says to "use caution when shipping with it" (see [Developing Unreal Engine Games with AI](https://aiwiki.ai/wiki/developing_unreal_engine_games_with_ai))[13] |
| NVIDIA In-Game Inferencing (NVIGI) | In-process C++ execution through TensorRT, ONNX Runtime, llama.cpp or a custom executor, with "CUDA in Graphics" so AI and rendering run together; plugins for models including Nemotron 3 Nano 4B and [Qwen3.5](https://aiwiki.ai/wiki/qwen3_5) 4B and 8B[14] |
| Apple [Foundation Models](https://aiwiki.ai/wiki/apple_foundation_models) | On-device models from iOS, iPadOS, macOS and visionOS 26 and watchOS 27, and Private Cloud Compute models from the 27 releases; Apple lists "dialog for games" among on-device tasks; needs "a device that supports Apple Intelligence"; `@Generable` guided generation uses constrained sampling[15][16] |

Two limits matter more in games than elsewhere. A local model competes with rendering: NVIDIA writes that local small-model agents "can make excessive calls to the GPU that compete with graphics" and that inference calls "must take a fraction of the total frame time"; its NVIGI 1.5 sample cuts calls by having the model write one sandboxed Lua program instead of chaining tool calls.[17] And a hardware floor decides who gets the feature: NVIDIA said inZOI's Smart Zoi used a 0.5-billion-parameter [Minitron](https://aiwiki.ai/wiki/minitron) model "GPU-accelerated exclusively on GeForce RTX GPUs".[18] Plan a complete experience for players below the floor (advice).

### Middleware and platform services

**NVIDIA ACE.** NVIDIA describes ACE as "a suite of AI technologies designed to help middleware and game developers build knowledgeable, actionable, and conversational in-game characters". Its developer page offers MIT-licensed Unreal Engine 5 plugins for speech recognition, text-to-speech, Audio2Face-3D and an LLM plugin for "local, low-latency text generation and function calling", plus a C/C++ Game Agent SDK in beta with Agent, Chat and RAG APIs.[19]

**Inworld.** [Inworld AI](https://aiwiki.ai/wiki/inworld_ai) now presents itself as a provider of text-to-speech, speech-to-text and speech-to-speech models and an inference service "built for consumer applications", with "Games and media" as one market.[20] It says the legacy Character Studio "has been retired" and that its capabilities, including knowledge retrieval, safety checks and long-term memory, moved to the Inworld Agent Runtime, which has Character templates for Unity and Unreal Engine.[21] Its On-Demand (pay-as-you-go) plan lists TTS-2 at $25 per million characters, TTS-2 Flash at $15 and STT 1 at $0.15 per hour, with lower speech rates on paid monthly plans.[22]

**Convai.** Convai documents a Unity SDK for AI characters with speech, emotion, actions and persistent memory, and a Knowledge Bank with retrieval.[23] Its Guardrails tab, on paid plans only, accepts safety rules of up to 7,500 words.[24] It warns that its Actions Contract "is prompt text, not executable client code" and that a parsed action "does not confirm that your client executed it".[25]

**Roblox.** `TextGenerator` "lets you use a large language model (LLM) to generate text based on a system prompt from you and a user prompt from the player"; Roblox names interactive NPCs as the most common use. Requests "are initially limited to 100 per minute", scaling with concurrent users; a `ContextToken` carries a summary of earlier turns, and the request table accepts a `JsonSchema` key.[26] Developers are "responsible for filtering any displayed text that you don't have explicit control over".[27]

**Fortnite (UEFN).** Epic's "conversations" combine a `persona_component` with a Persona Modifier. Epic says it uses "Google's Gemini 3.1 Flash-Lite models" to process audio and generate text and "ElevenLabs' Eleven v3" for voice, with "safety layers and filters on top of the model", English only.[28] Epic announced that conversations would exit Experimental, and become publishable, on 30 July 2026, and said it "may introduce rate limiting systems over time".[29]

## A minimal safe design

The loop below is this guide's recommendation, assembled from the guidance cited at each step. It applies to cloud and on-device models alike, except that an on-device model has no key to protect.

![Flow diagram: player input goes to the developer's game server and an input check; flagged input goes to an authored fallback line, other input goes to a cloud or on-device model whose structured reply is validated and moderated before the game applies it or falls back.](/images/game-guide-genai-7d54ed216db4.svg)

*This guide's recommended runtime loop: provider keys stay on your server, the model only proposes a structured reply, and game code validates it, applies it or plays an authored fallback line.*

1. **Accept bounded input.** Cap message length and requests per player. OpenAI says limiting user input "helps avoid prompt injection" and that validated dropdown fields "can be more secure than allowing open-ended text inputs".[30]
2. **Send it to your server.** The server authenticates the player, applies quotas and holds the keys.[4]
3. **Check the input.** Run moderation or a classifier. OpenAI suggests starting input moderation and generation together and cancelling the generation if moderation fails.[2]
4. **Build the prompt from game data.** Character sheet and rules first, then facts this character may know, recent conversation, and the player's line.
5. **Request structured output.** A line of dialogue plus at most one action from a fixed list. OpenAI's Structured Outputs and Anthropic's [structured output](https://aiwiki.ai/wiki/structured_output) feature constrain a response to a JSON Schema; [llama.cpp](https://aiwiki.ai/wiki/llama_cpp) grammars and Apple's guided generation do the same locally.[31][32][9][16]
6. **Validate against game rules.** Check that referenced items, quests and characters exist and that the action is legal now; game code applies it.
7. **Moderate the output, then show it or fall back.** On a refusal, timeout, error, invalid action or flagged reply, play an authored line and leave game state unchanged.

An illustrative response schema for step 5 (plain JSON Schema; each provider supports its own subset, so check its documentation):[31][32]

```json
{
  "type": "object",
  "properties": {
    "say": { "type": "string" },
    "mood": { "type": "string", "enum": ["neutral", "friendly", "wary", "angry"] },
    "action": { "type": "string", "enum": ["none", "offer_shop", "give_hint", "end_conversation"] }
  },
  "required": ["say", "mood", "action"],
  "additionalProperties": false
}
```

Game code, not the model, picks which hint to give when `action` is `give_hint`, and rejects an over-long `say` before display. A model that cannot name an item cannot hand one out.

### Let the game own the state

A schema fixes the format, not the meaning. OpenAI says Structured Outputs "can still contain mistakes" and that input unrelated to the schema "can result in hallucinations".[31] llama.cpp notes that a JSON schema used as a grammar "is not injected into the prompt", so the prompt must describe it.[9] OWASP's advice on output handling is to "Treat the model as any other user, adopting a zero-trust approach".[33] NVIDIA's ACE notes take the same view: "Given the finite actions that can be taken in the game, the SLM can choose the best appropriate action".[3]

Research and shipped games both argue for this. In an ACL 2024 benchmark, Wang and colleagues found GPT-4 "still an unreliable world simulator", with accuracy no higher than 59.9% on transitions involving a non-trivial change in world state.[34] In NetEase's Where Winds Meet, convincing certain AI-chat NPCs turns them into friends who send weekly gifts; Notebookcheck reported that a player finished a quest about two missing brothers by typing "(Suddenly, her two brothers appear)", which the NPC accepted, and AUTOMATON described a trick of repeating the NPC's own words back as a question.[35][36] Code that checks whether the brothers were found would reject the claim.

### Plan the fallback

Every call can be slow, refused, rate-limited or invalid. OpenAI documents `429` responses for rate limits with an optional `Retry-After` header, `503` for model overload, and a hard spend limit that makes requests return `429`, and recommends backoff with a small random delay.[37] Its structured-output guide lists refusals and responses cut off by the token limit as cases to handle.[31] Roblox's sample wraps `GenerateTextAsync` in `pcall`.[26]

This guide's advice: write fallback lines in the character's voice, set a timeout short enough that the player is not left waiting, and make sure a retried request cannot grant a reward twice, a check that [Testing and Releasing AI-Assisted Games](https://aiwiki.ai/wiki/testing_and_releasing_ai_assisted_games) lists for runtime services. An NPC that falls back to authored dialogue during an outage beats a quest that cannot be finished.

## Prompts, grounding and memory

Epic's persona guide recommends "a clear identity, values, and traits", prompts divided "into modular sections", descriptions that are "short, specific, and relevant", and dialogue examples; its samples include constraints such as limiting a response to ten words.[38] The narrative director of Ubisoft's Teammates project described writing "these kinds of fences that let NPCs improvise within the world but stay within the boundaries of the lore and motivations we have given them".[39]

**Grounding.** Give each character only what it should know: its background, the relevant quest flags and what it can perceive now. A model handed the whole save file can leak spoilers, and every extra token costs money (advice). For long lore, [retrieval-augmented generation](https://aiwiki.ai/wiki/retrieval_augmented_generation) is the usual pattern; Convai's Knowledge Bank supports it, and NVIDIA says developers can run its embedding model "within the game process" through NVIGI.[23][3]

**Memory.** Park and colleagues' generative agents store "a complete record of the agent's experiences using natural language", synthesize reflections and retrieve memories to plan; their ablation found that observation, planning and reflection each contributed to believability.[40] Shipping systems are lighter: Roblox returns a `ContextToken` "containing a summarization" of earlier turns, and Fortnite's LLM session "clears after each round".[26][38] Keep promises, relationships and quest progress as game data and pass the model a short summary (advice).

**Prompt order.** OpenAI's caching guide says to "Keep the prefix stable": stable instructions and shared material first, user-specific content at the end.[41] A character sheet, then the latest game state, then the player's line fits that order.

**Constraint trade-offs.** In a 10-person study of a voice-based detective game, Figueiredo and Elumeze found no reliable experiential difference between high- and low-constraint prompts; in a follow-up synthetic evaluation, a JSON and retrieval scaffold made the quest-giver more stable but cost the suspects "improvisational believability".[42] Tighter prompts are not automatically better.

## Latency and cost

### Latency

OpenAI's latency guide says generating tokens "is almost always the highest latency step", so "cutting 50% of your output tokens may cut ~50% of your latency", while halving the prompt may improve latency by only 1 to 5 percent. It calls streaming "the single most effective approach" to reducing perceived waiting and recommends fewer sequential requests and parallel steps.[2] In practice: ask for short replies, stream text to the screen or speech synthesizer, and use the smallest model that passes your tests.

Streaming complicates moderation: OpenAI notes that "partial completions may be more difficult to evaluate" and that moderation scores requested with a generation arrive after the full output.[43] Its latency guide suggests streaming to your back end and forwarding processed chunks.[2] KRAFTON separates fast and slow decisions: PUBG Ally reacts "with minimal latency" for actions such as movement and item collection, while strategy draws on context and conversation.[44]

### Cost

For a cloud model, estimate units per interaction (tokens, characters of speech, audio minutes) times interactions per session times sessions times price, then add retries and supporting calls; the [hub's token example](https://aiwiki.ai/wiki/developing_games_with_ai#if-the-game-uses-a-model-during-play) shows the arithmetic in symbols. Steam's FAQ covers Live-Generated services with "ongoing costs for each input/output": the developer manages access and collects payment through a Steam-supported method, such as the base price, microtransactions, a subscription or a DLC.[1]

The following arithmetic is illustrative. It assumes one player-hour with 30 exchanges with a voiced NPC, using list prices on 30 October 2026 for [Claude Haiku 5.5](https://aiwiki.ai/wiki/claude_haiku_5_5) and Inworld's On-Demand speech rates; the request sizes are assumptions.

| Component | Assumption | Listed price | Cost |
| --- | --- | --- | --- |
| Text input | 30 requests of 1,500 tokens = 45,000 tokens | $0.10 per million input tokens (prompts up to 100,000 tokens)[45] | $0.0045 |
| Text output | 30 replies of 100 tokens = 3,000 tokens | $0.50 per million output tokens[45] | $0.0015 |
| Speech output | 30 replies of 300 characters = 9,000 characters | TTS-2 Flash, $15 per million characters[22] | $0.135 |
| Speech input | 10 minutes of player speech | STT 1, $0.15 per hour[22] | $0.025 |
| **Total** | | | **about $0.17 per player-hour** |

At that rate 10,000 player-hours cost about $1,660, and voice costs far more than text. The figures leave out retries, hosting, plan fees and moderation (OpenAI's moderation endpoint is free).[46] Anthropic says the tokenizer of Claude 4.7 and later models "produces approximately 30% more tokens for the same text", so measure your own prompts.[45] [Prompt caching](https://aiwiki.ai/wiki/prompt_caching) cuts the cost of a repeated character sheet: OpenAI says cached input is "discounted up to 95%", and Anthropic lists Claude Haiku 5.5 cache hits at $0.01 per million tokens.[41][45]

Uncapped usage is also a security problem. OWASP's "Unbounded Consumption" entry describes "Denial of Wallet" attacks that exploit "the cost-per-use model of cloud-based AI services" and recommends rate limiting, user quotas, timeouts and throttling.[47] Set per-player quotas and a provider spend limit, and decide what players see when either is reached (advice).

## Safety and moderation

No single filter catches everything. In May 2025 Epic added a voice-interactive Darth Vader to Fortnite built on [Gemini 2.0 Flash](https://aiwiki.ai/wiki/gemini_2_0_flash) and [ElevenLabs](https://aiwiki.ai/wiki/elevenlabs) Flash v2.5; players soon had it making offensive statements, including slurs, and Epic deployed a hotfix.[48] An Epic spokesperson told Decrypt the feature had three layers of safety filters but "our filters did not catch a specific variation of an expletive".[49] Layers reduce failures; monitoring, player reports and fast fixes handle the rest.

| Tool | Documented scope |
| --- | --- |
| [OpenAI Moderation API](https://aiwiki.ai/wiki/moderation_api) | `omni-moderation-latest` classifies text and images, not audio, in categories including harassment, hate, self-harm, sexual content and violence; free to use[46] |
| Azure AI Content Safety | Text and image analysis "with multi-severity levels", Prompt Shields for "User input attack" detection, custom blocklists; several preview features retire on 30 April 2027[50] |
| A classifier prompt | Anthropic suggests a "harmlessness screen" in which a lightweight model such as Claude Haiku 5.5 pre-screens user input[51] |
| Platform filters | Roblox's `TextService:FilterStringAsync()`; Fortnite's safety layers, which direct a player who expresses thoughts of self-harm to seek professional help[27][28] |

Set thresholds for the game's audience and rating: an NPC in a war game will talk about violence (advice).

### Prompt injection from players

Players will try to break characters, for fun or for rewards. OWASP's entry on [prompt injection](https://aiwiki.ai/wiki/prompt_injection) says "it is unclear if there are fool-proof methods of prevention" and lists mitigations including validating output formats with deterministic code, filtering input and output, handling functions "in code rather than providing them to the model", human approval for high-risk actions, segregating untrusted content and adversarial testing.[52] In a game, least privilege and output validation do most of the work: if the model can only choose `give_hint`, a successful injection produces strange dialogue, not free items. In multiplayer, text written by other players (chat, signs, item names) that reaches a model is untrusted too; OWASP calls instructions hidden in external content [indirect prompt injection](https://aiwiki.ai/wiki/indirect_prompt_injection).[52]

### Players under 18

OpenAI's under-18 guidance cites laws including COPPA, says not to process personal data of children under 13 (or the local age of digital consent) "without first implementing zero data retention", and lists age-appropriate filters and "monitoring and reporting mechanisms".[53] Epic gates Fortnite's LLM characters behind a parental control "to allow voice and written communication with AI Features".[28] California's [SB 243](https://aiwiki.ai/wiki/california_sb_243), approved on 13 October 2025, regulates companion chatbots but excludes "A bot that is a feature of a video game and is limited to replies related to the video game" that cannot discuss mental health, self-harm or sexually explicit conduct "or maintain a dialogue on other topics unrelated to the video game".[54] Keeping an NPC on topic is therefore partly a legal question; take advice for each market.

## Privacy of player text and voice

Apple's guideline 5.1.2(i) requires apps to "clearly disclose where personal data will be shared with third parties, including with third-party AI, and obtain explicit permission before doing so".[55] OpenAI says API data since 1 March 2023 "is not used to train or improve OpenAI models (unless you explicitly opt in to share data with us)", while abuse-monitoring logs are kept for up to 30 days by default.[56] Epic says Fortnite player voice audio "is not stored and will not be used to train AI models", and that a report sends Epic a text log of the interaction.[28] OpenAI recommends a per-user `safety_identifier`, hashing the username or email "to avoid sending us any identifying information".[30] This guide's advice: send the minimum text needed, keep real names out of prompts, and state in the privacy policy which provider receives what.

## Test runtime AI before release

The testing guide treats a runtime model as a separate service: test timeouts, an unavailable service, malformed responses and an exhausted allowance, and confirm that a failed or repeated request cannot award an item twice. Generative features add:

- **Hostile input.** OpenAI recommends red-teaming over "a wide range of inputs and user behaviors", including "ignore the previous instructions and do this instead".[30] Keep a regression set of such lines and rerun it after every prompt or model change (advice).
- **Reproducible runs.** Roblox's `Seed` property gives "identical results for debugging, testing, or evaluation purposes".[26] Epic suggests checking a persona's replies in the Prompt Editor Tool, as well as by playtesting the island.[38]
- **Platform flows.** Trigger the report path, confirm consent prompts appear before data leaves the device, and test with parental controls on (advice).
- **Hardware spread.** For on-device models, measure frame time and memory on the lowest supported hardware (advice).

## Disclosure and platform rules

| Platform | Rule relevant to runtime generation |
| --- | --- |
| Steam | The Content Survey asks "what kind of guardrails you're putting on your AI to ensure it's not generating illegal content"; players can report illegal content in Live-Generated games through the in-game overlay; Valve does not "want to ship Live-Generated AI Adult Only Sexual Content at this time"[1][57] |
| Google Play | Apps that generate content using AI "must contain in-app user reporting or flagging features" usable "without needing to exit the app"[58] |
| Apple App Store | Guideline 1.2 lists "AI content creation apps" among user-generated content apps, which need filtering, reporting with timely responses, user blocking and contact information; Apple told developers to consider "AI assistants and chatbot functionality" in age ratings[55][59] |
| Roblox | Roblox says all generated text "must be processed through the TextService:FilterStringAsync() method"; filter any other displayed text you do not control; TextGenerator is rate-limited[66][27][26] |
| Fortnite (UEFN) | Personas and prompts must follow the Fortnite Developer Rules, Epic Community Rules and Epic Content Guidelines; Epic says claiming to be "recording" or "storing" a player's voice misleads players[38] |

Valve says its General Content section "will generate ratings for several regional rating boards".[1] Describe the live feature on the store page: Whispers from the Star's Steam page says it "features an AI-powered character that engages in open-ended, dynamic conversation with the player" and that "players may still generate responses that are not appropriate for all audiences".[60] See also [Steam AI disclosure](https://aiwiki.ai/wiki/steam_ai_disclosure).

## Published examples

Status as of 30 October 2026 per the cited sources; vendor descriptions are attributed.

| Project | Status | What the sources document |
| --- | --- | --- |
| PUBG Ally (KRAFTON) | Ally Duo global beta, 17 June to 1 July 2026 | Companion "Ella" on an on-device small language model built on NVIDIA ACE, with voice in Korean, Chinese and English[44] |
| Smart Zoi in inZOI (KRAFTON) | Experimental setting from early access, 28 March 2025 | NVIDIA says players can read NPCs' thoughts and change them with free-form text; RTX GPUs only[18] |
| NARAKA: BLADEPOINT MOBILE PC VERSION (NetEase) | AI teammate from 27 March 2025, per NVIDIA | On-device ACE teammate that fights, finds items and suggests skills[18] |
| Where Winds Meet (NetEase) | Released 15 November 2025 | Some NPCs chat through generative AI; players found tricks that complete requests without the task[36][35] |
| Darth Vader in Fortnite (Epic) | Event character, May 2025 | Hotfixed after players elicited slurs; [SAG-AFTRA](https://aiwiki.ai/wiki/sag_aftra) filed an unfair labor practice charge against Epic subsidiary Llama Productions[48] |
| Whispers from the Star (Anuttacon) | Released on Steam 14 August 2025 | Voiced, open-ended conversation; requires a broadband connection[60] |
| NEO NPC (Ubisoft) | Prototype, GDC 2024 | Inworld's LLM with NVIDIA Audio2Face; "only a prototype", per Ubisoft[61] |
| Teammates (Ubisoft) | Playable research project, 21 November 2025 | Voice assistant Jaspar and squadmates Pablo and Sofia; closed playtest with "a few hundred players"[39] |
| Dead Meat (Meaning Machine) | Upcoming; shown at CES 2025 | NVIDIA says the murder mystery game moved from cloud LLMs to local dialogue generation with a Minitron 8B model, ElevenLabs TTS and [Whisper](https://aiwiki.ai/wiki/whisper)[3] |

## What the research establishes

The evidence base is young: prototypes, small studies and preprints.

- **Believable agents.** Park and colleagues (UIST 2023) populated a sandbox "inspired by The Sims" with 25 agents; from one seeded idea of a Valentine's Day party, agents spread invitations and coordinated to attend.[40] It demonstrates an architecture, not a shipped game's costs or safety.
- **Players find emergent content.** Peng and colleagues (IEEE CoG 2024) had 28 gamers play a text adventure with GPT-4 NPCs; players discovered "interesting new emergent nodes" outside the original narrative.[62]
- **Open input has costs.** In a 130-player randomized experiment (a preprint under review), Hsu and colleagues found free-form LLM NPCs raised cognitive load over scripted options (p < .001) without significantly improving overall experience (p = .195); autonomy rose while usability and trust fell.[63]
- **Surveys.** Gallotta and colleagues map the roles LLMs can take in games.[64] Luo and colleagues (2026) list "sustained runtime adaptation" among areas where evidence is "less established".[65]

With the state-tracking and prompt-constraint results above, these support three rules: keep game state in code, test with real players, and do not assume more open input makes a better game.

## Common problems and fixes

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| NPC accepts an event that never happened | Model decides outcomes from player text | Model picks from allowed actions; code checks world state[35][33] |
| Parse errors or missing fields | JSON requested only in the prompt | Structured-output mode, then validate content[31] |
| Replies arrive too late | Long outputs, sequential calls | Shorter replies, streaming, parallel steps[2] |
| Streamed text later flagged | Moderation scores arrive after full output | Moderate chunks on the server[43] |
| Bill spikes after launch | No quota or spend cap | Rate limits, quotas, timeouts, spend limit[47][37] |
| Character drifts off topic | Vague persona, player injection | Modular persona prompt, guardrails, regression set[38][52] |
| Key found in a decompiled build | Key shipped in the client | Revoke it; use your server or short-lived tokens[5] |
| Many players cannot use the feature | Model above their hardware | Authored fallback or optional cloud path (advice) |
| Behavior changes after a provider update | Model changed underneath | Pin versions where offered; rerun the regression set (advice) |

## See also

- [Developing Games with AI](https://aiwiki.ai/wiki/developing_games_with_ai) (series overview)
- [Developing Browser Games with AI](https://aiwiki.ai/wiki/developing_browser_games_with_ai)
- [Developing Godot Games with AI](https://aiwiki.ai/wiki/developing_godot_games_with_ai)
- [Developing Unity Games with AI](https://aiwiki.ai/wiki/developing_unity_games_with_ai)
- [Developing Unreal Engine Games with AI](https://aiwiki.ai/wiki/developing_unreal_engine_games_with_ai)
- [Developing Roblox Games with AI](https://aiwiki.ai/wiki/developing_roblox_games_with_ai)
- [Creating Game Assets with AI](https://aiwiki.ai/wiki/creating_game_assets_with_ai)
- [Testing and Releasing AI-Assisted Games](https://aiwiki.ai/wiki/testing_and_releasing_ai_assisted_games)
- [AI in gaming](https://aiwiki.ai/wiki/ai_in_gaming)
- [Inworld AI](https://aiwiki.ai/wiki/inworld_ai)
- [Steam AI disclosure](https://aiwiki.ai/wiki/steam_ai_disclosure)
- [Prompt injection](https://aiwiki.ai/wiki/prompt_injection)
- [Structured output](https://aiwiki.ai/wiki/structured_output)
- [Small language model](https://aiwiki.ai/wiki/small_language_model)
- [California SB 243](https://aiwiki.ai/wiki/california_sb_243)

## References

1. Valve. [Content Survey](https://partner.steamgames.com/doc/gettingstarted/contentsurvey). Steamworks documentation, Generative Artificial Intelligence Content section and FAQ. Accessed 30 October 2026.
2. OpenAI. [Latency optimization](https://developers.openai.com/api/docs/guides/latency-optimization). OpenAI API documentation. Accessed 30 October 2026.
3. Burnes, Andrew; Schneider, Seth; Paul, Jason. [NVIDIA Redefines Game AI With ACE Autonomous Game Characters](https://www.nvidia.com/en-us/geforce/news/nvidia-ace-autonomous-ai-companions-pubg-naraka-bladepoint/). NVIDIA GeForce News, 6 January 2025.
4. OpenAI. [Best practices for API key safety](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety). OpenAI Help Center. Accessed 30 October 2026.
5. Inworld AI. [Security best practices](https://docs.inworld.ai/portal/auth-security). Inworld documentation. Accessed 30 October 2026.
6. Convai. [Configure the API key](https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/getting-started/configure-api-key). Convai Unity SDK documentation. Accessed 30 October 2026.
7. OWASP GenAI Security Project. [LLM07:2025 System Prompt Leakage](https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/). OWASP Top 10 for LLM Applications 2025. Accessed 30 October 2026.
8. ggml-org. [llama.cpp README](https://github.com/ggml-org/llama.cpp). GitHub repository. Accessed 30 October 2026.
9. ggml-org. [GBNF Guide](https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md). llama.cpp repository documentation. Accessed 30 October 2026.
10. Microsoft. [Welcome to ONNX Runtime](https://onnxruntime.ai/docs/). ONNX Runtime documentation. Accessed 30 October 2026.
11. Microsoft. [ONNX Runtime generate() API](https://onnxruntime.ai/docs/genai/). ONNX Runtime documentation. Accessed 30 October 2026.
12. Unity Technologies. [Sentis overview](https://docs.unity3d.com/Packages/com.unity.ai.inference@2.6/manual/index.html). Sentis 2.6.1 package documentation (package com.unity.ai.inference). Accessed 30 October 2026.
13. Epic Games. [Neural Network Engine in Unreal Engine](https://dev.epicgames.com/documentation/en-us/unreal-engine/neural-network-engine-in-unreal-engine). Unreal Engine 5.8 documentation. Accessed 30 October 2026.
14. NVIDIA. [NVIDIA In-Game Inferencing SDK](https://developer.nvidia.com/rtx/in-game-inferencing). NVIDIA Developer. Accessed 30 October 2026.
15. Apple. [Foundation Models](https://developer.apple.com/documentation/foundationmodels). Apple Developer Documentation. Accessed 30 October 2026.
16. Apple. [Generating Swift data structures with guided generation](https://developer.apple.com/documentation/foundationmodels/generating-swift-data-structures-with-guided-generation). Apple Developer Documentation. Accessed 30 October 2026.
17. Rowlett, Brandon. [How to Minimize Game Runtime Inference Costs with Coding Agents](https://developer.nvidia.com/blog/how-to-minimize-game-runtime-inference-costs-with-coding-agents/). NVIDIA Technical Blog, 3 March 2026.
18. Burnes, Andrew. [NVIDIA ACE Autonomous Game Characters Debut This Month In inZOI & NARAKA: BLADEPOINT MOBILE PC VERSION](https://www.nvidia.com/en-us/geforce/news/nvidia-ace-naraka-bladepoint-inzoi-launch-this-month/). NVIDIA GeForce News, 13 March 2025.
19. NVIDIA. [NVIDIA ACE for Games](https://developer.nvidia.com/ace-for-games). NVIDIA Developer. Accessed 30 October 2026.
20. Inworld AI. [Inworld AI](https://inworld.ai/). Company website. Accessed 30 October 2026.
21. Inworld AI. [Character Studio deprecation](https://docs.inworld.ai/character-studio-deprecation). Inworld documentation. Accessed 30 October 2026.
22. Inworld AI. [Pricing](https://inworld.ai/pricing). Accessed 30 October 2026.
23. Convai. [Convai Documentation index](https://docs.convai.com/llms.txt) (Unity SDK, Knowledge Bank and Memory pages). Accessed 30 October 2026.
24. Convai. [Guardrails](https://docs.convai.com/api-docs/convai-playground/character-customization/guardrails). Convai Playground documentation. Accessed 30 October 2026.
25. Convai. [Agentic Actions](https://docs.convai.com/api-docs/convai-playground/character-customization/agentic-actions). Convai Playground documentation. Accessed 30 October 2026.
26. Roblox. [TextGenerator](https://create.roblox.com/docs/reference/engine/classes/TextGenerator). Roblox Creator Documentation, engine API reference. Accessed 30 October 2026.
27. Roblox. [Text filtering](https://create.roblox.com/docs/ui/text-filtering). Roblox Creator Documentation. Accessed 30 October 2026.
28. Epic Games. [LLM Conversations in Unreal Editor for Fortnite](https://dev.epicgames.com/documentation/en-us/fortnite/llm-conversations-in-unreal-editor-for-fortnite). Fortnite documentation, including FAQ. Accessed 30 October 2026.
29. Epic Games. [Publish Islands with LLM Conversations Starting July 30](https://www.fortnite.com/news/publish-islands-with-llm-conversations-starting-july-30). Fortnite news, 16 July 2026 (read through an Internet Archive copy).
30. OpenAI. [Safety best practices](https://developers.openai.com/api/docs/guides/safety-best-practices). OpenAI API documentation. Accessed 30 October 2026.
31. OpenAI. [Structured model outputs](https://developers.openai.com/api/docs/guides/structured-outputs). OpenAI API documentation. Accessed 30 October 2026.
32. Anthropic. [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). Claude API documentation. Accessed 30 October 2026.
33. OWASP GenAI Security Project. [LLM05:2025 Improper Output Handling](https://genai.owasp.org/llmrisk/llm052025-improper-output-handling/). Accessed 30 October 2026.
34. Wang, Ruoyao; Todd, Graham; Xiao, Ziang; Yuan, Xingdi; Cote, Marc-Alexandre; Clark, Peter; Jansen, Peter. [Can Language Models Serve as Text-Based World Simulators?](https://arxiv.org/abs/2406.06485). ACL 2024; arXiv:2406.06485.
35. Muller, Marius. [Players learn how to outwit every NPC in Where Winds Meet, and feel like gods in its open world](https://www.notebookcheck.net/Players-learn-how-to-outwit-every-NPC-in-Where-Winds-Meet-and-feel-like-gods-in-its-open-world.1170522.0.html). Notebookcheck, 25 November 2025.
36. AUTOMATON. [Where Winds Meet: a trick for easily fooling the game's free-conversation AI NPCs](https://automaton-media.com/articles/newsjp/where-winds-meet-20251128-368771/) (Japanese). AUTOMATON, 28 November 2025.
37. OpenAI. [Rate limits](https://developers.openai.com/api/docs/guides/rate-limits). OpenAI API documentation. Accessed 30 October 2026.
38. Epic Games. [Developing Personas Overview in Unreal Editor for Fortnite](https://dev.epicgames.com/documentation/en-us/fortnite/developing-personas-overview-in-unreal-editor-for-fortnite). Fortnite documentation. Accessed 30 October 2026.
39. Ubisoft. [Ubisoft Reveals Teammates, an AI Experiment to Change the Game](https://news.ubisoft.com/en-us/article/3mWlITIuWuu0MoVuR6o8ps/ubisoft-reveals-teammates-an-ai-experiment-to-change-the-game). Ubisoft News, 21 November 2025.
40. Park, Joon Sung; O'Brien, Joseph C.; Cai, Carrie J.; Morris, Meredith Ringel; Liang, Percy; Bernstein, Michael S. [Generative Agents: Interactive Simulacra of Human Behavior](https://arxiv.org/abs/2304.03442). UIST '23; arXiv:2304.03442, 7 April 2023.
41. OpenAI. [Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching). OpenAI API documentation. Accessed 30 October 2026.
42. Figueiredo, Vanessa; Elumeze, David. [Symbolically Scaffolded Play: Designing Role-Sensitive Prompts for Generative NPC Dialogue](https://arxiv.org/abs/2510.25820). arXiv preprint, 29 October 2025.
43. OpenAI. [Streaming API responses](https://developers.openai.com/api/docs/guides/streaming-responses). OpenAI API documentation. Accessed 30 October 2026.
44. KRAFTON. [KRAFTON Introduces PUBG Ally Beta Test](https://www.gamedeveloper.com/press-release/krafton-introduces-pubg-ally-beta-test). Press release via Game Developer, 16 June 2026.
45. Anthropic. [Pricing](https://platform.claude.com/docs/en/about-claude/pricing). Claude API documentation. Accessed 30 October 2026.
46. OpenAI. [Moderation](https://developers.openai.com/api/docs/guides/moderation). OpenAI API documentation. Accessed 30 October 2026.
47. OWASP GenAI Security Project. [LLM10:2025 Unbounded Consumption](https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/). Accessed 30 October 2026.
48. Game Developer. [Voice actor union strikes back after Fortnite debuts controversial AI-powered Darth Vader](https://www.gamedeveloper.com/business/voice-actor-union-hits-back-after-fortnite-debuts-controversial-ai-powered-darth-vader). Game Developer, 20 May 2025.
49. Decrypt. ['Fortnite' Fixes AI-Powered Darth Vader After It Starts Saying Slurs](https://decrypt.co/320500/fortnite-ai-powered-darth-vader-saying-slurs). Decrypt, 16 May 2025.
50. Microsoft. [What is Azure AI Content Safety?](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/overview). Microsoft Learn, updated 20 October 2026. Accessed 30 October 2026.
51. Anthropic. [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks). Claude API documentation. Accessed 30 October 2026.
52. OWASP GenAI Security Project. [LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/). Accessed 30 October 2026.
53. OpenAI. [Under-18 guidance](https://developers.openai.com/api/docs/guides/safety-checks/under-18-api-guidance). OpenAI API documentation. Accessed 30 October 2026.
54. California Legislature. [SB-243 Companion chatbots](https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=202520260SB243). Chaptered bill text, approved by the Governor 13 October 2025. Accessed 30 October 2026.
55. Apple. [App Store Review Guidelines](https://developer.apple.com/app-store/review/guidelines/). Last updated 16 October 2026. Accessed 30 October 2026.
56. OpenAI. [Data controls in the OpenAI platform](https://developers.openai.com/api/docs/guides/your-data). OpenAI API documentation. Accessed 30 October 2026.
57. Valve. [AI Content on Steam](https://store.steampowered.com/news/group/4145017/view/3862463747997849618). Steamworks Development, Steam News, 9 January 2024.
58. Google. [AI-Generated Content](https://support.google.com/googleplay/android-developer/answer/13985936). Play Console Help, Google Play policy. Accessed 30 October 2026.
59. Apple. [Updated age ratings in App Store Connect](https://developer.apple.com/news/?id=ks775ehf). Apple Developer News, 24 July 2025.
60. Anuttacon. [Whispers from the Star](https://store.steampowered.com/app/3730100/). Steam store page, AI Generated Content Disclosure and Mature Content Description. Accessed 30 October 2026.
61. Ubisoft. [How Ubisoft's New Generative AI Prototype Changes the Narrative for NPCs](https://news.ubisoft.com/en-us/article/5qXdxhshJBXoanFZApdG3L/how-ubisofts-new-generative-ai-prototype-changes-the-narrative-for-npcs). Ubisoft News, 19 March 2024.
62. Peng, Xiangyu; Quaye, Jessica; Rao, Sudha; Xu, Weijia; Botchway, Portia; Brockett, Chris; Jojic, Nebojsa; DesGarennes, Gabriel; et al. [Player-Driven Emergence in LLM-Driven Game Narrative](https://arxiv.org/abs/2404.17027). IEEE Conference on Games 2024; arXiv:2404.17027.
63. Hsu, Ting-Chen; Chen, Wenran; Lin, Jiangxu; Qin, Fei; Zhang, Zheyuan. [The Double-Edged Sword of Open-Ended Interaction: How LLM-Driven NPCs Affect Players' Cognitive Load and Gaming Experience](https://arxiv.org/abs/2604.10107). arXiv preprint, 11 April 2026 (under review at IEEE Transactions on Games).
64. Gallotta, Roberto; Todd, Graham; Zammit, Marvin; Earle, Sam; Liapis, Antonios; Togelius, Julian; Yannakakis, Georgios N. [Large Language Models and Games: A Survey and Roadmap](https://arxiv.org/abs/2402.18659). IEEE Transactions on Games; arXiv:2402.18659.
65. Luo, Meng, et al. [AI for Games in the Foundation Model Era](https://arxiv.org/abs/2609.16679). arXiv preprint, 15 September 2026.
66. Roblox. [AI on Roblox](https://create.roblox.com/docs/ai/accelerated-workflows). Roblox Creator Hub documentation. Accessed 30 October 2026.

