Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[discussion] intfic language "ink" #298

Open
dcsan opened this issue Jan 1, 2019 · 3 comments
Open

[discussion] intfic language "ink" #298

dcsan opened this issue Jan 1, 2019 · 3 comments

Comments

@dcsan
Copy link
Contributor

dcsan commented Jan 1, 2019

came across this and thought it might be interesting to you, it has some nice ideas.
more oriented toward point and click interactive fiction but has some nice flow-control ideas

http://docs.unfold.studio/user_guide/ink.html#part-one-the-basics

Once-only (marked with a !):

Once-only alternatives are like sequences, but when they run out of new content to display, they display nothing. (You can think of a once-only alternative as a sequence with a blank last entry.)

He told me a joke. {!I laughed politely.|I smiled.|I grimaced.|I promised myself to not react again.}

this is a big difference between rive and superscript, in that SS made an effort to track and not repeat replies to make conversations more natural.

inline conditionals

{ mood > 0:I was feeling positive enough | It was more than I could bear}.

conditionals

http://docs.unfold.studio/user_guide/ink.html#example-context-relevant-content

i much prefer this syntax to rive's stuff with * - which makes it really hard to test for multiple conditions.

=== dream ===
    {
        - visited_snakes && not dream_about_snakes:
            ~ fear++
            -> dream_about_snakes

        - visited_poland && not dream_about_polish_beer:
            ~ fear--
            -> dream_about_polish_beer

        - else:
            // breakfast-based dreams have no effect
            -> dream_about_marmalade
    }

tunnels

http://docs.unfold.studio/user_guide/ink.html#tunnels
allow you to have a piece of content that is called and returned from. more powerful than just a topic change which is like a goto. SuperScript had something like that i think with no-stay topic type
https://github.com/superscriptjs/superscript/wiki/Topics#topic-flags

@dcsan
Copy link
Contributor Author

dcsan commented Jan 1, 2019

the runtime is in C#, i guess to make it easy to use with Unity

https://github.com/inkle/ink
https://github.com/cproctor/unfold_studio

@dcsan dcsan changed the title language reference [discussion] intfic language Jan 1, 2019
@dcsan dcsan changed the title [discussion] intfic language [discussion] intfic language "ink" Jan 1, 2019
@dcsan
Copy link
Contributor Author

dcsan commented Jan 1, 2019

JS port of runtime
https://github.com/y-lohse/inkjs

@kirsle
Copy link
Member

kirsle commented Jan 16, 2019

I like their syntax! The features you quoted would be good for RiveScript too and not too difficult to implement...

  • Adding && and || support for *Condition would be very beneficial for RiveScript, even with the ugly ^Continue command to make it ""readable""
    • conditions = left_side.split(/(&&|\|\|)/)
    • conditions = [ "<input1> != undefined", "&&", "<input1> == <input2>" ]
    • Have the code step through the array and do what it currently does with each element. I'd probably keep it simple (read: left-to-right) so it would evaluate the first condition, and then (depending if it was truthy or falsey) decide whether or not to continue if the next element is an && (if true) or || (if false).
    • Should be backwards compatible, I don't use symbols like && and || in RiveScript that way.
  • Inline conditionals could be brought to RiveScript with some unique tag syntax.
  • Tunnels and once-only would require some additional storage for state variables to keep track of all this stuff. (it might be possible in RiveScript right now to: set a {topic=} and then <@> redirect to somewhere, and maybe from there set the {topic=random} back where you came from. But I think I ran into issues doing weird stuff like this in the past)
    • RiveScript wasn't designed with the use-case in mind to follow a trail of redirects and topics and re-evaluate triggers and replies along the way. Simple cases work well but the topic variable gets confused a little bit, and each time you @Redirect it essentially re-starts the reply() process while keeping exactly the same initial conditions of the reply: your input history and such are exactly the same during a redirect for example, so some uses of %Previous can get you into infinite loops currently (not too common in practice tho)

I think if I ever decide to overhaul RiveScript and add tons of new features (possibly new/changed syntax) I'll start to consolidate down to the Go version so I only have one codebase to maintain -- and Go can compile to JavaScript via GopherJS or to WebAssembly now, while also providing bindings to any other C-compatible language. Only "small features" for the 5 implementations of RiveScript for now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants