adq


Andrew de Quincey's livejournal


Previous Entry Add to Memories Share Next Entry
KIF: an infocom text adventure interpreter for the kindle
adq
Wow, this sort of  thing seems to be in the news these days!

Note: I've updated these instructions for KIF 0.5; please see here for the release notes..

My app is different however: it isn't web hosted, it runs natively on the kindle using the KDK APIs. As I don't have the official KDK, you'll need to jailbreak your kindle and install my developer keys; this is easy, but if it goes wrong, I can't accept any responsibility.

So, lets jailbreak: The kindle jailbreaking was developed over at the mobiread forums, here. The following is a very quick summary, see the mobiread thread for more information:
  1. Download kindle-jailbreak-0.3.N.zip from that thread.
  2. Extract it on your computer.
  3. Copy the correct update_*_install.bin to the root of the kindle over USB. See the thread for information on which. (For my UK Kindle 3 with 3g, I use update_jailbreak_k3gb_install.bin).
  4. Safely remove and disconnect the kindle.
  5. Go to [HOME] -> [MENU] > Settings -> [MENU] > Update Your Kindle.
  6. It'll take a wee while, and the update will fail with a U004 or a U006 error (this is expected).
tada, your kindle is rooted. Now, normally at this point you'd wonder what to do now... well, lets move on to stage 2:
  1. Download kindle-adqdevkeys-0.2.zip from here.
  2. Extract it on your computer.
  3. Copy the correct update_adqdevkeys_*_install.bin to the root of the kindle over USB. It'll be the same code as for the rooting.
  4. Safely remove and disconnect the kindle.
  5. Go to [HOME] -> [MENU] > Settings -> [MENU] > Update Your Kindle.
  6. This time, the update will succeed, and will install my developer keys into /var/local/java/keystore/developer.keystore. In case you already are an official KDK developer, any existing developer.keystore file will be backed up into that directory. 
At this point you should have escaped the maze of twisty updates; installing KIF can be done entirely by copying files over usb:
  1. Download KIF-0.5.zip from here.
  2. Extract it to your computer with the full directory structure.
  3. Copy the extracted directory structure onto the root of the kindle USB drive. (e.g. "kif.azw2 should end up in your kindle documents folder). 
  4. Disconnect, and wait for the home screen to refresh.
  5. "KIF" should appear as an option... click it! 
I still have a fair amount of work to do on it (e.g. styled text, lots of GUI improvements, auto-persistence when going to HOME....); consider this an alpha quality release. However, games should be playable, and I've implemented savegame support.

I have only tested this with the minizork and curses games (which will be installed when you decompressed KIF-0.1.zip). Others will very likely work, but I have been concentrating on getting the basics up and running first rather than game testing. Also, I've only  tried it on a UK Kindle 3. YMMV.

I'm using the excellent zmpp as the infocom virtual machine. I must get in touch with the author and contribute my patches back once I have the source in a more stable form.
I also use the KWT for  the items in the save menu.
Finally, all code is available here.

By the way, you can get many more Infocom adventures over at the IF archive. And of course there's the yearly Interactive Fiction competition.
Tags:

Page 1 of 2
<<[1] [2] >>
Fantastic work - it runs without a hitch! You're missing the link to KIF-0.1.zip, however.

Thanks!

Fixed the link, ta.

It looks like this other one's made slashdot. An opportunity to point out a better alternative?

I'll try, but I don't tend to have much success at posting to such sites!

Just what I was looking for

dougbtx

2010-10-09 08:29 pm (UTC)

I was wondering if there was a native client for Zork on the Kindle, great to see someone working on it!

Here's a patch to add some whitespace around the game text:

http://redmelon.net/patches/0001-Added-whitespace-around-the-game-text.patch

I'm thinking of adding word wrapping next. I see that the last couple of pixels of the last character on a line are sometimes clipped too.

Re: Just what I was looking for

adq

2010-10-10 01:35 am (UTC)

Cool! thanks, just applied.

Please go ahead with word wrapping; means I can get on with the styled/coloured text support...

Delicious LiveJournal Links for 10-10-2010

pingback_bot

2010-10-10 11:01 am (UTC)

User andrewducker referenced to your post from Delicious LiveJournal Links for 10-10-2010 saying: [...] KIF: an infocom text adventure interpreter for the kindle [...]

Without Jail Breaking

(Anonymous)

2010-10-10 03:13 pm (UTC)

Does anyone know if someone is working on a solution so we don't have to jailbreak our Kindle?

Re: Without Jail Breaking

adq

2010-10-10 03:16 pm (UTC)

Well, the obvious one would be for Amazon to have deigned to reply to my request for a KDK beta account at www.amazon.com/kdk . Then (I assume) I'd just be able to publish it on Amazon's kindle store.

However, I never heard anything back from them and I didn't want to wait.

How'd you find out about the KDK APIs? Is there any documentation out there that I can get access to? (I've also applied for the kindle dev program, never heard back)

See http://adq.livejournal.com/106967.html for useful links (also later posts detail my progress). I simply pulled the Kindlet/KDK jars off my Kindle's filing system.

Amazon left the KDK API docs publically accessible. A quick google search found people linking to them; there's a link to them in that post.

you just made me lose my recently purchased kindle to my girlfriend, who was obsessed with zork.

i hate you.

(thanks) ;)

Re: thanks a bunch...

adq

2010-10-15 08:51 am (UTC)

Heh; wait till I get nethack working on it :)

Brilliant!

(Anonymous)

2010-10-13 12:36 am (UTC)

Thanks so much, this makes my Kindle complete :-)

Great job! The kindle is one of the best platforms for IF *ever*. Lightweight, great display for it, so-so keyboard, great battery.
I've tried some games with success, but I ran into a problem that if I install every game that comes with Masterpieces of Infocom, I cannot scroll down to see all games. Maybe a split-column would work...

Re: Too much games

adq

2010-11-03 11:10 pm (UTC)

Glad you agree!

Yeah, I need to implement multi-paging in the file selector views, its on my todo list.

Do just what the guide says

(Anonymous)

2010-11-03 10:50 pm (UTC)

I tried to do everything at once, so I just copied all the files over at once. I also included the uninstall files.

Not sure where my mistake was, but it worked when I did exactly what the guide says. RTFM ;-)

BTW. It would be great if you could put the source code up on sourceforge or a similar place.

Re: Do just what the guide says

adq

2010-11-03 11:11 pm (UTC)

Heh :)

The source is already up, easy to miss the link in the original post: http://code.google.com/p/adqmisc/source/browse/#svn/trunk/kif

Help

(Anonymous)

2010-12-26 01:23 am (UTC)

Is there help included? For example, a question mark would list the commands the interpreter understands.

I don't know if that is actually possible; its entirely up to the interpreter running in the Zcode VM what is supports.

(Deleted comment)
You have to type RESTORE Dude...

Awesome! Better than reading books

jeritue

2011-01-11 04:41 pm (UTC)

just wish that i could adjust the font size. and also support for scott adams games would be cool, can i buy you a beer ?

Re: Awesome! Better than reading books

adq

2011-01-17 09:27 am (UTC)

Hmmm yeah, font size should be doable when I'm next in the mood for working on kif.

Scott Adams games do seem to be just infocom games; if you dig about in the source of the HTML (e.g. http://www.freearcade.com/Zplet.jav/Advland.html is ADVLAND.Z5) , you can find the filenames of them ... or are you seeing a specific issue?

As for beer, that'd be great! Transferring it over the internet might be tricky though :)

Additional Games

(Anonymous)

2011-02-04 01:20 am (UTC)

Thanks for doing this! Great to see this for the Kindle.

Can you walk me through adding a game from the IF archive? I tried downloading a file with a .z5 extension and putting it in the documents folder on my Kindle. I couldn't get that game to be recognized.

The two games in your download worked fine. I noticed your file was a .azw2 extension. Not sure what the difference is or if that matters.

Re: Additional Games

adq

2011-02-09 09:47 am (UTC)

Ah, you need to put it in a specific folder on the kindle.

If you plug it into a PC and access the kindle's "drive", you put the z5 games in <kindle>/developer/kif/work/

If you've unzipped kif-0.5.zip with the full directory structure, it should have created those directories for you.


Edited at 2011-02-09 10:01 am (UTC)

Re: Additional Games (Anonymous) Expand

3.1 FW Problem

(Anonymous)

2011-02-26 08:16 am (UTC)

KIF is great. I have been enjoying it on 3.0.2 FW.

I upgraded to 3.1 due to the new jailbreak releasing and installed the new jailbreak. Now, when I try to launch KIF, a message box comes up instead saying, "The permissions to open the requested title have an invalid date. Please contact customer service." http://i53.tinypic.com/10scig5.gif

I tried reinstalling the devkeys, but I get the same result. Please let me know if there is anything I can do to fix it or help you in the debugging process. I'll be able to check back in a day or two.

Re: 3.1 FW Problem

adq

2011-03-06 12:46 am (UTC)

Weird, I've not seen that myself on either of the two kindles here, although there's been one other report.

Did you install it over the air, or by downloading from amazon and doing a manual installation?

I'll try and have a dig about to find where that error is coming from.

If you have ssh setup, can you check the date on your kindle is correct? (type "date" into the kindle's shell prompt).

Issue?

(Anonymous)

2011-03-05 11:32 pm (UTC)

When I tried opening Kif on my Kindle, it gave me an error saying something like, the permissions requested have an incorrect date? I am on 3.1 3g.

Weird, I've not seen that on either of the kindles I've upgraded. You're using the latest kif version I assume? Not that that should affect anything.

Just to check, what's the number after the "3.1" on the settings screen? Both the 3g UK ones here have 5588700031

If you have ssh setup, can you try sshing in and checking the date on the kindle is roughly correct? (just type "date" into the shell prompt)

Re: Issue? (Anonymous) Expand

Same Issue

(Anonymous)

2011-03-10 06:41 am (UTC)

Hi,

I've got the same problem. Kif was working - I had a bit of a play around this morning. This afternoon my Kindle froze (doing something different) and I had to reset it. Since then, nothing.

I'd re-install, but I'm not quite sure where to start with uninstalling the software. Any tips?

Hi, the devkeys should come with an uninstaller binary.

As for kif itself, its just a few files installed on the usb stick; its not really any more installed that that.

Same Issue

(Anonymous)

2011-03-10 07:16 am (UTC)

PS - Hi, same poster. Just want to say this is an awesome idea, and the Kindle is much more suited to these games than the Android phone, and I look forward to being able to play them on the move.

Is there a site I can hit up to put my vote in for them giving you the KDK - you did point out that there aren't any copyright issues, yeah? There are thousands of awesome free games.

http://www.wurb.com/if/index

I did a search on z-code games with 4 or 5 stars just for a start so I could (re) download some favs and check out some new hits.

My personal recommendation would be Dreamhold for those just starting out / getting back into these as it also works as a tutorial, as well as a great game (the tutorial mode can turned off for more experienced players, or once you get the hang of things):
http://www.wurb.com/if/game/2442

So many downloads, so little time. If only I could get these working on my kindle again *hint hammer*

PS - in case I didn't mention I'm using a Kindle 3 with wifi (graphite) running 3.1 and the number: 558700031

I used the latest version (0.6) of jailbreak which may have made a difference? Should I scale back?

I've tried 0.6 myself and it seems to work. I'd really appreciate if someone could try 1 (clearing the keystore dir) from http://adq.livejournal.com/115432.html

I can't replicate this problem myself unfortunately, so I haven't been able to make much more progress :(

Problem Solved!

(Anonymous)

2011-03-10 08:45 am (UTC)

I worked out what happened - thanks to this line in a troubleshooting guide:
"Reset the device if no error messages appear but the Kindle constantly freezes. This deletes everything on the device and restores it to its original factory setting"

It was for a Kindle 2, and didn't delete all my files, but it must have restored the pre-rooting settings.

I am about to start playing 'The Meteor, the Stone, and a Long Glass of Sherbet' - wish me luck.

PS - it seems z8 files don't play? The screen was blank when I tried to open Dreamhold (ps - if it never does that's fine, just thought you might want to know).

Cheers!

Re: Problem Solved!

adq

2011-03-21 08:29 pm (UTC)

Ah cool!

z8 likely won't, I don't think the interpreter supports those unfortunately.

A useful hack for greedy gamers!

Tamsyn Michael

2011-03-26 07:29 am (UTC)


Hi,

I am a greedy gamer who complained about only being able to fit 20 games in KIF (well, they open, but it's a bit of a potluck past 20). There is a way to download files other than the Amazon's allowed ones here:
http://www.mobileread.com/forums/showthread.php?t=121008

If you go to page three you will see what you need to add to the freedownload.conf file to get z3-z8 to download (don't bother adding ogg or z8 though (z8 don't play on KIF).

It works a charm - I just downloaded 9:05 from the if archive, straight to my kindle, opened up KIF and got started.

Re: A useful hack for greedy gamers!

adq

2011-04-16 01:27 pm (UTC)

oh, that's a cool idea for downloading other extensions!

I'll have to fix that listview problem; there's no actual limit on the number of games, just that I've been lazy in the GUI :)

ok that settles it...

(Anonymous)

2011-04-24 05:39 pm (UTC)

My next purchase is an amazon kindle. Thanks for building this!

Doesn't detect new games

(Anonymous)

2011-07-09 07:03 pm (UTC)

I added a few .z3 and .z5 to the developer\kif\work folder, but it doen't detect them on the kindle. Am I doing something wrong?

Re: Doesn't detect new games

adq

2011-07-30 04:27 pm (UTC)

Hi, did you manage to sort it? (been busy redecorating for the last few weeks, only just catching up...)

Thanks for this excellent work!

(Anonymous)

2011-09-20 05:03 am (UTC)

I did a search for "interactive fiction on Kindle" and found your page. I rooted my Kindle just to use this app. I loaded some of my old Infocom .DAT files and I can't wait to dig into that zorky goodness!

Are you still actively working on this project?

Thanks again and cheers!

Re: Thanks for this excellent work!

adq

2011-10-03 06:37 pm (UTC)

glad you like it. I'm not actively working on it at the moment.

Needs Scrolling (Anonymous) Expand

Test Kindle

(Anonymous)

2011-10-11 03:47 am (UTC)

Hi!

Thanks for putting this together. I think I followed all directions correctly for my Kindle 3.1 wifi. However, when I click the "kif" file I get this error message:

"The device is not registered as a Test Kindle to run this title. Please ask the developer to add this device to the list of registered Test Kindles. "

Any ideas?

Thanks,
Kawika

I think that means my devkeys haven't installed correctly, but I couldn't say why...

Page 1 of 2
<<[1] [2] >>