Announcing "Zart" 2.0, a multi-platform Interpreter Library

(for links, see below in Zed’s comment)

Hello all,

Happy New Year!

We need more interpreters right? Right?

This project is not a new interpreter, but instead a unified, modern implementation of arguably the most popular interpreter VMs (Twine excluded). My attempt at this is a project I call “Zart”, which is developed with the Dart/Flutter language.

Source on github: atebitftw/zart

Background

Zart was originally my little labor of love to bring the Z-Machine onto a modern development platform, but I decided to expand it for broader interpreter support. Zart currently supports z-machine and glulx story files. I hope to add TADS 3 very soon.

Why Dart/Flutter?

Zart attempts to take full advantage of Dart’s Flutter framework, which allows any Flutter project to compile to multiple target platforms, with a modern UI/UX feel. Flutter supports the following compile targets: Window, Mac, Linux, Android, IOS and Web (transpiles to js/wasm).

Unified Engine-Agnostic API

Zart also provides a unified API interface called PlatformProvider, allowing developers to build player apps without needing to know the specific implementation details of the underlying interpreter engines. It essentially renders virtual screen updates, which any player app can then render out to their platform of choice. This means that any front-end developer can code to a single API that plays both Z-machine and Glulx games.

Take Glulx as an example, which pairs with an excellent IO standard in GLK. Zart implements GLK under the hood, and then exposes the rendered result as a simple array of render cells.

I may expose another option for these virtual screen updates which would also provide the “window” context data, allowing devs to have a bit more control over the layout. I found that for the demos I created, I didn’t need that level of granularity, but I’m open to providing it.

Z-Machine is similar (but with a less formalized IO layer), and eventually renders through the same pipeline as Glulx.

Demo Examples

I have written two demo player apps built on top of the library. I’m not really a “front-end” developer guy, but my hope is that others may eventually created better versions of these. Would love to see some IOS/Android versions eventually. That said, both of these players come with their own flavor of modern convenience, such as quick-save/restore, macros, and some color control.

Zart Web Player

Zart implemented with Flutter Web.
Zart Web Player Live Demo: (sorry, cannot post link :frowning: , there is a link to it on the github repo readme)

Source On Github: atebitftw/zart-player

Zart CLI

A full-featured terminal player using fancy ANSI tricks (only tested on Windows).

Source On Github: atebitftw/zart_cli

Up Next

As with any project like this, there is still a lot to do in terms of polish and supportability.

  • TADS 3 support.
  • While the vast majority of parser games that implement a fairly standard “status bar / text” format run fine, I haven’t rigorously tested the library with complex windowing scenarios . It works well with Beyond Zork’s rather ambitious layout, but on the Glulx side, I haven’t tested this exhaustively. It does however, support things like Inform 7’s boxed quotations (try out “Anchorhead” or “Across The Stars: The Ralckor Incident” to see this in action).
  • Graphics and sound are coded in, but I haven’t tested these exhaustively yet. If you play “Counterfeit Monkey” you will find that it defaults to a text-only mode on the web player.
  • Z-Machine v6 needs more love. Lots more.
  • Lots of other stuff I’m sure.
19 Likes

Links:

Zart Interactive Fiction Player
Zart live demo

Github repos:

Sounds very cool; I look forward to checking it out!

4 Likes

Thanks for the link support!

1 Like

TADS has been GPL licensed, including the Glk port.

3 Likes

Oh wow. I had assumed like all the other multi interpreters that you’ve embedded Glulxe or Git, but this actually has a brand new Glulxe implementation written in Dart! It’s been quite a while since someone has released one of those!

7 Likes

Ah cool. The license I was looking at was from tajmone/tads-sources/blob/master/tads3/LICENSE, which had some very specific constraint language in it. Just wanted to be sure.

1 Like

Yep these are all hand-crafted in Dart. Having the library entirely self-contained allows it to maximize Flutter’s multi-platform possibilities.

1 Like

Tads-runner was extracted from Gargoyle, which is where the GPL was granted. Other TADS interpreters typically use the original non-open source license.

If you’re intending to try to port TADS to Dart, well that’s a very ambitious task. It’s an order of magnitude bigger than any other interpreter, and no one in the community is really familiar with the code (now that Michael isn’t around). That’s why there’s no alternative implementations.

Edit: TADS 3 has dynamic compilation, meaning an interpreter also needs to include a TADS 3 compiler. This makes the task all that much bigger. But I wish you luck!

2 Likes

Ah interesting. I’m fairly far along with getting it up and running. Pretty fun so far! I’m using all the test files in tads-runner to help me validate; huge help.

6 Likes

If this handles the full HTML TADS 3 spec, and handles screen reader accessibility, then this will be a major game-changer of incredible magnitude.

8 Likes

Regarding the HTML spec. Doable. May not come out in the initial release of TADS, but definitely possible. Dart has strong HTML parsing support via it’s package manager. This would also open the door for possible Twine support via Flutter (fast-interpret a .twee file or something), so definitely intriguing.

Regarding screen readers. Accessibility is definitely on the radar. The good news is that Flutter already has strong support for screen readers at a semantic level, so wiring it up shouldn’t be too difficult.

7 Likes

This is one of the best things I’ve read in the last 6 months. I salute you.

5 Likes

Great work!

I checked out a few games and they all worked. I like the clean design.

However, when I randomly started up The Candy Striper of St. Asterix, Zart ate the top part of the (longish) introduction text and skipped straight to the title. On the Zart screen, right after I select the game from my hard drive and press enter, the text starts at the bolded “magazines” in the following intro text. (RESTART does the same thing.)
There’s a progress bar on the right side of the screen but I can’t move it up with the mouse or arrow keys.

(I’m on Microsoft Edge)

One more night. One more cold winter night. It’s been a painful four weeks but you’re SO close you can taste it. And then Mr. Rogers, your Ethics teacher can suck it.

You’re going to be a senior and you have BIG plans coming up this summer. Tiffany is going to be life-guarding at the pool and she’s promised to get you a cushy job at the snack bar. You’ll spend your working days surrounded by cute boy lifeguards and your off-time at the mall.

But then your grades started to slip and, inconceivably, the topic of summer school has come up. To avoid this, you took Ethics 101 this semester, an easy “A”. But, in order to pass, you have to perform some sort of volunteer activity for four long painful weeks. The concept of mandatory volunteerism seems odd to you but, nonetheless, here you are, working as a candy striper at St. Asterix Hospital, the oldest and most run-down hospital in the city.

It hasn’t been too bad. You mainly do busy work: delivering flowers, passing out magazines, getting patients their slippers or whatnot. Tonight’s your last night and your sponsor at the hospital, Mr. Jorry, was going to give you a letter confirming your volunteer hours after you also get the signatures of 8 patients and staff. But, rudely, Mr. Jorry has been found dead in his office. And, even worse, a blizzard blew in tonight and now it doesn’t seem like you can even get home.

Mr. Jorry may have been killed and the killer may still be in the building, trapped inside by the storm. But, more importantly, you are NOT going to summer school this year and you’ll unmask a murderer if you have to in order to get those signatures and that letter.

The Candy Striper of St. Asterix
A Totally Tubular 80s IF Game by Charles Moore, Jr.
Release 2 / Serial number 250115 / Inform v6.42 PunyInform v5.10dev

Second Floor Elevator Lobby
This is the second-floor elevator lobby. The elevator doors lie to the south, a small panel next to them. The elevator doors are currently closed. A stairwell lies to the north through an open doorway. You see a red sign here that reads “Ward A” above an arrow pointing down the hallway to the west and a blue sign reading “Ward B” above an arrow pointing east. To assist the confused or dense, a red line starts here on the floor and leads west and a similar blue line leads east.

The Candy Striper of St. Asterix - IFDB

3 Likes

Thank you so much for providing this. I tested many, many games and test files while developing these interpreters, so it’s a big help to have this feedback.

I opened a tracking issue on the project so I can trace this down and see what the cause is. I have a feeling it’s not to do with the Zart library itself, but with the way that the player app is presenting this particular game. I’ll get back to you when I have an update.

You used this on desktop version of Edge?

2 Likes

So far I’ve not been able to reproduce this. I’ve checked the game out on both Chrome and Edge (desktop) and the scroll bar (the “progress bar” that you mentioned), is scrollable for me. So I’m able to scroll up and read all of the text. When you click on the text and use your mouse-wheel to scroll, it doesn’t scroll?

I also checked it in the small screen mobile format, and am able to scroll the display.

Any more information you can provide would be helpful!

2 Likes

Edge on desktop. Well, laptop to be completely accurate.

I wouldn’t know about that. I’m using the touchpad on my laptop to click-and-hold the scroll bar (doesn’t work) or I click in the game-text window and use the arrow keys (doesn’t work either). When I’m home I’ll try connecting my mouse and see what the scroll-wheel does.

I’ll let you know.

3 Likes

Just got home. Scroll-wheel works as it should. I’ve gone so long with touchpad instead of real mouse that I expected the scroll-bar to respond to click-and-drag, clicking above or below the bar for page-up/down, or just arrow keys and page-up/down buttons (which I actually prefer).

2 Likes

I will definitely work on adding a wider array of gesture detection to the scroll logic.

Arrow keys are tricky. It’s not that I cannot implement them, but that some games use a menu-ing feature (Beyond Zork does this, for example) as part of the game, and this relies on arrow keys, and if I catch arrow keys for scrolling on the client, then this would prevent them from working on the menus. One compromise would be to add pgup/pgdn key support for scrolling (I do this in the CLI player).

3 Likes

You’re also handling CLI support?? :open_mouth: Are you my new favorite forum member???

4 Likes

:rofl: I’m glad you like it! Personally I prefer the CLI player over the Web player right now, even though the CLI player is bit more involved to install.

  1. Install the Dart SDK at https://dart.dev/get-dart
  2. From CLI run this to install zart globally:
    dart pub global activate --source git git@github.com:atebitftw/zart_cli.git
  3. Then you can run games from CLI with: zart minizork.z3.

I’d love to have some feedback on this, because I’ve only tested it on Windows Terminal so far. Theoretically it should run on Mac and Linux CLIs as well.

Happy gaming!

2 Likes