INTELLIPATCH

Dynamic Reactive A* Pathfinding + Goal System

Godot-style navigation for RPG Maker MZ — patches, composable goals, stuck policies, expert API

⚑ REACTIVE A* 🎯 GOAL SYSTEM πŸ”§ EXPERT API

β–Ά Watch the trailer


IntelliPatch is a complete navigation engine for RPG Maker MZ — the same way Godot's NavigationServer + NavigationPolygon works for 3D games. Programmable navigation patches, composable multi-target goals, six stuck policies, path smoothing, portal loop guard, and a debug overlay that actually shows you what's happening.

Every other RMMZ pathfinder stops at "walk from A to B". IntelliPatch gives you the building blocks for real AI: cost zones, blockers, portals, currents, conditional gates, AND/OR/SEQ goal composition, barrier sync across multiple events, and a register* API that lets experts extend everything without touching the source.

Four Killer Features

The pieces no other RMMZ pathfinder has — available in IntelliPatch Pro.

🎯

GOAL SYSTEM

20 composable goal modes — any, all, sequence, closest, farthest, weighted, simultaneous, guardPost, twoEventsMeet, swap, custom. Nest them recursively. Interrupt mid-flight.

πŸ—ΊοΈ

NAVIGATION PATCHES

Programmable environment: cost zones, blockers, force fields, portals, conditional gates. Rect or predicate. Priority-ordered. Revision-invalidated.

πŸ›‘οΈ

STUCK POLICIES

Six policies for when no road exists. Never freezes. Recalc, origin, back_retry, random, ghost, giveup. Per-order overrides + global defaults.

πŸ”Œ

EXPERT API

Twelve register* hooks: custom heuristics, cost functions, patch types, goal modes, wait conditions, steering behaviors, lifecycle callbacks.

Lite vs Pro — Choose Your Edition

Same engine file. One flag. Pro unlocks the Goal System, 3 extra patch types, 4 advanced stuck policies, 13 more commands, and 12 expert script hooks.

Feature LITE
Free (demo)
PRO
€9.99
Core Engine
A* pathfinding (binary heap + integer keys) βœ“ βœ“
Path smoothing (Bresenham string-pulling) βœ“ βœ“
Closest-reachable fallback βœ“ βœ“
Round-robin recalc scheduler (1 nav/frame) βœ“ βœ“
Diagonal modes (off / all / auto no corner-cut) βœ“ βœ“
Failure memory (taboo tiles, TTL + penalty) βœ“ βœ“
Destination touch contact (allowTouch) βœ“ βœ“
Step coherence bypass (ignored refusals taken with one-step through) βœ“ βœ“
Performance presets (safe / balanced / aggressive) βœ— βœ“
VisuStella detection (Imported.VisuMZ_* guard) βœ— βœ“
Auto-scaling iteration cap (half the tiles, 40k max) βœ“ βœ“
Event cap per session 3 events Unlimited
Navigation Patches
cost — mud, wind, slow terrain βœ— βœ“
block — walls, closed doors βœ— βœ“
force — currents, wind, conveyor belts βœ— βœ“
portal — teleports inside A* searches βœ— βœ“
conditional — JS callback per tile βœ— βœ“
Rect area or predicate function βœ— βœ“
Portal loop guard (per-search visited set) βœ— βœ“
Cache invalidated by patchRevision (live validation) βœ— βœ“
Goal System
20 composable goal modes (any, all, sequence, closest, farthest, weighted, conditional, swap, interleave, eventAt, eventAtAny, twoEventsMeet, guardPost, conditionalSequence, custom, …) βœ— βœ“
Recursive nested goals (AND/OR/SEQ/NOT trees) βœ— βœ“
Soft avoid lists (skip tiles safely) βœ— βœ“
Interrupt rules (swap goal mid-flight, priority + cooldown) βœ— βœ“
Wait conditions (frames, switch, signal, playerNear, custom) βœ— βœ“
Barrier coordination (simultaneous + paired with tolerance) βœ— βœ“
Goal timeout (fail gracefully after N frames) βœ— βœ“
Goal loop & reverse (infinite patrol without reorders) βœ— βœ“
Stuck Policies
recalc — keep hunting an alternative road βœ“ βœ“
giveup — stay still, fire onFail() βœ“ βœ“
origin — walk back to start, then fail βœ— βœ“
back_retry — step back on trail, retry βœ— βœ“
random — escape wander, then retry βœ— βœ“
ghost — collision OFF for N tiles (patches still apply) βœ— βœ“
Plugin Commands
MoveTo βœ“ βœ“
FollowTarget βœ“ βœ“
DebugToggle βœ“ βœ“
MoveToPath / WanderArea / ClearPath / WaitForArrival βœ— βœ“
Patch shorthands (AddCostPatch, AddBlockPatch, AddPortalPatch, RemovePatch, SetPatchEnabled) βœ— βœ“
Goal commands — MoveToGoal / MoveToAny / MoveToSequence / MoveToClosest / EventAt / TwoEventsMeet / GuardPost / Simultaneous / Swap / ClearGoal βœ— βœ“
Expert Script API
registerHeuristic — custom A* heuristic βœ— βœ“
registerCostFunction — custom tile cost βœ— βœ“
registerPatchType — custom patch type βœ— βœ“
registerGoalMode — custom goal resolver βœ— βœ“
registerWaitCondition — custom wait key βœ— βœ“
registerSteeringBehavior — smooth + grid steering βœ— βœ“
registerCallback — 6 global journey hooks βœ— βœ“
registerPreRecalc / registerPostRecalc βœ— βœ“
registerOnMapChange / registerOnArrival βœ— βœ“
registerPatch — alias to addPatch for custom types βœ— βœ“
Debug Overlay
Green path Β· Red blocked Β· Gray visited βœ“ βœ“
Yellow patched tiles βœ— βœ“
Purple goal points + Cyan target line βœ— βœ“
Per-navigator labels (len | recalcs | state | stuck | fb | policy) βœ“ βœ“
Click-to-inspect tile (in-game) βœ— βœ“
IntelliPatch.debug() βœ“ βœ“
debugTile(x,y) / debugGoal(id) / debugRegistries() βœ— βœ“
Watermark LITE corner None

🟒 Lite — Free Demo

A teaser of the IntelliPatch engine: core A*, smoothing, fallback, scheduler, and 3 movement commands. Capped at 3 events per session, no patches, no goals, no hooks, and a LITE watermark on the debug overlay.

Not production-ready. It exists so you can feel the engine before buying Pro.

FOR REAL AI

πŸ”΅ Pro — €9.99

Everything in Lite, plus the Goal System (20 composable modes, recursion, interrupts, waits, barriers, timeouts), force + portal + conditional patches, all 6 stuck policies, 13 extra commands, and 12 expert script hooks.

For puzzles, stealth, escort missions, formations, and any event that used to need 6 pages of branches.

πŸ”’ WHAT PRO UNLOCKS — CONCRETE EXAMPLES

  • Two-lever puzzle — two NPCs must reach their levers on the same frame β†’ Pro only (simultaneous)
  • Guard with a rotating vision cone — vision cone via PolyTrigger2D, chase/flee via FSM, goal sync via IntelliPatch β†’ Pro only (goal modes + force patches)
  • Cutscene that must arrive — the NPC walks through a closed door for 2 frames β†’ Pro only (ghost policy)
  • Fetch quest reset — NPC walks back to its origin on failure β†’ Pro only (origin policy)
  • Teleport stairs inside a path — stairs treated as a shortcut during A* β†’ Pro only (portal patch)
  • Door that opens only with switch — door tile blocks only when switch 5 is OFF β†’ Pro only (block + condition)
  • Mud that slows 5x — cost multiplier on a rect β†’ Pro only (cost patch)

The Goal System — Real AI Logic

Replace {x, y} with a declarative goal tree. Recurse, combine, interrupt, sync. Pro only.

Mode Behavior
any / oneOf Reach the nearest reachable point (A*-verified)
all Visit every point (nearest-first ordering)
sequence Visit points in exact order
sequenceThenLoop Sequence, wrap to 0 at end (infinite patrol)
sequenceThenReverse Ping-pong patrol (back and forth)
closest / farthest Pick min / max Manhattan distance (A* verified)
random Uniform random pick (shuffled for avoid-order)
weighted Weighted pick (heaviest viable candidate first)
conditional Filter by condition() at resolve time
interleave Round-robin across multiple navigators (shared counter)
paired / simultaneous Barrier sync: everyone arrives together or nobody does
swap Two events exchange starting positions
eventAt / eventAtAny Event must reach a specific tile (or any of a list)
twoEventsMeet Both events walk to a minimax midpoint
guardPost Every listed event to its assigned post ("5@3,3;6@8,8")
conditionalSequence Sequence with per-step while gates
custom Your own resolver via registerGoalMode()

Operators, Interrupts, Waits

  • Recursive composition — a goal can nest goals. Build arbitrary AND/OR/SEQ/NOT trees.
  • Soft avoid lists — mark tiles as "never stand here", resolver skips them safely.
  • Interrupt rules — swap the whole goal mid-flight when a condition fires (priority-ordered, 15-frame cooldown).
  • Wait conditions — pause at any waypoint until frames elapse, a switch flips, a signal arrives, the player comes near, or a custom function returns true.
  • Loop & bounce — infinite patrols without reissuing commands.
  • Timeout — fail gracefully after N frames when the goal is unachievable.

Example — Two Levers Puzzle

// Two guards must press two levers at the SAME frame.
// If one arrives early, it waits up to 30 frames for the other.
IntelliPatch.moveToGoal($gameMap.event(5), {
  mode: "simultaneous",
  points: [ { x: 3, y: 7 }, { x: 12, y: 7 } ],
  tolerance: 30,
  onGoalComplete: function() {
    $gameSwitches.setValue(42, true);   // opens the door
    $gameMessage.add("The levers click in unison!");
  },
  onGoalFailed: function(reason) { $gameMessage.add("Too slow..."); }
});

A puzzle that used to need 200 event commands + a parallel process β†’ 10 lines of code (Pro only).

Navigation Patches — Programmable Environment

Five patch types, priority-ordered, rect or predicate, revision-invalidated. Add, toggle, remove — the cache updates lazily on the next search. Pro only.

cost

Mud, wind, slow terrain. multiplier multiplies cost, add adds a flat bonus, direction limits to that travel dir.

block

Walls, closed doors. Optional condition() — e.g. "blocked while switch 5 is OFF".

force

Currents, wind, conveyor belts. Cheap with the flow, costly against it. Overrides path direction under the character.

portal

Teleports, stairs, holes. Portal loop guard skips re-entered pairs per search — no infinite A↔B expansion.

conditional

Arbitrary callback per tile: return false (block) or a number (cost multiplier). Lava that costs 10 during a boss fight.

Example — Mud + Door + Portal

// Mud slows 5x5 area
IntelliPatch.addPatch({ id: "mud", type: "cost",
  area: { x: 3, y: 3, w: 5, h: 5 }, data: { multiplier: 5 } });
// Door opens only with switch 5 ON
IntelliPatch.addPatch({ id: "door", type: "block",
  area: { x: 12, y: 8, w: 1, h: 1 },
  condition: function(){ return !$gameSwitches.value(5); } });
// Portal from (2,2) to (18,15)
IntelliPatch.addPatch({ id: "stairs", type: "portal",
  area: { x: 2, y: 2, w: 1, h: 1 }, data: { toX: 18, toY: 15 } });

Stuck Policies — Never Freeze, Never Surprise

Every pathfinder eventually hits a wall (literally). IntelliPatch always tries an alternative road first (up to blockedRetries times, with live cache validation). Only when every recalc fails does the chosen stuck policy run. Lite only has recalc + giveup.

Policy Behavior Best For
recalc β˜… Keep hunting an alternative road (backs off, never gives up) Guards, patrols (Lite has this)
origin Walk back to where the order started, then onFail() Fetch quests that must reset
back_retry Step back along the trail, retry the target N rounds Narrow corridors
random Wander to a random tile within escapeRadius, retry Crowds, chaos
ghost Collision OFF for up to N tiles. Patches STILL apply. Restored after. Cutscenes that MUST arrive
giveup Stay still (state failed, onFail()) Standing still is correct (Lite has this)

Expert Script API — Extend Everything

Twelve register* hooks. All validated, warn-and-false on misuse, idempotent, never throw. Extend the plugin without editing a single line. Pro only.

registerHeuristic registerCostFunction registerPatchType registerGoalMode registerWaitCondition registerSteeringBehavior registerPatch registerCallback registerPreRecalc registerPostRecalc registerOnMapChange registerOnArrival

Example — Custom Heuristic (Enemies Prefer the Player's Facing)

IntelliPatch.registerHeuristic("biased", function(x0, y0, x1, y1) {
  var base = Math.abs(x0 - x1) + Math.abs(y0 - y1);
  if ($gamePlayer.direction() === 6 && x1 > x0) base *= 0.7;
  if ($gamePlayer.direction() === 4 && x1 < x0) base *= 0.7;
  return base;
});
IntelliPatch.setGlobalConfig("defaultHeuristic", "biased");

Example — Custom Goal Mode (Spread Formation)

IntelliPatch.registerGoalMode("spread", {
  resolve: function(goal, nav) {
    var ch = nav.character;
    var best = null, bestScore = -Infinity;
    for (var r = 1; r <= 8; r++) {
      var cands = [[ch.x+r,ch.y], [ch.x-r,ch.y], [ch.x,ch.y+r], [ch.x,ch.y-r]];
      for (var i = 0; i < cands.length; i++) {
        var d = minDistanceToOtherEvents(cands[i][0], cands[i][1], ch);
        if (d > bestScore) { bestScore = d; best = cands[i]; }
      }
    }
    return { target: best ? { x: best[0], y: best[1] } : null, done: false };
  }
});

Example — Bridge to PolyTrigger2D (Area2D as Goal)

// Wait until the player enters a PolyTrigger2D area before continuing
IntelliPatch.registerWaitCondition("inArea", function(areaId, nav) {
  var id = nav.character.eventId ? nav.character.eventId() : 0;
  return PolyTrigger2D.isInside(areaId, id);
});
IntelliPatch.moveToGoal(this, {
  mode: "sequence",
  points: [
    { x: 5, y: 5, wait: { inArea: 3 } },   // wait until player enters area 3
    { x: 20, y: 15, wait: { frames: 120 } } // then pause 2 seconds
  ],
  onGoalComplete: function() { $gameSwitches.setValue(99, true); }
});

Debug Overlay — See Everything

Turn on DebugMode and see the entire decision-making process in real time.

GREEN — PATH

Nodes remaining

RED — BLOCKED

Failed targets, walls

GRAY — VISITED

Last A* expansion

YELLOW — PATCHED

Pro only

PURPLE — GOAL

Pro only

CYAN — TARGET LINE

Pro only

Plus per-navigator labels: len=N rec=N state=... stuck=N fb=0 pol=...:N goal=mode:idx/total, click-to-inspect any tile in-game (logs every patch modifier applied), and console dumps:

IntelliPatch.debug() IntelliPatch.debugTile(x, y) <em>Pro</em> IntelliPatch.debugGoal(eventId) <em>Pro</em> IntelliPatch.debugRegistries() <em>Pro</em>

Lite stamps a LITE watermark in the corner of the overlay.

Quick Start

  1. Copy IntelliPatch.js into js/plugins/
  2. Enable in Plugin Manager, load order: VisuStella β†’ IntelliPatch β†’ CharacterBase overriders
  3. From an event Script call: IntelliPatch.moveTo(this, 15, 20);
  4. Or use Plugin Commands (MoveTo, FollowTarget, MoveToGoal, Simultaneous, ...)
  5. Enable DebugMode to watch paths (green), patches (yellow), goals (purple), targets (cyan)

Plugin Commands (23 total)

Movement (Lite: MoveTo, FollowTarget, DebugToggle)

MoveTo <span style="color: #4caf50;">βœ“ Lite</span> FollowTarget <span style="color: #4caf50;">βœ“ Lite</span> MoveToPath <em>Pro</em> WanderArea <em>Pro</em> ClearPath <em>Pro</em> WaitForArrival <em>Pro</em>

Goal System (Pro only)

MoveToGoal MoveToAny MoveToSequence MoveToClosest EventAt TwoEventsMeet GuardPost Simultaneous Swap ClearGoal

Patches (Pro only)

AddPatch (JSON) AddCostPatch AddBlockPatch AddPortalPatch RemovePatch SetPatchEnabled

Debug (Lite: DebugToggle)

DebugToggle <span style="color: #4caf50;">βœ“ Lite</span>

The Complete RMMZ Plugin Stack

IntelliPatch integrates natively with the other Rpx & Just Dev plugins.

Feature PolyTrigger2D StateMachine2D IntelliPatch
Real geometric collision shapes βœ“
Finite state machine + behaviors βœ“
A* pathfinding with binary heap βœ“
Reactive recalculation βœ“
Composable Goal System (20 modes) βœ“
Six stuck policies βœ“
12 register* expert hooks βœ“
Auto-bridge to the others βœ“ βœ“ βœ“

When all three are installed: PolyTrigger2D detects via shapes β†’ StateMachine2D reacts via states β†’ IntelliPatch navigates via goals. NPCs that see you, chase you with A*, flee through dynamic obstacles, sync arrivals for puzzles, phase through cutscene doors — all without a single parallel process.

What It Doesn't Do

  • Does not modify player movement (events only by default; player works when explicitly targeted).
  • Tile-based only — no 3D, no continuous navmesh, works on the 48Γ—48 grid.
  • Does not replace VisuStella Events and Movement Core — it coexists with it.
  • Does not guarantee perfect paths on maps with no passable tiles defined (check tileset passability first).
  • Lite edition only: 3-event session cap, no patches, no goals, no hooks, watermark on overlay.

Compatibility

  • βœ…RPG Maker MZ 1.0+ — PixiJS 5.x, alias-only, no core files modified
  • βœ…VisuStella Events and Movement Core — detected via Imported.VisuMZ_*, no double ticks (Pro; Lite uses base-class hook only)
  • βœ…Altimit / QMovement — pixel-movement safe
  • βœ…Any canPass override — respects character.canPass, falls back to $gameMap.isPassable
  • βœ…PolyTrigger2D / StateMachine2D — native bridge, area signals become FSM signals (Pro)
  • βœ…Save / Load safe — navigators cancelled on map setup, no functions serialized
  • βœ…Steam & Web builds — no Node.js required

Choose Your Edition

Feature Lite
Free
Area2D Pro
€9.99
IntelliPatch
€9.99
Mega Bundle
€12.99
Circle / Rect shapes βœ“ βœ“ βœ“
Polygon + Rotation + Vision cones βœ— βœ“ βœ“
StateMachine2D (FSM + behaviors) βœ— βœ— βœ“
Reactive A* + binary heap βœ“ βœ— βœ“ βœ“
Navigation patches (5 types) βœ— βœ— βœ“ βœ“
Goal System (20 modes) βœ— βœ— βœ“ βœ“
6 stuck policies 2 only βœ— βœ“ βœ“
12 register* expert hooks βœ— βœ— βœ“ βœ“
Debug overlay (green/yellow/purple/cyan) Partial βœ— βœ“ βœ“
Auto-bridge between all three plugins βœ— βœ— βœ— βœ“

🟒 Lite — Free

PolyTrigger2D Lite. Circle + rect shapes, layers, async proximity. See if Area2D fits your project.

🟑 Area2D Pro — €9.99

PolyTrigger2D Pro. Polygon, rotation, vision cones, signals, Area Forge.

πŸ”΅ IntelliPatch — €9.99

Reactive A*, patches, Goal System, 6 stuck policies, 12 expert hooks. The full navigation engine.

BEST VALUE

πŸ”΄ Mega Bundle — €12.99

All three: PolyTrigger2D Pro + StateMachine2D + IntelliPatch. Auto-bridge between them. Save €5 vs separate.

License

  • βœ…Commercial Use Allowed — sell your game, keep 100% of revenue
  • βœ…Modification Allowed — adapt it to your needs
  • ❌Redistribution NOT Allowed — cannot be sold or distributed standalone
  • βž–Credit Not Required — though it's appreciated
  • ⚠️Keep the Copyright Notice — the license header must remain intact
  • ❌No Warranty — provided "as is". Test before shipping.

πŸš€ The Road to Perfection

IntelliPatch is the first real navigation engine for RPG Maker MZ. Every RMMZ game that wants real AI, real puzzles, real pathfinding — this is the missing piece.

Have a feature request? A goal mode you wish existed? A patch type for your game? Tell us. Every piece of feedback shapes the next update — and the 12 register* hooks mean you can build your own extension right now without waiting.

Same codebase, one flag, all features unlocked. Upgrade any time.

Made with ❀️ by Rpx & Just Devitch.io · GitHub · rpxgames.win

Published 1 day ago
StatusReleased
CategoryAssets
AuthorRpx
Made withRPG Maker
ContentNo generative AI was used

Download

Download
IntelliPatchLite.js 96 kB