ResponsIF

jaynabonne
This isn't a game as such, but I hope this sort of announcement is ok as well.

For the past year and a half, I've been working on a JavaScript version of the original Quest "Response Library", but as a standalone SDK. I feel it's to a point now where people can look at it without running away in terror (though that might still be a reaction). It doesn't have a complete game worked up yet, and I haven't proven all the things I want to prove are possible with it yet, and it doesn't include some key features like being able to save and reload a game in progress. But it's in a form where people can look at it and see if it seems interesting.

It's available from github:
https://github.com/jaynabonne/responsif

There is a doc folder with two PDFs: a "user's guide" (https://github.com/jaynabonne/responsif/blob/master/doc/ResponsIF%20User's%20Guide.pdf) and a "phrase book" (https://github.com/jaynabonne/responsif/blob/master/doc/ResponsIF%20Riff%20Phrase%20Book.pdf). The concepts in the former might help make sense of the latter. You don't have to download the repo to look at the docs. You can click on them directly or download them individually.

If you do wish to try it out, just clone the repository or download it as a zip. Once it's local, you should be able to open the samples with a browser (Chrome has problems, though, in that it can't deal with local files without a command line switch. I have successfully used Internet Explorer, Firefox and Opera. I've had to set up a local node http server to use Chrome.)

The Meek sample and the samples in the "sample" folder all have the same structure: a main index.html file and style sheet, with the actual ResponsIF source file(s) in the "data" folder. Double-click the index.html to launch it. (The Meek sample is the game I've been using to drive the development. It's barely beyond the "started" phase, with a title screen and some initial interactions. There are lots of holes and things to be fleshed out. But it might give a feel.)

Not all of the samples are polished. They were mostly experiments I made when working on features to make sure they worked, and I enshrined them as samples, as they seemed potentially of interest. They should be good to look at to see how things can work, but they're not terribly exciting.

Unfortunately, for now, you have to create riffs using a text editor. I don't have a GUI front-end for it, yet. I hope to someday, but it's not a reality yet.

It's suited more for CYOA/gamebook/hyperlink games as it stands, though you could slap a parser on the front if you wish.

To make your own riffs, you can copy a sample and edit it. (Since it has references to the JavaScript files, it might be easiest to keep any such tries in the sample folder. Ask if you need to package it up separately.)

If you wish to publish to the internet, you can zip up your folder along with the JS files and then upload it to the textadventures site. You would have to get it in the right structure to do that. If you happen to get that far along and you have trouble (high class problems), let me know, and I'll be more than happy to help. But that's down the road a bit, I assume...

At any rate, if you're curious check it out. The docs might be interesting even if you never actually try it out.

And it's free!

jaynabonne
I also have the beginning of a blog of sorts, with random rumblings, some related to ResponsIF. In case anyone finds *that* interesting as well...

https://aniamosity.wordpress.com/

Ok, self-promotion done.

jaynabonne
One thing I need to mention is that how the world state gets set up has changed. Before there were immediate "set" and "move" phrases, which have been removed. There is now a general "setup" phrase, which the samples and the phrase book shows. The user's guide doc is out of date in that respect.

XanMag
jaynabonne wrote:I also have the beginning of a blog of sorts, with random rumblings, some related to ResponsIF. In case anyone finds *that* interesting as well...

https://aniamosity.wordpress.com/

Ok, self-promotion done.

...Holy cow. I think I understand what you intend to do, or more so what you already have been doing with ResponsIF. I think the idea is fascinating, but unfortunately I have a hard time understanding the code that would drive this. I think you intend on creating it and making it publicly available to use? If I'm correct, I either hope I get to the point where I can understand it OR I hope you create it in a way that is really user-friendly! Perhaps it will be both.

If you want I'd be glad to help in any way possible but keep it in the testing, game creation realm for now and away from the coding part of it!

Good luck and keep me (us) updated!

jaynabonne
Actually, I'm more interested in anyone willing to try to use it to make games. I'm fine with the coding side, unless anyone wants to chip in. But it's really someone on the "using" end I'd be really wanting to have a look and maybe try. :)

XanMag
Sign me up.

jaynabonne
Sounds great! Probably the best place to start is the docs. (In fact, you might want to peruse them before you sign up for anything, if you haven't. :) )

And let me know if you have any questions.

george
Cool Jay, maybe get your blog on http://www.planet-if.com/ ?

Just starting to skim the RIF repo, and I was wondering if you had a look yet at Inkle's scripting language Ink. Just an idle thought. https://github.com/inkle/ink . Your data files made me think of it.

jaynabonne
Thanks, George! I'll check out planet-if.

As far as Ink goes, I did a quick scan. I'll have to take a deeper look later.

george
Well I just finished reading the user guide, and I have to say this is an impressive piece of work. I've seen plenty of IF systems but rarely one like this that has exciting ideas about how to develop IF. I'm going to start playing with it this weekend!

Do you have any plans to move the pdf docs to a wiki or anything like that?

jaynabonne
That's great, George! I look forward to any feedback or thoughts you may have.

To be honest, I had no plans for a wiki because, until you mentioned it, it hadn't occurred to me. :) My concern at this point is more about the lack of a forum for people to communicate about ResponsIF. It's something I need to work on. A wiki sounds interesting, but I see it as an alternative form to the PDF docs at the moment, and one that requires you to be online, to boot. Out of curiosity, are there advantages you can see to a Wiki over a PDF (beyond, perhaps, that it can be community maintained)?

george
I think the main advantage of a wiki is it'd be a little easier to browse, and also to point people to specific sections of it via URL. Also at a certain point you might be able to automatically generate API docs (like the phrase book) and put them in the wiki as well. It'd be a central spot for people to put tutorials, etc. Something like this, https://github.com/evennia/evennia/wiki . Incidentally, if the wiki is on Github you can clone the repo and have it offline.

Forum-wise it seems like, by the good graces of Alex, you could hijack this forum for a while :).

jaynabonne
The blog has moved: http://www.aniamosity.net/

Self-hosted instead of wordpress.com. Now to see how to set up forums!

jaynabonne
george wrote:Forum-wise it seems like, by the good graces of Alex, you could hijack this forum for a while :).


Just saw this. :) Ah well. Assuming I don't make a complete botch of it, there can always be links!

I hadn't thought of a wiki on github (or known of such a thing). A lot to learn yet. Thanks for the information. :)

george
Samples work well, I like the styling of Meek, nice job!

Just curious, which node http server do you use to serve the files (as I primarily use Chrome for web browsing)? This one, https://www.npmjs.com/package/node-http-server?

I'm using Python's standard server now but I don't have much experience with node.

jaynabonne
Yes, that's the one I use. You can use npm to install it, and then just run http-server in the directory you want to serve. I have a batch file with these lines:

cd C:\Users\jay\MyPath
http-server

jaynabonne
Well after battling trying to get things the way I wanted (during which time, it would randomly go missing), I finally gave up and left it with the default location. So some nascent forums are here:

http://www.aniamosity.net/forums/forum/responsif/

george
Are you adding login credentials manually Jay? I didn't see a register link.

george
First question, I'll put it here for now. I'd like a typewriter effect, however I don't know how to make it work with the way RIF outputs text. For example, given the response


.responses player
.response START
.does
.invokes
var string = "This is a sentence to typewrite...";
split = string.split("");
len = split.length;
count = 0;
function callback() {
if (count != len) {
interact.say({ text: split[count]}, responder);
count++;
}
};
setInterval(callback, 200);
.end


The text output looks like


T h i s i s a s e n t e n c e t o t y p e w r i t e . . .



I guess because interact.say automatically adds a space? What's a good way to change that?


edit:

Here's one idea, what do you think?


.responses player
.response START
.does
.says <span id="container"></span>
.invokes
var string = "This is a sentence to typewrite...";
split = string.split("");
len = split.length;
count = 0;
line = "";
function callback() {
if (count != len) {
line += split[count];
interact.say({ text: line, into: "#container"}, responder);
count++;
}
};
setInterval(callback, 200);
.end

jaynabonne
I think the second approach would work.

This brings to mind a possible feature: having "onto" instead of just "into". "into" would replace the text. "onto" would append. That way you could just keep adding characters, one by one, by saying onto... I could look into adding that. It wouldn't be too hard.

jaynabonne
Ok, I have implemented "onto". And it seems to work, too. :lol: It has been pushed to the github site. NOTE: If you update to the latest code, you will probably need to clear your browser cache. Browsers seem to like to use cached versions of .js code even when it has been updated.

So you can just "say" characters onto the element, and they will be appended. This typewriter thing does cause some thoughts for me, though.

First, for what you're trying to do, you might be better off just appending the characters to the span yourself with simple JavaScript. The reason is that "say"'s real power comes from things like expanding the various kinds of markup, applying styles, etc. And these simple sort of typewriter effect implementations (character by character) suffer from not being able to deal with any sort of markup, even HTML tags, as you can't output them a character at a time. The code would need to be smarter and parse the string to see what's text and what's markup and then apply the markup intelligently as characters are being output. That could be an interesting programming challenge.

Here is a different way to handle a typewriter effect, though not necessarily a good one (but more in line with a response approach):

.define says-next
.says .<value> .onto #container
.enddef

.responses player
.response START
.does .says <span id="container"></span>
.invokes
setInterval(function() {
interact.call([{keyword: "NEXT"}])
}, 100);

.response NEXT
.does 1 .says-next T
.does 2 .says-next h
.does 3 .says-next i
.does 4 .says-next s
.does 5 .says-next &nbsp;
.does 6 .says-next i
.does 7 .says-next s
.does 8 .says-next &nbsp;
.does 9 .says-next i
.does 10 .says-next t
.does 11 .says-next !

.end

Ugly, I know, and a pain if you had long text, or a lot of it. It could lend itself, though, to other situations, like if you wanted to output words instead of characters (like what spondre did on its title screen). It also would allow you to put markup in the stream, though it would have to be output in chunks (e.g. an entire name). (It does need a way to stop the timer though. Otherwise, it will keep calling the NEXT topic over and over forever. I think it would be useful to expose a function like "is topic supported", and you could then call the topic until it's no longer supported.)

That makes me realize that the markup processing abilities of "say" should be able to be leveraged in non-output situations: for example, building a string. (That's one thing I had wished Quest had - the ability to parse the text processor markup into a string instead of just to output.) I'm just about to slightly rip the "say" code apart, trying to get "as" to work on nested calls (e.g. with call markup). Right now, the "as" class is applied after the entire string has been assembled, which works for simple cases but isn't right in general. I need the code to be able to apply classes piece-by-piece,w which means being able to hang onto a non-text representation internally. So I've been refactoring the code in preparation for that. I'll keep in mind how easy it would be to have it be able to generate a string instead of HTML DOM elements. That way, you could fully expand a string (with variables, call markup, etc) and then output it in typewriter fashion, or do whatever you want with it.

My example also makes me think it would be useful to have a better sequential notation than the "does ###" one, since the number has to vary each time and be explicitly stated. I'll have to think about that. (Perhaps "does next" or something. Then that part could be rolled up into the macro as well.)

Probably more detail than you needed, but where my head is right now. :)

It certainly seems like people like this typewriter effect.

jaynabonne
I also need to come up (I think) with a way to pass multiple parameters to a macro expansion. I keep wanting to bury my head in the sand and say, "One is enough. One is enough." But I keep running into situations where multiple variable parts would be useful. Another for the "to do" list.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums