Skip to main content

Introduction

VluxyAI is a simple, composable AI library for Roblox.

An AI is four things stacked together:

PartWhat it doesYou write it as
BrainDecides what to doA table of states with Enter, Update, Exit and transitions
PathfinderPlans a routeAnything with FindPath
MoverWalks the routeAnything with Follow, Stop, a position, a speed, and Arrived and StepReached signals (see Extension)
SensesNotice the worldAnything with Tick that writes to a blackboard

The Builder stacks them into an Agent, which ticks the senses, then the navigator, then the brain, on a timer you choose.

local agent = VluxyAI.new(rig)
:UseBrain(Stalker)
:UsePathfinder(VluxyAI.Pathfinders.Navmesh.new())
:UseMover(VluxyAI.Movers.Humanoid.new(rig))
:AddSense(VluxyAI.Senses.Sight.new({ Range = 40 }))
:Build()
:Start()

Why it is shaped like this​

  • States never query the world. Senses write what they notice to agent.Blackboard; states read it. That is what keeps a brain table readable, and what lets the whole thing run under Lune with fakes.
  • Modes are transitions, targets are scores. A state's transitions are checked in order every tick and the first true one wins, so mode changes are deterministic. When a state has to choose which player or which room, Utility scoring picks one; a bad score gives an odd choice, never an oscillating AI.
  • Contracts, not registries. You never register a pathfinder kind or an enemy kind by name. You pass your own module in, and Build() checks its shape. A mistake reads as Definition.Brain.States.Hunt.Transitions[2].To = "Chase" names no state.

Read Installation to add the package, then Your first AI to build one.