From 44f782c8b4d8082e5ea1a56548a82995fb892588 Mon Sep 17 00:00:00 2001 From: Hector Kio Date: Mon, 18 Sep 2017 01:53:06 -0400 Subject: [PATCH] Updated Dev_Actions_Schedules (markdown) --- Dev_Actions_Schedules.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dev_Actions_Schedules.md b/Dev_Actions_Schedules.md index ba53d89..498d90e 100644 --- a/Dev_Actions_Schedules.md +++ b/Dev_Actions_Schedules.md @@ -1,9 +1,9 @@ -Actions and Schedules -====================== +# Actions and Schedules The interesting part of Advanced NPC is its ability to simulate realistic behavior in NPCs. Realistic behavior is defined simply as being able to perform tasks at a certain time of the day, like usually people do. This allow the NPC to go to bed, sleep, get up from it, sit in benches, etc. But how all of this is simulated? The answer is: tasks and scheduling. The implementation resembles a rough OS process scheduling algorithm where only one process is allowed at a time. The processes or tasks are held in a queue, where they are executed one at a time in queue fashion. Interruptions are allowed, and the interrupted action is re-started once the interruption is finished. -###Actions and Tasks + +### Actions and Tasks Actions are "atomic" executable actions the NPC can perform. Tasks are sequences of actions that are common enough to be supported by default. Advanced NPC supports 16 actions and tasks by default which can be used together to simulate tasks that players can do. Each action or task is wrapped on a Lua table which tells the action/task to be executed and the arguments to be used. However, this is encapsulated to the user in the following two functions: - `npc.add_action(action, args)` - `npc.add_task(task, args)`