To allow creation of new quests/puzzles with npcs.
Help make items useful (example: trading, buying)
Make the game more rich by allowing game designers create rich dialogues
Context aware npcs
Talking with npcs should enter in a loop where each npc will have their own set of commands. Some commands have side effects that the npc MUST remember! For example:
me: talk bob
bob: hey, ask me anything [ ballroom, about, stfu ]
me: ballroom
bob: i heard somenthing tonight do you want know more? [ yes, no, stfu ]
me: stfu
bob: ???
me: talk bob
bob: ....
me: talk bob
bob: ....
Directed Graph implementation
Specifics
NPC stores a graph, a nodes array and a edges array.
The directed graph will be used to guide the dialogue.
Nodes are a powerful data structure that have the instructions to be processed. I gave an example below.
Each node have at least a text and a trigger. Text are just the current npc speech. trigger is the command that needs to be used by the player to trigger this specific node.
The graph structure implementation is up to the developer in charge
After graph is implemented we need a interpreter to interpret the nodes and do the actions.
Rationale:
Context aware npcs
Talking with npcs should enter in a loop where each npc will have their own set of commands. Some commands have side effects that the npc MUST remember! For example:
Directed Graph implementation
Specifics
graph
, anodes
array and aedges array
.Nodes
are a powerful data structure that have the instructions to be processed. I gave an example below.text
and atrigger
. Text are just the current npc speech.trigger
is the command that needs to be used by the player to trigger this specific node.https://github.com/jinc0930/Clue/blob/1c40fac26590f59733e3f698544e49488f08f910/character.c#L383-L409
Tasks
character.c