Scrolling issue/glitch in Parchment

Go here: quuxplusone.github.com/Advent/play-550.html

and type the input “N”, “NEWS”, “QUIT”, “Y”.

On my machines (Mac OS X, Safari 5.1.5) (Ubuntu, Firefox 13.0), I see this behavior:

The long news message will scroll up the screen until the command “NEWS” is about 1 line from the top of the screen, but it won’t scroll all the way to the end of the message; and the text box won’t start capturing input until it’s within about five lines of the bottom of the screen (at which point it’ll pop onto the screen when you hit a key); so you won’t be able to type again until you use the mouse scroll wheel or some other method to scroll into range of the text box. This might be considered a feature, but I consider it a bug.

The short post-quit message (including your score) won’t scroll onto the screen at all; you won’t even know it’s there unless you use the mouse wheel to scroll down after finishing the game. This definitely feels like a bug.

Now, I’m using the Inform compiler/assembler but none of the standard library. I’m just using “print” to put text onto the screen; is there some sort of “flush output” opcode I could issue on exit to make Parchment happy? Or is this a real bug in Parchment? Has anyone experienced anything similar with games that use the regular Inform library?

You’re using a very old version of Parchment. Does it work better if you replace the files in the interpreter folder with these ones? github.com/curiousdannii/parchm … master/lib

After the last time you said that, I pulled the latest Parchment .js files from your repository, on 2012-05-31: github.com/Quuxplusone/Advent/commit/663c719b

It’s possible that (A) a new version of Parchment has fixed the issue and (B) my update didn’t grab the right new files, but IMHO neither (A) nor (B) is likely, and their conjunction is even less likely.

This is a feature. Otherwise any key press scrolls the page which is very annoying.

Yeah this is a bug I guess. I’ll see if I can fix it sometime soon, but no promises.

I infer that you’re thinking the only two alternatives are

  • show the start of the NEWS message; force the user to scroll the page until the text box is within range
  • show the start of the NEWS message; increase the range of the text box so that any keypress pops it onto the screen

But my preferred behavior would actually be

  • show the bottom of the NEWS message; force the user to scroll up if she really wants to read the whole thing

on the theory that you encounter a long message many times, but read it only once. And being able to play through a game without taking my fingers off the keyboard (to scroll) is a big plus. And it’s also nice, to my programmer’s mind, to be able to state the invariant “Any time the game begins waiting for input (and the game has produced at least one screenful of text since the last restart), the command prompt will be on the bottom line of the screen.”

But I’d be happy enough if there were some workaround or even a Parchment-specific opcode that meant “jump straight to the prompt, please”.

I don’t know if there are any interpreters that will do what you want. Most others I have used will print one page of text, print a [MORE] message and wait for you to scroll or press enter or whatever. Web interpreters can let the browser handle the scrolling for us, so Parchment simply prints everything there is, and asks for the beginning of what was printed to be scrolled to as close to the top of the window as possible.

If you as a programmer want the prompt to always be ready then don’t print so much!

If you as the user want to jump right to the prompt and not read everything then just press PageDown or End.

It’s a port of “Adventure”, so I don’t get to change the output (much).

My MacBook doesn’t have either of those keys, but “Space” works.
On my Linux desktop, “Space” also works, but “PgDn” and “End” only half-work; I have to press either of them twice before the NEWS text scrolls. (I.e., the first press doesn’t do anything.) They do work at the end of the game.

As a (hopefully temporary) workaround, is there a way for me to simulate a keypress to the Z-machine? My guess is probably not, since it doesn’t seem like a terribly useful feature. :confused:

If it’s only a problem for the news command then it’s really not a problem at all. It’s not like you’ll need to read that no changes have been made in 30 years very often.

Ahh Apple. Number one company on the stockmarket but not PgDn or End keys?
As for pressing them twice in Linux, that is a bug that I thought I had fixed. Which browser and browser version?

Nope.

Mac laptops are set up to do page-down if you hit Fn-down.

But I think paging by hitting the space bar is the convention for web interpreters at this point. (Some people undoubtedly scroll down with the mouse instead, so it’s important to support that, but – as you say – all-keyboard input is more popular.)

I like it if any key works for scrolling, but if it’s just space bar I adapt to that easily.

Jumping to the end of the output without user paging winds up feeling like a bug. Your command has just disappeared and, since you don’t see the beginning of the response, you can’t tell why.

…But you do know that something has happened, and you know that whatever just happened must be up there, so you scroll up to see what it was. Minor annoyance, I agree. But the alternative is that you see a screenful of text without any prompt at the bottom — or in the QUIT case, you see your last input and then nothing — and it takes a leap of logic to realize that there even is any more text at all, and that you need to scroll down to see it. It’s very easy to think that the game has crashed or ended abruptly. Major annoyance.

EDIT: I admit the user experience may be significantly different on a mobile device versus a desktop/laptop browser. If you get used to room descriptions requiring scrolling, it’s a very small and intuitive step to scroll down instinctively after every command. But on a full-size browser, “Adventure 550” doesn’t require any scrolling except in these two instances, and one of them only happens when you’re quitting the game anyway (but the information then displayed is important). So scrolling feels very unintuitive to me.

For the NEWS case, I’d also accept a UI fix: for example, you could show (and then erase) a “[More]” prompt, or display an arrow pointing down in the lower right corner of the screen as long as there’s unread text down there. This would be mostly redundant with the browser’s scroll bar, but the scroll bar is going the way of “http://” as browser vendors realize that people don’t usually care about it. On my Firefox for Ubuntu, the scroll bar is pale-gray-on-paler-gray; on Safari, the scroll bar doesn’t appear at all unless you are literally in the act of scrolling. And once the page gets to several thousand lines in length, the scroll bar may not have the resolution to indicate “hey, there are three more lines down there!”

I think we’re all still in agreement that the QUIT case is a real bug, and should be fixed by scrolling the text onto the screen, regardless of what happens in the NEWS case.

Space works as page down for webpages in general. I must admit I’m a mousewheel guy though. I don’t think I real linearly enough to only scroll in one direction.

I didn’t know Safari was hiding the scroll bar now. I’ll consider adding a More indicator like Quixe’s… scrolling still happens like normal, it’s just there to inform the user. Zarf, do you do that with JS or CSS magic?

I just pushed a fix for the quit bug.

The MORE thing is a CSS div which is hidden and revealed by the JS scrolling code.

Wait, that’s my point! :wink: (The desirability of forcing users to scroll up instead of down, that is.)

And it works great! Thanks. :slight_smile:

Shift+space?

(But yeah, I scroll with two fingers on my trackpad, because I find using the spacebar to be too jumpy.)

Wow, I didn’t know that existed at all! And following the same logic led me to the realization that shift+backspace exists too! :smiley: (But coming from Firefox, I found out long ago that Command+Shift+T doesn’t work to reopen a recently closed tab in Safari. :frowning:)

Dannii, I’ve uploaded club.cc.cmu.edu/~ajo/dissemi … enshot.png in case you want to see what Safari’s scrollbar looks like these days. It’s the dark gray (alpha-blended) blob on the right side of the screen. It fades in when you start scrolling, and fades out after about half a second of inactivity.

Idea for a non-IF game: Someone should make an HTML5/CSS side-scroller where the object is to prevent your scrollbar indicator from colliding with obstacles traveling from left to right across the screen. This would naturally be highly browser-dependent and probably screen-size-dependent too, since you’d have to know the size and position of the scrollbar relative to the stuff on the screen.