I've just published Zedt, a Chrome web app that serves as a IF library
and save file manager, built on top of the Parchment interpreter.
The major features I've added on top of Parchment are:
- Stored save files:
You can store your save files locally, and save files are
automatically and permanently associated with each game. I've
replaced the standard hash-based save mechanism with my own system
that handles save file for you, using Chrome's local storage.
- Library listing:
Zedt shows you a library of all the z-code games you've ever played
(unless you delete them from the list, of course) and their associated
save files.
- Browser context menu integration:
When you right-click on a link to a z-code story file (e.g. in the IF
Archive), you get an extra option in your context menu that allows you
to play that game in your browser immediately, without doing a
traditional download. This feature also adds the game to your
library, so you don't have to find the link again later.
- File upload:
I've altered the file-upload code so that it now works properly in
Chrome (previously, it only worked in Firefox, I think). You can add
games to your library by pulling them from the Web or by uploading
them from your hard drive.
Some features that I'd like to include in the future are:
- Save/game file downloads:
Currently, save files and games files are trapped inside the app.
Once you make a save, there's no way to move it to another computer or
open it with another application.
- Cloud storage:
I know there's been some discussion about sharing save files across
devices, and I'd like to implement that in Zedt.
- Storage refactoring:
Right now, I'm stuck at a 5MB limit of save files and locally uploaded
game files in window.localStorage. The standard for HTML5 storage is
still in flux, and it looks like IndexedDB is going to win out, but
Chrome hasn't fully implemented IndexedDB yet. So, right now, I'm
just accepting the cap until Chrome enables me to implement a better
storage solution.
If you're a Chrome/Chromium user, I'd love it if you could try out
Zedt and let me know what you think!
> I've just published Zedt, a Chrome web app that serves as a IF library
> and save file manager, built on top of the Parchment interpreter.
> The major features I've added on top of Parchment are:
> - Stored save files:
> You can store your save files locally, and save files are
> automatically and permanently associated with each game. I've
> replaced the standard hash-based save mechanism with my own system
> that handles save file for you, using Chrome's local storage.
> - Library listing:
> Zedt shows you a library of all the z-code games you've ever played
> (unless you delete them from the list, of course) and their associated
> save files.
> - Browser context menu integration:
> When you right-click on a link to a z-code story file (e.g. in the IF
> Archive), you get an extra option in your context menu that allows you
> to play that game in your browser immediately, without doing a
> traditional download. This feature also adds the game to your
> library, so you don't have to find the link again later.
> - File upload:
> I've altered the file-upload code so that it now works properly in
> Chrome (previously, it only worked in Firefox, I think). You can add
> games to your library by pulling them from the Web or by uploading
> them from your hard drive.
> Some features that I'd like to include in the future are:
> - Save/game file downloads:
> Currently, save files and games files are trapped inside the app.
> Once you make a save, there's no way to move it to another computer or
> open it with another application.
> - Cloud storage:
> I know there's been some discussion about sharing save files across
> devices, and I'd like to implement that in Zedt.
> - Storage refactoring:
> Right now, I'm stuck at a 5MB limit of save files and locally uploaded
> game files in window.localStorage. The standard for HTML5 storage is
> still in flux, and it looks like IndexedDB is going to win out, but
> Chrome hasn't fully implemented IndexedDB yet. So, right now, I'm
> just accepting the cap until Chrome enables me to implement a better
> storage solution.
> If you're a Chrome/Chromium user, I'd love it if you could try out
> Zedt and let me know what you think!
> Wow, very cool! I plan to add most of those things to the standard Parchment, but you've beat me to it! Congrats!
Thanks! I have an easier job than you, of course, since Parchment is
intended for all browsers, and I just had to worry about making it
work in Chrome. :)
Feel free to see if there's anything in Zedt that you'd like to put
into Parchment proper -- I had to dig around in Gnusto for quite a
while to the get the save/load dialog boxes to work right, so if ever
you want to implement that, I can save you some work. Also, for the
file upload, have a look at http://code.google.com/p/zedt/source/browse/trunk/home.html?r=10#299 to see how I replaced the Mozilla-only getAsBinary() with the Chrome-
supported FileReader object.
> Is the 5MB a hard limit? Shouldn't it pop up a box asking the user if they want to allow more storage?
Unfortunately, the 5MB is fixed for window.localStorage, even with
Chrome's ulimitedStorage app permission (see
http://code.google.com/p/chromium/issues/detail?id=58985). It's
because localStorage was not intended to be scalable for the storage
of large files, and filling it with an unbounded amount of stuff could
cause long delays in page activity when fetching or storing data.
However, you can get unbounded storage in Chrome if you use a Web
database API (Web SQL or IndexedDB), but right now Chrome supports
only the long-deprecated Web SQL standard (and Chrome is the only
browse that does, I think -- all the rest went straight to IndexedDB
and skipped Web SQL entirely). I'd like Zedt to be portable someday
to other browsers, so I'm not going to bother implementing Web SQL
storage just for the sake of Chrome's temporary shortcoming. Instead,
I'll just wait until Chrome has IndexedDB support and implement that.
On Jan 2, 8:02 pm, Dannii <curiousdan...@gmail.com> wrote:
> Wow, very cool! I plan to add most of those things to the standard
> Parchment, but you've beat me to it! Congrats!
> Is the 5MB a hard limit? Shouldn't it pop up a box asking the user if
> they want to allow more storage?
> On Jan 2, 8:42 pm, "A.P. Sillers" <apsill...@gmail.com> wrote:
> > I've just published Zedt, a Chrome web app that serves as a IF library
> > and save file manager, built on top of the Parchment interpreter.
> > The major features I've added on top of Parchment are:
> > - Stored save files:
> > You can store your save files locally, and save files are
> > automatically and permanently associated with each game. I've
> > replaced the standard hash-based save mechanism with my own system
> > that handles save file for you, using Chrome's local storage.
> > - Library listing:
> > Zedt shows you a library of all the z-code games you've ever played
> > (unless you delete them from the list, of course) and their associated
> > save files.
> > - Browser context menu integration:
> > When you right-click on a link to a z-code story file (e.g. in the IF
> > Archive), you get an extra option in your context menu that allows you
> > to play that game in your browser immediately, without doing a
> > traditional download. This feature also adds the game to your
> > library, so you don't have to find the link again later.
> > - File upload:
> > I've altered the file-upload code so that it now works properly in
> > Chrome (previously, it only worked in Firefox, I think). You can add
> > games to your library by pulling them from the Web or by uploading
> > them from your hard drive.
> > Some features that I'd like to include in the future are:
> > - Save/game file downloads:
> > Currently, save files and games files are trapped inside the app.
> > Once you make a save, there's no way to move it to another computer or
> > open it with another application.
> > - Cloud storage:
> > I know there's been some discussion about sharing save files across
> > devices, and I'd like to implement that in Zedt.
> > - Storage refactoring:
> > Right now, I'm stuck at a 5MB limit of save files and locally uploaded
> > game files in window.localStorage. The standard for HTML5 storage is
> > still in flux, and it looks like IndexedDB is going to win out, but
> > Chrome hasn't fully implemented IndexedDB yet. So, right now, I'm
> > just accepting the cap until Chrome enables me to implement a better
> > storage solution.
> > If you're a Chrome/Chromium user, I'd love it if you could try out
> > Zedt and let me know what you think!
On Jan 3, 12:03 pm, "A.P. Sillers" <apsill...@gmail.com> wrote:
> > Is the 5MB a hard limit? Shouldn't it pop up a box asking the user if they want to allow more storage?
> Unfortunately, the 5MB is fixed for window.localStorage, even with
> Chrome's ulimitedStorage app permission (seehttp://code.google.com/p/chromium/issues/detail?id=58985). It's
> because localStorage was not intended to be scalable for the storage
> of large files, and filling it with an unbounded amount of stuff could
> cause long delays in page activity when fetching or storing data.
Seems like another example of the Chrome developers being jerks, where
the web doesn't match how they think it should be and so they make it
harder for everyone else. They said they'd rather not even have local
storage! Why not just implement it more efficiently?!?
I found a similar problem because their XHR implementation doesn't
work for file:.
By the way, I've made a Chrome Web App of our Hoosegow game by simply wrapping up the "website" output by I7. Another Googler helped me make a few javascript tweaks to the parchment code which allowed it to work.
Perhaps I can share those tiny patches back with this list? If they were folded back into Parchment, then I suspect it would be trivial for others to follow my path. Or perhaps Zedt has already done this and made the proper generalizations? :-)
> By the way, I've made a Chrome Web App of our Hoosegow game by simply
> wrapping up the "website" output by I7. Another Googler helped me
> make a few javascript tweaks to the parchment code which allowed it to
> work.
> Perhaps I can share those tiny patches back with this list? If they
> were folded back into Parchment, then I suspect it would be trivial
> for others to follow my path. Or perhaps Zedt has already done this
> and made the proper generalizations? :-)
> By the way, I've made a Chrome Web App of our Hoosegow game
One thing you might want to add to Hoosegow is save/restore support.
Zedt's save functionality is at http://code.google.com/p/zedt/source/browse/trunk/src/zmachine/zui.js... and restore is just below it (and to give you fair warning, a lot of
comments there are vestigial Parchment comments that I never cleared
out). You need to include jQuery UI (http://jqueryui.com/) in
parchment.html for the save/restore dialog boxes to work. Using
Zedt's save support, which is designed for multi-game management,
might be a little overkill for a single game, but it will work, and
you're welcome to modify it as you like.