PraxTube / lost-oppai

MIT License
5 stars 0 forks source link

feat: Add graph representation of dialogue #17

Closed PraxTube closed 2 months ago

PraxTube commented 2 months ago

I will need to convert the yarn files into graphs (player options representing vertices and the path from and to each option representing the edges, at least I think, not even sure about that one yet). The reason I need this is because it's super easy to get lost in all the yarn nodes after a while and accidentally create loops within multiple nodes. This isn't detrimental, but it would be super weird for the player to see the exact same dialogue multiple times.

So that is why I need a graph representation so that I can easily check for loops within multiple nodes (because it should be a tree, unless we allow loops). If there is a loop, either remove it or account for it by marking the player options with <<if>> statements, this would be kinda shit because I would need to introduce more variables and make sure those are properly set etc. but it would fix the problem while allowing decent flexibility, maybe I could even incorporate that into the graph representation.