Smart NPCs: Modular AI for UnityA guard hears a noise, leaves their patrol to investigate, then picks up the route where they left off. You decide what they can hear, which tasks they can interrupt, and how they react when they find the source.Smart NPCs gives you two ways to build characters using the same behaviour modules. Use a finite state machine (FSM) for a character with a routine, or use GOAP with configurable needs for a character that weighs its options. A survival game can use all five utility factors. A town guard can get by with a patrol route, hearing, and a memory of past encounters.Plug in your own gameplayBuilding a survival game? Add warmth as a custom need and warming up at a campfire as a custom action. Add your need to a Utility Profile, attach the action to a campfire, and tune how strongly a cold NPC favours it. The existing GOAP system weighs your action alongside eating, resting, and seeking shelter. The NPC Debugger shows you why it won or lost.You can also connect behaviour directly in the Inspector. Hook a guard’s On Arrival event to your own alarm when they reach the source of a sound. For deeper changes, the included C# source gives you the same action, module, and utility interfaces used by the built-in behaviours.What you can buildRoutines that respond to the world. Create patrol routes and resting areas, configure sight and hearing, and choose when an NPC can break from its current task. Combat and dialogue modules give you starting points for your own encounters.Needs with visible consequences. Tune hunger, fatigue, emotion, thirst, and safety per profile. A thirsty NPC can choose to drink, use one water item from its own inventory, and move on to a different activity. Add custom factors for needs specific to your game.Characters with individual memories. Two NPCs can remember the same player differently. Record positive or negative encounters, connect their reactions to UnityEvents, and carry those memories into your own save system.Populations with different levels of simulation. Set how many NPCs run their full AI at once. Distant characters can use simplified movement, stand in place, or sleep according to your settings.Build, inspect, and extendStart with the demo scene or generate an NPC using the included editor tools. In Play Mode, select a character in the NPC Debugger to inspect its inventory and record its next GOAP decision. If a hungry NPC keeps patrolling, you can see whether eating scored lower or the NPC simply had no food.The package includes C# source code and a user guide covering setup, behaviour modules, and custom actions, so you can follow a decision from its settings in the Inspector to the code that runs it.PS: everything related to this tool was human-made. No type of generative AI/LLM has been involved.

