The Future of Quest?

I have been having a play around with JavaScript, building a new version of Quest. Note that this will not work with existing games, and as yet there is no editor. There definitely will be an editor eventually. There may be a way to convert files from Quest 5, at least to some degree, one day.

What there is at the minute is a framework to create games in JavaScript.

You can see an example game here. There is not much in the way of plot, but stuff to interact with to see how the world model feels. Let me know if there is anything important I see to have missed out.
http://textadventures.co.uk/games/view/48pkf40on0soigganjtatq/first-steps

Why JavaScript?

Better for players

  • No lag between turns
  • Game does not time-out

Better for authors

  • Authors can upload games to their own web site
  • Authors are learning/using JavaScript, the computer language of the internet, rather than ASL, which is exclusive to Quest 5.
  • Authors can change absolutely anything in the game system; everything is accessible

Better for me

  • No need to support legacy games in the app (Quest 5 and the web player both have to support every version of Quest 5, and Quest 4 (and I think all the way back to Quest 1).
  • Updates are far easier to publish without legacy support

What else?

As I was building this from scratch, I could build in some features from seem lacking or are tricky to implement in Quest 5. The parser has a better idea of context, looking at what objects are where when matching commands, so should be better able to guess what the player means when it is ambiguous.

As much as possible is neutral with regards to the character (i.e., works for both the player character and NPCs), making it easy to add commands allowing the player to command an NPC.

Objects can be in several rooms at once. Countable objects that have specific numbers at different locations are built-in.

See more...

More details here, including a tutorial on how to create a game in this framework.
https://github.com/ThePix/QuestJS/wiki


I this is new, from the ground up, can I add an idea...
When the script has a get input command, the script stops and waits for the player to answer it?
This way, there is no need to nest get inputs inside of get input...
IE:
msg("Hello player, what is your name?")
get input
// script stops waiting for the answer...

or even:
get input player.alias

Then you could do this:
// player set-up
msg ("Name?")
get input player.alias
msg("sex: (M/F)")
get input player.gender
msg ("{player.alias}, what is your class? (Fighter, Thief, Cleric, Magic User)")
get input player.class

direct, no nesting, and no need to keep track of how many nests you did...


That is built-in to JavaScript already, with the prompt function.

      msg("'What's you name?' she asks.");
      var name = prompt("Your name?");
      msg("'Hi " + name + ",' she says. 'You're very sweet.'");

That is what I was suggesting...
And not that far from Basic's input command...


Couple of thoughts on possible next steps with Quest

  • I've been playing with the code base, writing and testing stuff for the last couple of months.
    I thought of perhaps implemeting some improvements into how the script language works, but have reached the conclusion that 5.8.0 code base is too interconnected and too complex to refactor and improve - making it much more efficient to do a rewrite from scratch.
  • I've been thinking about a good way how something like Quest can be implemented from scratch. I am wondering - have you looked at the possibility of using the Electron project as UI and self-hosted ASP.Net Core endpoints as actual functionality? (they can be self-hosted using in-process Kestrel server)
    Another potential bonus in such approach - since Electron based apps are essentially websites, it should be relatively easy to implement a web-based player.

The Electron project is essentially a Node.js application that hosts border-less browser window with Chromuim as UI engine - it is essentially similar to what Quest 5.8 uses currently so existing UI code can potentially be re-used, and "backend" using .Net Core could be leveraged to re-use some parts of existing code.

I don't have too much free time, so my progress in this is very slow, but I did some testing - it is certainly possible. (Node.js interop with .Net to start the self-hosted ASP.Net Core server can be made possible by the Edge library)


You built all this from scratch in a month and a half? Respect! I am curious how it will develop.


myarichuk

I was looking around for a good framework for the editor, and came across Electron. KV recommended it too. It does look to be the best solution. At the moment I am looking at a desktop system, but that should be cross-platform, if built on Electron. I have very little experience do this sort of stuff on a server, so that will take rather longer...


hi so I’m not sure if my reply to this is posted or not so I’m trying again I am totally blind and play these games I have tried to use the web player but I have found that it is very clunky because when you type in commands the screen reader does not read back what the command is so you have to swipe around on an iPhone to see what the command was which is what I would like to use to play these games now using quest on the computer works fine but that’s only with the application itself so what would be nice is to see away in the web player where you could type in a command and then have the screen reader automatically read back the response instead of making you go find it in the history of responses for example when you type examine cat the player should automatically re-ply The cat is round and fluffy instead of making you having to swipe left to see the response of the cat is round and fluffy I hope I explain this well enough but if not let me know and I can try to explain it better


So... maybe a text-to-speech option???


H2359

I have added a SPOKEN command to the test game, which may help (only tested on Chrome). That said, if you are using a screen reader anyway, it may make it worse, as you may get everything twice.

http://textadventures.co.uk/games/view/48pkf40on0soigganjtatq/first-steps

DarkLizerd

There is a text-to-speech option in desktop Quest 5 (or at least there is if you have some extra software). H2359 is wanting to use it on the web player, which then has the browser sat in the middle, so it is the text-to-speech in the browser. The problem with the web player I guess is that Quest inserts the response into page, rather than appending it to the end, as it needs to go in before the command bar.


yeah I would rather play it on my iPhone then to use the computer because I don’t use my computer very much at all and if there’s a text to speech thing built into the web player then I have no need to use my screen reader it’s just with the way the web player is right now there’s nothing implemented that I know of to read out responses as you type in the commands also it would be great to see this be Built where you could play all games in it including existing ones


Also I tried to use the spoken feedback in the game and I tried it on Safari and chrome and when I turn on the spoken mode and try and type in a command still nothing is automatically read out and this is on an iPhone eights running the latest version of iOS if that helps s


Positive news. Presumably it'll help with the server issues which is rendering larger games unplayable? I like the interface.
I doubt you're looking for bug reports but in case you are it says Turn Script! after every turn and speak to works but talk to doesn't (which is the one listed in the interface). Also it doesn't force the page to scroll downwards meaning it has to be done manually once the page is filled. Good stuff so far though. I probably ought to attempt learning javascript again.


Looking at the tutorial on github, this is the perfect opportunity to help me learn js!


I took the liberty to fork the repository, to test and play with this new version of Quest.

A quick remark about the documentation: for NPC conversation, the verb is currently talkto, and not speakto


I've made a few experiments. I like it so far.

I suggest adding a "use" verb in lang.js:

const VERBS = {
  examine:"Examine",
  ...
  use: "Use",
};

and add it in the default list of verbs of the TAKEABLE template. This will allow the player to use an item through links, and ensure that they play as much as possible through hyperlinks (less time to enter a command, more control on player output, less errors due to typos).

//The crystal ball is fixed in place, so I don't want my player to take it, but I would like them to use it
createItem("crystalBall",
  TAKEABLE(),
  {
		getVerbs:function() {
			return [VERBS.examine, VERBS.use];
	  },
		loc:"Office",
		regex:/^ball|crystal ball$/,
		use:function() {
			msg("You use the crystal ball (yay).");
    },
		alias: "Crystal ball",
	}
);

I also suggest adding a chapter on the wiki about editing the verb list of an item (by changing its getVerbs attribute).


Hi all,

re spoken command: What you're looking for here is ARIA.

It is included in the W3C HTML5 standard, so anything starting with <!DOCTYPE html> should definitely have access to ARIA.

How to use it?

If output returned by JS still is in divs, it's ridiculously easy to implement. All you need is add two attributes to the div: role="status" and aria-live="polite" So, for example:
<div id="output1" role="status" aria-live="polite">This is the game output...</div>

I'll do a small demo.

<button onclick="document.getElementById('demodiv').innerHTML = '<p>Upon clicking the button, the text gets inserted. At the same time, it gets spoken by any active screenreader.</p>'">Clic. this button to show demo...</button>
<button onclick="document.getElementById('demodiv').innerHTML = ''">Clear the div again.</button>
<div id="demodiv" role="status" aria-live="polite"></div>

Note that this method has one major drawback: In roundbased fights, the output will come in fast. No issue for speech as due to the polite parameter of aria-live the new messages won't interrupt the screenreader (as opposed to assertive mode). But for braille display users - they're not so lucky, as there's no "polite" mode for braille messages. Basically, one message will pop up on the braille display after the other, rapidly, making the unfortunate user incapable of interacting with the site. So make sure there's an option to switch this reporting behaviour off, especially when using round-based fights.

Yours,
Sturmjaeger


For other experimenters, here is a template for a gun, or other kinds of ranged weapons, with basic ammunition management:
https://pastebin.com/6zSAJKbb


Here I am (again), this time with a question.

Is there a function allowing you to pause the text until the player presses a key. This would be useful for long narration, or to create some suspense:

msg("You open the chest, and...");
//Wait for key
if(this.isMimic){msg("The chest comes to life! It's a trap!")}
else { msg("You found a treasure!"); }

For now, the only way I found is to use indirectly the showMenu function, by offering the player a single choice which is "continue".

msg("You open the chest, and...");
showMenu("", {"continue"}, function() {
    if(this.isMimic){msg("The chest comes to life! It's a trap!")}
    else { msg("You found a treasure!");
});

Is there a function allowing you to pause the text until the player presses a key. This would be useful for long narration, or to create some suspense:

No there is not, and thanks for reminding me; it is something I have realised is going to have to be included. Creating something generic (so can be used with mouse and keyboard, both with a the text box and without, has so far stumped me, but it will happen eventually.

By the way, your earlier points have now been added to the code.


Thanks.

I am having a lot of fun with this framework, even if I am doing my own experiments for the moment, and not a lot of "pure" writing. I am already fluent in javascript, so it is much easier for me to work with this than Quest5's UI, or even Inform7's mix of code and full sentences. Having your result displayed instantly without compiling time is also a huge plus.

I see that you have started tackling the RPG angle. This will be interesting as well.

In the meantime, here is another pastebin: https://pastebin.com/GC5a3xDa
I saw that there is only a "real time" clock, so I coded for myself a custom clock with a turnscript, and a function to display the time, with a couple of options.
I also added a utilitary function that you could put in your utils, that takes a number and automatically adds "st", "nd", "rd" or "th" depending on the number.


I saw that there is only a "real time" clock, so I coded for myself a custom clock with a turnscript, and a function to display the time, with a couple of options.

It is not a real time clock, it uses turnscripts. It does use the built-in JavaScript display functions, however.

I also added a utilitary function that you could put in your utils, that takes a number and automatically adds "st", "nd", "rd" or "th" depending on the number.

Already done that too. It is in lang-en.js, and called toOrdinal (though mine gives the word, first, second, third, etc.).


is this still actively being updated and work done I haven’t seen a post to this thread in a while so it’s why I was wondering s


Yes it is. Updates occasionally appear on the GitHub site linked at the bottom of the OP. I am having a go at creating a couple of games in it to see what there is missing. The editor is progressing slowly...


OK do you know when you would be able to play current games in it for example games that are already on the site


It will not be possible to play current games on it, it will not be backwards compatible.

It would be possible to play new games on it right now, but without an editor you need at least a passing knowledge of JavaScript to create a game. There is a tutorial to show you how, including how to publish your game.


oh OK I’m not concerned with building games I’m just more concerned with playing them the way it stands right now the web player is not built for excess ability for blind people lease not that I can tell inquest on the computer works but there’s no way to stop the speech from talking after making a command for example when you type in go north the speech player keeps giving room descriptions every time and there’s no way to stop the speech so that after you’ve already visited a room once it will just say the room name and that’s it


Log in to post a reply.

Support

Forums