Quest online player session timeout

I was playing “The Myothian Falcon” online, leaving the game open in a window for a while as I tend to, and when I returned to the window after doing other things for a while (about an hour?) I got this message:

So, don’t play this game online unless you plan to finish it in a single sitting.

ADRIFT WebRunner will also have this issue. Each active session uses up memory, so there’s a trade-off between the time you leave a game idle and tidying up what appear to be abandoned sessions on the server.

I’ll need to look into that. You can save your game tho, with the save and restore commands.

This was in fact the reason why I didn’t complete the Myothian Falcon. After getting half way through the game online and having it time out, I couldn’t be bothered to restart and do everything over again.

Online play with other systems can be equally frustrating. Often, I would accidentally click out of the command box. Not noticing, I would then press backspace to amend a half-written command. This would take me back a page, losing all progress on the game. This happened three times, and then I vowed just to download the bleedin’ things.

I blame the browser for this. I have never, never, never wanted to go back a page by pressing backspace, but I have often accidentally done it anyway (usually when composing a blog comment).

I must have lucked into a browser that doesn’t do this anymore, because it didn’t happen to me at all in this comp (I played almost everything online), and that almost certainly wasn’t because of lack of user error.

My trouble is compounded by the fact that I do use the backspace button for going back a page, so picking a browser without this function wouldn’t be all that great. (In general, I prefer to use a keyboard short-cut rather than use a mouse.) If I went to the trouble of downloading a browser or extension to prevent the backspace from working when playing IF, then I might as well just download the games.

JavaScript to disable the backspace key could be put into the Parchment template? Untested, as I’m at work, and I just dredged it up off the interwebz… I know it works, I tested that much. But I don’t remember what the Parchment files look like.

<script type="text/javascript">

document.onkeydown = function () {
	var e = event || window.event;
	var keyASCII = parseInt(e.keyCode, 10);
	var src = e.srcElement;
	var tag = src.tagName.toUpperCase();
	if(keyASCII == 13) {
		return false;
	}
	if(keyASCII == 8) {
		if(src.readOnly || src.disabled || (tag != "INPUT" && tag != "TEXTAREA")) {
			return false;
		}
		if(src.type) {
			var type = ("" + src.type).toUpperCase();
			return type != "CHECKBOX" && type != "RADIO" && type != "BUTTON";
		}
	}
	return true;
}
</script>

Parchment does a pretty good job keeping the focus in the input field at all times so it’s not an issue there (as evidenced by Matt’s experience). The only way I could get the backspace to work as a back button is if you highlight some text on the page first and then press backspace.

The best solution would be if the interpreter would autosave after every turn. You’d never lose progress, no matter why the browser window was closed.

Firstly, it sounds like you need to update your browser Joey! I’m using Firefox 5, which is a few versions out of date now (I think they’re up to version 7) you can go back and forward through history without reloading the page. (Chrome 15 doesn’t however, I’m not sure how out of date that is.) I assume that all browsers will be moving to support that - it’s just a matter of memory, and most of us have the memory to spare. Mobiles might be different, but they have different interfaces.

Secondly, I admit that Parchment still needs improving! Just yesterday I was playing and noticed that if the input field wasn’t focused then pressing up to go through the command history didn’t work on the first key press - for some reason it needs two, unlike for other keys. Parchment tries to automatically focus the input field, but only in certain situations: you have to be scrolled fairly close to the bottom of the page, and not have selected any text (so that copying etc will work). We don’t want it so that clicking the page will scroll down to the input if you’re reading something a few pages up, but perhaps pressing keys could have different rules, and would focus the input even if it was a few pages down? What do you all think?

Autosaving is an interesting idea. It could be tricky - the VM’s state has to be saved at a particular place in the code, so that when it’s restored it will recover successfully. If you have a savefile you can force the engine to load it, but you can’t really ask the engine for a savefile, it has to give it to you instead. However we could piggyback on the undo system, and automatically save the last undo data. Such an autosave wouldn’t be a Quetzal file but you can’t even download savefiles from Parchment yet, so it’s not like that would matter. (Downloading savefiles is a feature that will be coming!)

This could mess up the saves the player actually wants (in z-code). If I want to keep a single save to revert to in case I mess up in the game, I think I can currently save and then refresh the browser window to revert (because the save file info is stored in the URL). If Parchment autosaves after every turn, I won’t be able to do that so easily, will I?

I was thinking more like a system that many non-IF games have where you have the player’s own saves and a separate autosave file. The save info doesn’t necessarily have to be stored in the URL.

I’m using the most up to date version of google chrome. Mostly because it has the least cluttered interface, as I cannot stand bars. It doesn’t reload the page on going back and forward. I tested it out using this post. I’ve gone back and forth with impunity. But Parchment, Quest and Adrift restart their virtual machines when you go back and then forth.

Also, testing it again just now, has anyone else found Quest to be noticeably slower to load than the other game systems. My experience has been that of the comp games playable online (excluding the web-based games), Adrift loads the fastest, then Parchment, then Quest.

Quest 5 games can take a few seconds to load on the server - it’s something I need to look at. Quest 4 games load a bit more quickly. It depends very much on the size of the game - Myothian Falcon is fairly big and takes about 10 seconds to load. Once it’s loaded though the performance seems acceptable.

By the way, I’ll be deploying an update in the next day or two which adds the ability to save games if you’re logged in.

Juhana, exactly my thoughts too. There’ll still be the option to bookmark a savefile because they’re useful for sharing, but savefiles will be saved to localStorage instead.

Joey, well the Firefox interface is almost the same as Chrome’s now, the difference being a separate search box which can be removed. I’m not telling you that you have to change browsers, but just pointing out that this problem is really your browser’s fault, and not Parchment’s.

Intercepting keys at all scroll positions is problematic because I want the up and down keys to scroll through the page, until you get to the bottom when they’ll scroll through the command history. However, I guess we could distinguish between the keys we intercept. Maybe it would be safe to block the backspace key from going back a page at all times? Hmm. I think I’ll do that.

Okay, I’ve updated iplayif.com to catch the backspace key.

And remember, in the future please make an issue in Parchment’s bug tracker for any other problems you find! [emote]:)[/emote]