Definitely appreciate input.
Yes, vertices and nodes are the same thing, but in a graph data structure, we have a list of Nodes (vertices) that contains a list of Edges.
I’m still in experiment mode, so unsure how connections will work (yet).
I’m in the midst of defining how Directions and Exits work and it’s not simple. In Inform 6, Directions are a part of the default Go verb (GO NORTH). But there’s so much cruft in that assumption. It’s easier to define Directions as their own thing like this:
public enum TokenType
{
Verb,
Noun,
Second,
Third,
Adjective,
Article,
Preposition,
Direction
}
In the Parser we now check for directions first. I had thought to make each direction its own Verb, but we lose a lot of compass fidelity that way (like handling going nowhere or anywhere by X).
But the graph itself will definitely have Edges that connect two Location Nodes. How I implement the Directionality is a work in progress. I’d started with adding a property on Start and End sides of the Edge for directions. First, we look for an Edge that shares two locations and then determine which directions are used. If I’m trying to go east from Location A, the shared Edge start property “east” should exist and if it doesn’t, you can’t go east from Location A.
However, we need to handle any failed directionality properly and allow the author to define success and failure. That’s where I am at the moment.
Note the code is at: ChicagoDave/chatgpt-ifplatform: I used ChatGPT-4 to design and code an Interactive Fiction platform on top of .NET/C#. (github.com) and compiles. If you have VSCode or Visual Studio, it’s easy enough to clone and run. Cross platform .NET Core too, so Mac, Linux, or Windows. And it’s a console app for now, so no GUI is needed.