Narrative Logic and Data Structures


For the past few weeks I've been considering Conversation Trees and game logic control.  I think I've had an interesting epiphany.

For those not in the know, a Conversation Tree (also known as a Dialog Tree) is how talking to a non-player character (or NPC) is often handled in video games.  For example, you talk to someone and the game presents you with a list of things you could say to them, then the conversation branches out from there, with each choice often going down a different path.  This is an old, tried-and-true technique in games to allow player choice.

At it's core, this boils down to a simplistic state machine (I'll not get into that in this post; search the internet for Finite State Machines if you want to know more) that represents the player's relationship with an NPC.  In some games, the NPC's behavior in the game can be affected by conversations with them.

Now for my epiphany: why not handle the narrative of a game with much the same technique?  So, a conversation tree becomes a Narrative Tree and the narrative becomes a state machine that determines current events.  The Narrative Tree represents all of the things that can happen in the game.  As the player makes a choice, it redirects the narrative down a new path, possibly blocking other options from working in the future.  Depending on the game's design, NPCs could easily be setup to affect the state of the narrative.

So, in the end, the narrative of the game becomes a set of state machines for everything that can affect the narrative, such as each unique location, NPCs and the player.

Additionally, game menus could easily be handled with the same data structures.  It's all just a matter of what code is triggered as a result of each choice.

Get Big Block Engine

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.