AleksLitynski/teller

Storing "scripts" in the graph

Opened this issue · 1 comments

I'd like to store game "scripts" in the graph. I can see two ways to do this.

  1. In each node, we store a function in a certain language. The function will be called from a framework that passes into the function it's place in the graph and where it can flow into. We execute the script and then move to the next node.
  2. We parse scripts into a more primitive form. Actually breaking them up at each branching point in the code and store this "semi-compiled" form of code in the graph.

You can think of the graph as having two parts. The types and the data.
The database will only act on type information. Data (or values) are off limits to it. There will be no built in assumptions about what is stored in the graph.
Like a database having no idea what goes in a column or a programming language having no idea what the value of an int is.

"Scripts" are things that act on values.

Scripts can break into two categories.
Constraints and Verbs.

Constrains will execute within the database. They will define "facts". A person can only have 3 hands. A foot is 1/3 of a meter.

Verbs execute outside the database. You can store your decision tree and it's consequences in the database, but it's up to your to traverse it and tell the database to make changes based on it.

I hope they have the same syntax, although I'm not sure what it will be.