This page is talking about some proof of concept work done on an AGI-like
interpreter I made checking for the feasability of a hi-res MYST with
graphics similar to "The Wizard and the Princess".
For info on the hi-res Myst proof of concept using this library
see here
Details
I was prepping for a Mysterium talk and got to thinking about the eternal
question people ask, "why not hi-res". Higher resolution graphics take
up a lot more space, but you can use tricks like they did back in the 1980s
to essentially make simple vector-based graphics. These are slow and
often cartoony looking, but can be a good compromise between lo-res
graphics and super-detailed bitmaps.
I did a silly proof of concept in 280 bytes of Applesoft BASIC
on the Apple II twitter bot and enough
people liked it that I decided to put together a small graphics lib.
As you'll note, I've only implemented a few of the scenes. It's a lot of
work, and to do a full game you need 800+! Also for proper gameplay you'd
want a hi-res sprite library and a few other things that are tricky in
hi-res on the Apple II which has a famously obtuse graphics subsystem
(a lot of the complexities can probably be placed on Woz's amazing
hardware optimizations to save gates, but you have to make up for it in
software).
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.
Implementation
The Apple II hi-res graphics are a bit too complex to get into here.
Roughly, you get 280x192 graphics with 6 colors. There are complex rules
about which colors can go where, and you get NTSC fringing.
My VGI (VMW vector-graphics interpreter) is just a small commandset with
up to 16 commands, followed by hard-coded paramaters. You can specify colors
and draw circles, boxes, and triangles (with lots of limitations because
I am lazy and some drawing primitives are legitamitely hard to code, expecially
in 8-bit with no floating point and no multiply/divide). I did write an
accelerated box-draw primitive because otherwise the scenes took too long
to draw.
You can read the documenation on it here:README.VGI
The text interaction isn't real, it's just some hard coded responses.
It's using the Apple II ROM input routines, a side effect of which you
can't "OPEN" the door as Applesoft thinks you're trying to open a file
on disk and throws an error.
Video
An information video, with a capture on a real Apple IIe platinum:
Screenshots
Note: these were captured with the AppleWin emulator.
Also, watch the video if you can, half the fun is watching them draw.
So would it be possible to make a game in hires with the same footprint
as the lores game? It might be, although losing 8k of RAM for the framebuffer
will hurt. Also the VGI decoder is a few K as well, and we'd have to write
a sprite library for the pointer, and not sure what to do about animations
and such.
But for the clock image:
Hires -- 8k Raw
VGI command list is 385 bytes
The resulting 8k picture, compressed with LZSA is
1228 bytes, so the command list is still smaller
Lores -- 1k Raw
The lzsa compressed image is 354 bytes. So roughly
the same size as the VGI command list.
Note, the tradeoffs listed here are going to vary depending
on how complex the graphic is, and how many details the
artist tries to cram into the image.
System Requirements
Any sort of Apple II should work (II/II+/IIe)
Should also run on IIc or IIgs but not tested as much
I always say no but that doesn't always end up being true.
I fairly certain this time I don't have time to do it.
Q. Was it hard to write this?
A.
Putting together a brief demo is always easier than making
something fully playable. I was already working on the drawing
primitives for another project so I had a lot of existing
code to work with.
Q. So how did you draw the graphics?
A. I took screenshots from SCUMMVM, scaled them to 280x192,
and then used The Gimp to put co-ordinates into a text file.
I have a tool that parses the text file into a hex dump
I can load into the assembler. It was all done by hand this way.
Q. What's with the sarcastic text-adventure? Don't you like Myst?
A. I do like Myst, otherwise I wouldn't do these projects.
I have spent (I feel) an inordinate amount of my life solving
Atrus's problems and apprently sometiems that expresses itself
in sarcastic demakes.
Development Notes
15 July 2021
Added initial support to the Apple II lores Myst engine, see
more info here
21 June 2021
Finally got things posted. Thought I was done but forgot I wanted to
do a fireplace scene too.
20 June 2021
Wrote filled circle code. Did not write generic triangle routine, even
though it would be useful. It's actually hard to write an 8-bit generic
triangles. You can modify the Bresenham line drawing, but even that's hard
to do in 8-bits because it uses signed numbers and you quickly run out of room.
19 June 2021
The initial box drawing routine using the Applesoft HGR ROM routines is
too slow. Mostly because it has no dedicated horizontal line drawing code
so it is doing slow address calculation and drawing point-at-a-time.
Writing a fast horizontal line myself turned out to be a huge undertaking
and my code is still full of off-by-one errors. While it's fun to curse
Woz here, most of my problem was normal stuff like edge cases when the line
doesn't start cleanly at byte boundaries (you'd have those issues on any
platform). The weird Apple II address stuff can mostly be hidden with
some lookup tables (even the weird divide-by-7 stuff).
16 June 2021
Posted an Apple II Basic bot initial implementation which ended up being
way more popular than I expected. Since this is vaguely related to a
talk I'm giving next month I decided to see how quickly I could put together
a "real" vector interpreted scene.