Blog Post #5


Halfway Through with Milestone 3!

As I completed this week’s work for Milestone 3, I realized that we’re already halfway through the semester, and therefore, halfway through this project!

Thought it felt victorious enough to get a response from a local LLM sent to Unreal engine, I still strive towards my ultimate goal…

An intelligent NPC Prototype!

This week’s work wasn’t as heavy as the end of Milestone 2 since I’m becoming more familiar with my Blueprint wiring…

…but there’s still plenty left to do!


How Milestone 2 Was Left

I had successfully proven that Unreal Engine could communicate with a local LLM

Milestone 2 ended with my first successful message exchange between Unreal and Ollama, though at the time I mainly saw raw JSON data scrolling across the screen.

Milestone 3 then began with one simple question:

How do I turn that mess into a dialogue?


Milestone 3 Commences!

Primary Objective

Milestone 3 focuses on transforming the raw data exchange between Unreal Engine and the local model into usable, readable NPC dialogue.

AKA “payload & response handling”

Goals

  1. Refine the Unreal → Ollama loop
    Ensure the model’s replies are consistently returned and usable inside Unreal.
  2. Clean up the JSON payload
    Include the required fields in a stable, validated structure.
  3. Parse the response
    Extract the actual NPC text from the JSON reply.
  4. Display the NPC reply in a basic UI
    Connect the parsed text to a simple Unreal dialogue widget.
  5. Stabilize and polish
    Add guards for empty or failed responses so Unreal never crashes or outputs blank text.
  6. Seed personality
    Begin introducing the apple-seller NPC personality

Progress Thus Far

Duplicated the successful M2 “SMOKETEST” Blueprint into a new M3 version (to keep the original intact).
Confirmed that all wiring still functioned correctly on startup and cleaned up node layout and added comments.
Maintained a stable request format.
Verified that the existing configuration continues to send requests correctly and avoids the previous “model is required” error.
Ensured that the payload fields remain properly defined.
Added response validation.
Implemented a printed HTTP 200 status code to confirm successful round-trip communication as a clear health check before deeper debugging or UI work.
Implemented JSON parsing.
Added a short parser chain that reads the JSON reply and extracts the NPC’s actual message text.
Verified that Unreal now only displays the model’s human-readable reply in-engine.
Debug cleanup and stability check.
Removed redundant raw JSON printouts to keep logs clean and readable.
Verified that no errors or blank outputs appear on valid runs.

Current System Behavior

  • Unreal sends a JSON request to Ollama.
  • Ollama responds with a valid structured reply.
  • Unreal confirms a Code 200 response and prints a clean NPC sentence to the screen.

The connection is now stable, verified, and producing parsed dialogue text!


A Moment to Reflect

This part of the process felt like magic.

It was like watching a machine learn to speak.

Seeing that first clear line appear on screen (free from JSON clutter!) transformed the project from an abstract technical puzzle into something that finally resembled human speech.

If each refinement of this prototype recaptures that same feeling of amazement at what these tools can do in games, I can’t help but wonder how intelligent NPCs will shape the player experience as generative AI continues to evolve.


Next Steps!

Build the Dialogue UI Widget to display NPC replies on-screen.
Add Interactive Input so the player can type a message to the NPC.
Integrate Stability Guards (LLM to ignore empty inputs and generate fallback text on failures/errors).
Seed the Apple-Seller Personality through the system prompt to start shaping the NPC’s tone.

What is the Apple-Seller?

This prototype needs both a personality and a purpose for the NPC. The “apple seller” represents the first test of that as a simple, grounded character through which I can experiment with tone, interaction, and world presence.

If Milestone 3 works as planned, we’ll start to see my apple-seller concept take real shape in action!

Until next time,

~Lauren


Leave a Comment

Your email address will not be published. Required fields are marked *