50 ConversationNo longer just copying old systems into the Unity prototype, but trying new ones out there first. Nodes came first with the last update. Now I'm figuring out how to have characters talk to you and help you deduce things.
ChatbotThat's basically what it is!
Compare
the GIF in the last post to this new one:
You'll notice it's a lot more robotic, but the cool thing is that underlyingly it's dynamic and not so hardcoded for any particular conversation, tho as a proof of concept still more so than the final version will be.
DefaultsBasically it takes into account what kind of info you've selected, if there's a thread ongoing, how things relate to each other and so on, and adjusts what's said accordingly. Just so that it works in general.
SpecificsOf course the point of the game is to be story-driven, and I want to tailor as much dialogue as I can muster to make these people feel real and move things forward. Thus defaults will have to come in multiple variations and more importantly I have to be able to override defaults where desired.
DataFor those specifics, as well as in order to get all the possible connections into the game, I wanted to figure out a data-driven approach. I mocked something up:
"infos":
{
"tarragon-birds-inseparable":
{
"witnesses": ["tarragon", "mustard", "fennel", "bayleaf"],
"parts":
[
{
"target": "tarragon",
"label": "inseparable",
"value":
{
"type": "profile",
"value": "birds"
}
},
{
"target": "birds",
"label": "inseparable",
"value":
{
"type": "profile",
"value": "tarragon"
}
}
]
}
}
So that's how you might mark up the inseparable relationship between Tarragon and the birds, as well as a list of the people who'd be able to give you this info. Not everything would necessarily be strings, and perhaps types of relationships would be declared somewhere else and referenced in the info parts, but yeah.
Then comes the magic part:
"connections":
{
"tarragon-birds-inseparable":
{
"paths": [["tarragon", "birds"], ["birds", "tarragon"], ["birds-surround-tarragon"]],
"results": [{"type": "info", "value": "tarragon-birds-inseparable"}]
}
}
You tell the game what paths you can take to unlock a particular connection; here you can either select Tarragon's profile followed by the birds', or the other way around, or even the snapshot node of the birds surrounding Tarragon in-world, and the relationships as outlined in the info markup we just saw will be the result.
And a C# adaptation of this kind of data is indeed what drives the stuff you saw in the GIF above.
m_connections.Add
(
"t-inside-th",
new Connection
{
paths = new string[][]
{
new string[]{"t-tf-inseparable", "tf-surround-th"},
new string[]{"tf-surround-th", "t-tf-inseparable"}
},
results = new ResultConnection[]
{
new ResultConnection
{
type = TypeResultConnection.unlock,
value = "t",
comments = new Textbox[]
{
new Textbox
{
text = "Oh, my goodness! How did I not realise?! Let's go over there right away!",
speaker = Subject.NPCM
}
}
}
}
}
);
That's the connection setup for sussing out where Tarragon is in the present by combining Tarragon's inseparability from the birds with their surrounding a particular building. And a tailored, specific response from Mustard specified right there in the data, like I alluded to before.
In the final version this stuff is supposed to live in data files and not in code, more like the JSON format shown before this.
ConclusionsSo I've done some back and forth over the last few days between trying to think up how to make this all work and trying to code some of it up and dealing with unforeseen issues, the usual. In the final game I'll also need localisation hooks, but in the prototype of course it's just hardcoded for English.
One thing I want to change is to allow you to select different questions from a dropdown when you select a piece of info, so if you select a name you can either start a thread involving that person, or you might just ask in general "what can you tell me about this person?". I think this dropdown will appear even if there only is one option, just to allow you to preview your question and choose not to ask it if it's not what you had in mind.
We're not far from getting something up and running in the real game now!