Game management shell for Parchment

I whipped this up for my own use, but figured others may find it useful as well. I’ve written a simple wrapper for Parchment games that allows you to build a list of games that you’re playing in the sidebar and easily swap between them. If you pair it with htappen’s Parchment fork which has been modified to store save games in your browser’s localStorage, you can save your game states for all of your games between browser sessions even when running from your local hard drive.

I put a copy up here that you can use: http://if.sitosis.com/.

When adding a game, give it the name you want plus the url to the .z*, .glulx, .gblorb or whatever file. Any game that Parchment supports should work. Currently you need to be online when first loading a game during a given session, but once a game is loaded you should be able to go offline and continue playing for that browser session. Since it saves your game list and saves locally, if you open the wrapper from a different computer or browser you’ll have to start from scratch.

Source code is here: https://github.com/rudism/parchment-shell

I’m sure it has bugs and shortcomings as I only spent a few hours putting it together so far, so please feel free to report any bugs or feature requests on the Github page if you try it out.

This is awesome! I’ve been wanting something like this for a long time for Parchment. If we merged it into the main Parchment code would you be willing to help support it when inevitable bugs arise? That’s why I’ve been holding off merging htappen’s fork, because it’s a lot of code and I haven’t got the time to go through it as carefully as I would want to.

In open source this is why you provide an interface to code to which serves as a program-by-contract. If you back up that interface with solid unit and/or integration tests, then merging code means that as long as the code (1) provides its own tests and (2) does not break the existing tests, you can do a pull request and merge. That’s pretty much how open source works so that you don’t have to go through someone’s code to the nth degree.

It would be a shame to see a cool tool like Parchment not take in good developments and evolutions simply because one person understandably doesn’t have time to go through all the code of every contribution.

Don’t become like Inform 7 development! :slight_smile:

And, yes, I agree: this shell is awesome.

I’m certainly willing to help improve/fix as my own somewhat limited free time permits. The shell is pretty hacked-together as is, so I’m currently planning on doing some clean-up and making some improvements over the next couple weekends.

It’s pretty minimal by the look of it, so I guess the issue would still be htappen’s code. You haven’t had any problems with it?

I would like to keep with the single-page model though, instead of using an iframe. It’s easy enough to add construct the html dynamically though.

So far so good. I’ve only tried maybe half a dozen games, but the save/restore from htappen’s fork has worked in all of them.

If it makes sense, I can move my work directly to the index.html in a new Parchment fork and open a pull request once I’ve got it cleaned up a bit and working without iframes. The only other thing I really had in mind was to add the ability to toggle the sidebar on/off (and maybe make it resizable if I’m feeling feisty). And I suppose if the idea is for this to ultimately end up on iplayif.com, it’ll have to handle the ‘story’ query param gracefully (probably add it to the game list if it’s not already there and auto-launch).

I had been hoping to add a side panel with a button to open/close it. It would be good for the games to list their savefiles too. I had thought that htappen’s fork supported multiple savefiles but maybe that’s not true.

I messed around with this some more today, new changes are live at if.sitosis.com.

When adding games you can now search a built-in index of the IFDB and just click the game you want instead of having to manually put in a name and url.

It also kind of supports TADS games now–web playable TADS games (all whopping 19 of them) show up in the search index along with everything else. Unfortunately the online TADS terp doesn’t work in iframes, so those will pop a new window instead when you click them in the game list. A good example if you want to see how it works is the game “It” by Emily Boegheim.

You can also add the same game multiple times (it would bug out before). Not sure why you’d want to. I suppose it might be useful for play testing multiple branches from a given save point or something.

I did spend a little bit of time digging into the Parchment code to see if I could grok it quickly enough to try integrating this directly, but felt like I was floundering a bit.

The next big thing I’m considering (outside of UI improvement) is the ability to share playlists and add games via urls. Since I have the local IFDB index it could be done pretty tidily using just the IFDB game IDs.

EDIT: I should note that there are compatibility issues with the localStorage format… you might need to clear your game list and start from scratch if you used it before and still have a game list showing up. If you have saves you want to preserve, you’ll need to re-add the game using the “Manual Add…” option with the same url you originally used.

Wow, very cool! I’ll definitely look at somehow bringing this code into the main Parchment codebase. I noticed you were using coffeescript too. I’ve never used it but it looks good.

Yeah, I never really enjoyed working with javascript/css before when I could avoid it, but discovering coffeescript and stylus have made it pretty bearable.