User Tools

Site Tools


NPC Behavior

NPC Behavior determines how an NPC moves around the map and reacts to their surroundings. It can be configured in the Map Editor from the “Behavior Settings” section of their Entity Properties panel.

Refer to the table below for a description of each setting.

PresetUnique name for the set of behavior rules. To store the current settings to a named preset, click the “Save” button to the right of the dropdown box. The “No Behavior” option indicates that this NPC will be immobile and cannot be interacted with in any way.
When Player InteractsDetermines what will happen when the player character interacts with this NPC. If the “Start Dialogue” or “Start Battle” option is selected, an additional dropdown will allow you to choose which dialogue or battle to start.
When Next to PlayerDetermines what will happen when this NPC is on a tile adjacent to the player character. If the “Start Dialogue” or “Start Battle” option is selected, an additional dropdown will allow you to choose which dialogue or battle to start.
Can Trigger ScriptsWhen enabled, this NPC is able to trigger scripts on tiles, for example when stepping onto a trap or a hazardous tile. The “Triggerable by NPCs” option (see Entity Properties) must also be enabled for a tile's script in order for the NPC to trigger it.
Attackable in Real-TimeWhen enabled, this NPC can be attacked in the game world in real-time. Their loot drop and experience points that will be given to the attacking character when defeated can be set if this option is toggled on. Their stats, like health and attack strength, are configured from the Model Properties panel of the Voxel Editor.
Movement AreaDetermines where this NPC is permitted to move, for example to any open tiles or only those within a group defined for the map.
Movement IntervalDetermines how long this NPC will wait (in seconds) between each movement attempt. This can either be a fixed value or a random value within a range.
Movement DirectionDetermines the direction in which this NPC will attempt to move. This can either be a random direction, a relative direction (forward, to their left. etc.), or an absolute cardinal direction. With the “Random” option, they will only move if the randomly selected direction is passable and unobstructed, while “Random (Forced)” indicates that only open paths should be considered (therefore they will always move if an open path is available).
Reaction to ObstacleDetermines how this NPC will react to an obstacle in their path. The options currently include turning left, turning right, reversing direction, or stopping permanently.
Player InterestDetermines if this NPC should attempt to move towards the player character (“Seek Out Player”) when at a certain distance, or attempt to move away from them (“Avoid Player”). If set to “None”, the player character's proximity will have no effect on the NPC.
Interest RangeDetermines how close the player character must be in order for them to either be sought out or avoided by this NPC. This value is measured in number of tiles.

In the example below, the slime has been configured to always move forward at an interval of zero seconds. It is also configured to turn right in reaction to an obstacle.

npc_behavior.txt · Last modified: 2020/05/11 09:51 by justin