Skip to content

Desuq Cafe

Back to Inhyeong RPG

MIRAI

Custom AI

Modular Intelligent Response & Adaptive Interaction | 未来 — "future" in Japanese

The custom enemy AI behind Inhyeong. Enemies that perceive, remember, and decide for themselves.

Unity C# FishNet Network

click to disturb

perceive · weigh · act

Overview

MIRAI drives every enemy in Inhyeong. Instead of running a script, an enemy keeps re-weighing what matters most to it right now. Staying alive, fighting, heading home, chasing a personal goal, patrolling, or just idling. It acts on whichever wins, so enemies respond to the fight that is actually happening rather than playing back a routine.

Everything runs on the server for co-op. Enemies think server-side and clients only see the results, so every player is watching the same mind at work.

Perception & Memory

Enemies work from what they can actually perceive. A vision cone, line of sight, and what they have seen happen around them. What they know builds up from there, and it shapes what they do next.

Soul Recollections

Memory

Enemies remember. A fight leaves an impression, and some of them hold a grudge about it. Others just get curious about whatever seems off.

Soul Personality

Personality

Every enemy has its own personality, and it drifts over time depending on how life treats it. Two enemies of the same kind can end up behaving quite differently.

Emergent Behavior

Kiting, keeping distance, forming up as a pack, settling on the same target, desperate last stands when cornered. None of these are authored. They fall out of simple rules interacting, so fights keep producing moments nobody specifically designed.

Pack coordination works the same way. There is no commander handing out orders, just independent minds arriving at the same read of the fight.

Moments

Things enemies have done during development. None of it was scripted.

A support enemy hung at the back edge of a fight, drifting just close enough to keep its allies standing.

A ranged enemy kept a melee player at arm's length for a whole fight, giving ground step by step and never letting the gap close.

An enemy that had been losing badly ran out of room to retreat, turned around, and spent everything it had left.

Reading Their Intent

The AI is meant to be readable. Telegraphs, windups, and cues around big moments show what an enemy is about to do, so you can learn its habits and play around them. Enemies weigh their options rather than always taking the obvious one, and once in a while they will surprise you on purpose.

Rules They Play By

No cheating

Enemies only know what they have perceived. They do not see through walls or read your inputs, and they can be snuck past, fooled, and lost.

One mind, one truth

The server does the thinking, so in co-op every player is fighting the same enemy, not a local guess.

Built to be beaten

The AI's job is a good fight, not a won one. Its intentions are readable, its habits are learnable, and outplaying it is the point.

And no language model in the loop. MIRAI is handwritten simulation code thinking many times a second for a hundred minds at once, with no latency and no cloud in the way.

Outside Combat

Enemies have things to do when nobody is fighting them. They hunt, investigate things that seem off, collect what they want, and some come looking for revenge.

Built for Crowds

MIRAI is built to run 50 to 100 or more thinking NPCs at once. Enemies near a player think hard and often, distant ones think less and more cheaply, and all of it fits inside a fixed slice of each frame so big groups stay smooth.

Private Repository Inhyeong RPG Writing