inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.12k stars 492 forks source link

How do I structure multiple characters stories? #317

Open bobsgit4unity opened 7 years ago

bobsgit4unity commented 7 years ago

I'm creating a game in Unity. It mostly involves character interactions. So if I'm interacting with a character, then I go do something else, possibly interact with other characters, when I come back to the first character, I want to pick up where the conversation left off. I currently have each character's story in their own knot. Right now I only have 1 scene and my solution is working for the most part. I'm not quite sure what I'll do yet when I add a second scene.

Also I'll be tracking stats on these characters, similar to a reputation system, where different dialog options will open up based on your reputation with that character.

I'm wondering what the best way would be to structure this type of story in ink.

joningold commented 7 years ago

Hi there!

There's no easy answer; it depends on exactly what you want your scene to do. You might be able to do something as simple as a "character hub" === main_hub

=== jim

So each question has a response; they're once-only. If you choose anything except "walk away", the flow will drop down to the looppoint, and then ping back up to the top for another question. And if you want to come back and talk to Jim again you can ask things based on what you asked last time.

Things get trickier if you want to be able to walk away at any time, in the middle of a more linear conversation, but ultimately it'll be this kind of structure just with more conditionals to get the flow you want.

cheers jon

On Wed, May 17, 2017 at 1:30 AM bobsgit4unity notifications@github.com wrote:

I'm creating a game in Unity. It mostly involves character interactions. So if I'm interacting with a character, then I go do something else, possibly interact with other characters, when I come back to the first character, I want to pick up where the conversation left off. I currently have each character's story in their own knot. Right now I only have 1 scene and my solution is working for the most part. I'm not quite sure what I'll do yet when I add a second scene.

Also I'll be tracking stats on these characters, similar to a reputation system, where different dialog options will open up based on your reputation with that character.

I'm wondering what the best way would be to structure this type of story in ink.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/inkle/ink/issues/317, or mute the thread https://github.com/notifications/unsubscribe-auth/AA40o9-f4qx60FlnDFxdb-LUJMlkIfgbks5r6j-0gaJpZM4NdPHk .

joethephish commented 7 years ago

Note that depending on the structure of your logic, you could also cache the text and choices from each conversation on the game side, in order to maintain the state of the conversation exactly where you left off without setting up anything special on the ink side.

The problem with this approach is that you can potentially get yourself into a pickle with the story state - if you're deep into a set of tunnels then these won't be preserved if you clean up with ResetCallstack(). If you don't clean up, then if you do a ->-> after jumping between conversations, you may tunnel return to somewhere in the previous conversation. If you have a simple story though without any tunnelling, this approach may work. Otherwise, you'd have to encode all the logic in the ink up front, as Jon says.