Some scenes from Riven (1997) on the Apple II

This isn't a full demake/game, just a few scenes.




Credits


Details

I have been converting Riven screenshots posted by Cyan, and eventually wondered how much of the game could fit on one 140k floppy disk. As expected, the answer is not much. It was then expanded for multiple disks.

Legal Note

This product contains trademarks and/or copyrighted works of Cyan. All rights reserved by Cyan. This product is not official and is not endorsed by Cyan.

Current Status


Videos

Capture of the new features in version 0.11 in the Applewin Emulator:


Older videos:

Screenshots

Some screenshots captured with AppleWin emulator.

Disk00:


Disk01:


Disk02:


Disk03:


Disk04:


Disk05:


Disk10:


Disk38:


Disk39:


Disk40:


Disk41:


Disk43:


Disk44:


Disk50:




Was having fun making props for the video:



Technical Discussion

So how does this all work? I'll spare you an extensive Apple II hardware overview, except that it's a 1MHz 6502 processor, we'll assume 48k of RAM, and that's about it. It has "hi-res", "lo-res", and text modes, but they are simple (weirdly interleaved) framebuffers, so no fancy sprite or other hardware that you might find on other 8-bit systems. One thing it does have going for it is by 1980 or so you could assume people would have at least one fast floppy drive (much faster than the ones found on other 8 bit systems).

The game engine is a variant of the one I put together for Apple II Myst. It's fairly simple, it has a data structure for each location, these locations you can face up to 4 directions N/S/E/W and have background graphics for each direction. For each direction you can optionally link to another location (which is how you walk places). Each location also lets you have one trigger where you put an action callback triggered by clicking on a square-shaped region of the screen.

Drawing the pointer is just doing a simple hi-res software sprite. The graphics are two images, a sprite and a mask, to allow for some transparency. I cheat a bit and only allow horizontal positions in multiples of 7 pixels as that immensely simplifies the code (the hires screen is stored 7 pixels [well, technically 3.5 if you're doing color] per byte with one bit for palette).

I use ZX02 compression on all of the graphics. Hi-resolution graphics are 8k uncompressed, but they compress down to roughly 4k depending on the complexity. See here for some notes on tradeoffs when generating hi-res graphics. Due to how I have the engine set up the 32k area from $4000 - $C000 is available for the code and graphics data, which means roughly 7 or so backgrounds are available before you run out of room. Apple II supports page-flipping, but I don't use it here as that would take up an additional 8k of RAM for the extra page. The window-blinds like transition between images isn't a special effect, it's a weird side effect from the memory interleaving inherent in Woz's design of the system.

The movies are done in lo-resolution mode. The movie from the game was captured and images dumped at 5fps, and then I hand roto-scoped them (which took forever). Lo-res graphics are 1k, but with ZX02 compression they are often about 200 bytes or so depending on complexity (and at times I intentionally left out details so they'd compress better. The longer movie is 137 frames. Optimally it would be 20 or so longer, but I stopped when I hit 32k. I could have played games where I pre-loaded extra data to the language card (16k memory expansion) but in the end I was tired of rotoscoping. We do use page flipping here, which possibly will make things run poorly if you have an Apple IIgs because most of those systems have a bug where the designers forgot to support lo-res Page2 in hardware and have to use a slower software workaround.

The interior of the maglev is a separate overlay that is copied on top of the backgrounds. The handle-movement animation at the beginning is actually flipping between a series of overlays. I originally meant to use sprites for this, but in the end compressed overlays (all 8 are compressed in one big blob that is decompressed at $2000-$4000) ended up being quicker/easier.

I use Qkumba's "qboot" disk routines. This is a bootsector and a few pages of disk code that can load contiguous areas from disk into RAM. By skipping having an operating system it frees up at least 8k of space on disk, as well as running faster than code that has to seek around to catalog tracks and track/sector lists. It was a challenge getting this going though because I had to load the stage2 boot loader up to $1000 to be out of the lores-page2 range and so had to fix up a lot of places in the code and it's always dangerous messing with qkumba's deep magic. In the end there's probably still around 6k or so of free space on the disk scattered around but I didn't think it was worth padding everything down to make it contiguous.

System Requirements


Downloads

Disk Images

Source


Playing in a Browser

If you don't want to use an emulator / don't have an Apple II at home, you can in theory play the full thing in a browser at the internet archive here: riven_hgr at Internet Archive

Frequently Asked Questions


Development Notes

18 August 2024 -- v0.11

Hooked up all the nonsense with the chair room, and you can now open/close the temple door.

Wasted a lot of time making a few of the beetle viewer images. Then hooked up enough of the rotating room so you can look at them. Still don't have a full plan to enable actual rotation of that room.

Should probably move on to other projects, spent way more time on this one this summer.

3 August 2024 -- v0.10

Filled in a lot of temple island, including some initial attempts at interactivity. Also re-learned how the engine worked enough to allow branching paths, so we can finally get to the fish statue. We're up to 14 disks now...

26 July 2024 -- v0.09

Slowly adding more locations. Also finally fixed the annoying keyboard bug where it would sometimes ignore keypresses. It was a race condition where you could press a key after the keypress check happened but before the strobe was unconditionally cleared.

24 July 2024 -- v0.08

For some reason I keep adding more disks of graphics. Though I always vaguely planned to try to add a path from arrival through to the crater island. In any case I added some favorite locations, as well as placeholder locations, now spread across 13 floppy images! This breaks the record of 12 floppy disks from the Online Systems (Sierra) game "Time Zone" which was infamous at the time for being excessive with the disk swaps.

I do plan some minor work on the core engine. I need to add code to let you bend left/right at intersections. Especially in the forest this comes up. I need to decide if I am going to implement the rotating bug room. That's a pain because it's a pentagonal room, and my engine only handles the four cardinal directions. (This same issue came up when making Myst in Channelwood, but in the end I cheated a bit to avoid the problem).

17 July 2024 -- v0.06

People talked me into making a hard disk image, so figured out enough to get it working. It's a raw hard disk image, not a ProDOS image. (It would probably be easy enough to add a Riven.system stub to make it work as a prodos image anyway, but haven't had time to do that).

Also went and fixed up/connected up all the areas so you can walk between them even if there are gaps.

Learned way more to about prodos and smartdrive than I would have wanted, and had infinite bugs due to me trying to convert from sectors (256 bytes) to blocks (512 bytes) as well as some shortcuts I took earlier where I stored the disk numbers in BCD to make them easier to print.

13 July 2024

Finished the intro. That was a *lot* of rotoscoping. In the end was starting to feel bad for Cho as I had to watch his struggle frame-by-frame.

Was hoping to get this done before Mysterium which I sort of did.

3 July 2024

Working on the intro for some reason. It is turning out nice though it's taking a while.

Did have some fun glitches while trying to get Atrus to speak in lowercase.

Also the Apple II people have convinced me to maybe eventually make a hard disk image so you don't have to disk-swap. Looking into that but it involves more ProDOS nonsense than I usually like to deal with.

I've also changed the file distribution to be a zip file which hopefully is OK.

25 June 2024 -- v0.05

Spent way more time than necessary getting an updated version done by the Riven remake release date. you can now go through disks 40, 41, and 43 which means arriving on Jungle island, poke the orbs, scare the sealife, and walk up to the minecart.

Some of the graphics are a bit more rushed than I'd like but I really wanted to get a video up.

21 June 2024

Added some sound effects when you poke the orbs.

19 June 2024

Updated the code so you can actually switch between floppies when prompted and it will continue with the game. It seemed like a pain to try to do ASCII art for every possible D'ni number (and some didn't map well at all to it) so I went and did the silliest thing possible and wrote a 512-byte lo-res routine to draw any possible D'ni number from 0 to 624. This involves having BCD (binary-coded decimal) but instead whatever the base-5 equivalent is.

And then, to be more ridiculous, I ended up noticing it looked like the masks from my lovebyte 2024 plasma demo so I ended up throwing together a demoscene demo from it. Due to popular demand you can see that here: D'ni Counting Demo.

18 June 2024

Add beginning of disk01, the start of the game (after the first set of cutscenes). The graphics are a bit muddy at the start sadly.

Also updated disk39, you can now flip the maglev back (essentially just playing the flip movie backwards).

17 June 2024

Work on the build system, redid things so disk40 has the proper contents (should be arrival at maglev station).

16 June 2024 -- v0.04

With all the current Riven hype I thought maybe I could add a few more disks worth of walking around. So I have the beginnings of disk40 (near the cart on Jungle Island).

This involved a major re-work of the code to make it as generic as possible so I didn't have to cut and paste everything for each new disk.

I also moved a lot of common code to the loader, which freed up enough space on disk39 that I can hopefully add a few more images.

28 May 2024 -- v0.03

Tired of rotoscoping, more fit than I could have hoped for. Time to release! Also moved from QLOAD to QBOOT for that little extra bit of space, though it was a huge challenge remembering how the qkumba magic worked.

26 May 2024

As expected the rotoscoping of the maglev is taking forever. I started out trying to be too detailed, as there are lots of neat details in games like this that you only really notice when stepping through frame by frame. But anyway for both sanity and compression reasons you'll notice I started being a bit looser with the conversion.

23 May 2024 -- v0.02

Have the walking-around stuff more or less finished, depending on disk space. Also have the first movie (the maglev rotation) done. In the end just used zx02 compression as it gives better disk usage than the box-drawing stuff. What's left is mostly the longer movie, maybe moving to a QBOOT implementation (frees up 16k or so of disk space), and the actual main reason I was messing with this, trying out enhanced IIe keyboard handling.

16 May 2024 -- v0.01

The nearing of the Riven release had me thinking about it a bit. I was wondering if I could re-use my Second Reality lo-res animation code for one of the maglev scenes. And of course if I do that I might as well have some of the game leading up to it.

So far it's mostly been converting images and repurposing the hi-res Myst engine.

Vote for this at Pouet
Other Apple II Demakes
Other VMW Software Demos
Other Apple2 Projects
Back to the VMW Software Productions Page