Page 1 of 4

Zeta - a different approach to modern-day ZZT

Posted: Sun Mar 17, 2019 5:02 pm
by asie
Hey, asie here. (New account; I lost the password for mine years ago, and had since deleted the e-mail account used to register it. Ouch!)

I've recently been hacking away at a not-quite-clone of ZZT called "Zeta"; that is, an emulator specifically designed to only emulate the subset of PC/DOS architecture necessary to run ZZT and Super ZZT. Effectively, the goal is to "virtualize" the original ZZT binary, but in a modern environment and without the friction of using DOSBox and likewise.

Some of the highlights include:
  • Automatic speed scaling - as the engine's structure can be assumed, we can figure out exactly when a tick has ended. This allows to run at significantly less than 100% CPU usage (for most games), making running ZZT viable on laptops and other lower-power devices.
  • Small C11 codebase with a separated emulator core and frontend, leading to many opportunities for portability (the SDL and WebAssembly frontends are released, with an Android one in the works).
  • Distribution and testing measures - distribute your ZZT game with Zeta to maximize user-friendliness, embed it on websites like itch.io to reach non-ZZT players, or use Zeta with KevEdit for quick testing on modern systems!
The system has been employed in production for the past few days at the Museum of ZZT to great success.

You can find more information, source code and downloads right here.

Re: Zeta

Posted: Tue Mar 19, 2019 12:45 am
by Appetite4
Pretty neat! It's nearly one-to-one with the DosBox emulator through archive.org.

Something that I'd recommend for config purposes (maybe this is something Museum of ZZT needs to control?):

Keyboard typematic rate and delay.

I prefer to keep the delay minimized. If it's too long, you're too "slow" to run and auto-fire in many ZZT games. I managed to decouple the rate and delay from the one built into the native-run OS with ZZT Ultra. I assume you can do so easily from this emulated-services environment.

Which was it again? INT 16H, service AH=03H, AL=05H, BL=rate, BH=delay. Set BH=0 for minimal delay.

Re: Zeta - a different approach to modern-day ZZT

Posted: Tue Mar 19, 2019 9:00 am
by asie
That's doable! I already have the API methods for setting delay values in place, I just need to expose them (and clean up the code for it). I'll see about it, though my priority right now is adding persistent saving support to the web version.

Re: Zeta - a different approach to modern-day ZZT

Posted: Tue Mar 19, 2019 9:02 pm
by zamros
This is great, thanks for all the work that must have gone in to it! I've never liked Dosbox for running ZZT but had to accept it, but not anymore.

Re: Zeta - a different approach to modern-day ZZT

Posted: Wed Mar 20, 2019 12:43 am
by Saxxon
This is *awesome*.

Re: Zeta - a different approach to modern-day ZZT

Posted: Wed Mar 20, 2019 3:52 pm
by Commodore
Great work! This is super cool! I could get the game to pop out but then I lost the buttons for zooming, are there keyboard shortcuts? Fullscreen is a WIP or am I in need of a browser upgrade? Firefox 60.0.2 on Linux.

How do I get to Kevedit?

Re: Zeta - a different approach to modern-day ZZT

Posted: Wed Mar 20, 2019 7:30 pm
by ZZTBandit
Hi asie, Congrats on a winning engine.

Not to hijack your thread but I too am displeased with DOSBox performance so I took this out for a spin.. I will say, it's well executed and about as good as it's going to get but not even close to real hardware! Judge for yourself: geocities.ws/bestofzzt/zetatest

It's sluggish on a modest dual AMD64 @ 1.7GHZ setup with Brave 0.61.51 / Chromium 73.0.3683.75 and Debian 9 / Windows 10 but good enough to swap DOSBox out with so thanks.

Re: Zeta - a different approach to modern-day ZZT

Posted: Wed Mar 20, 2019 8:02 pm
by asie
Commodore wrote:Great work! This is super cool! I could get the game to pop out but then I lost the buttons for zooming, are there keyboard shortcuts? Fullscreen is a WIP or am I in need of a browser upgrade? Firefox 60.0.2 on Linux.

How do I get to Kevedit?
In order:

1. The popout/fullscreen stuff on either the Museum of ZZT or itch.io is created by the respective administrators; assuming the Museum here, you'll have to ask Dr_Dos.

2. I haven't ported KevEdit to HTML5! I think that would be... rather silly - the intention of the HTML5 port is to allow game creators and archivers to embed ZZT games in a modern way, for a modern audience. For running Zeta with KevEdit, you're supposed to use either the compiled Windows version or compile your own Linux version and put it in the same directory KevEdit is in + edit default.zln.
ZZTBandit wrote:(...) not even close to real hardware! (...) It's sluggish on a modest dual AMD64 @ 1.7GHZ setup with Brave 0.61.51 / Chromium 73.0.3683.75 and Debian 9 / Windows 10 but good enough to swap DOSBox out with so thanks.
Well, yes - it's still fundamentally an interpreter emulator running an unoptimized Turbo Pascal executable. Don't expect it to run anywhere near real hardware peformance - if I were to attempt that, I'd probably look at recompiling the executable on first launch... Keep in mind that:
  • KEYBOARD.ZZT is quite a performance-intensive board - most ZZT games use significantly less CPU time, although I'm pretty sure PortalZZT by nupanick actually uses more CPU power,
  • The native (non-web) version should run with a fair bit less overhead. It also benefits from calculating audio and graphics updates in separate threads.

Re: Zeta - a different approach to modern-day ZZT

Posted: Wed Mar 20, 2019 8:34 pm
by ZZTBandit
Cool beans.

I think Avarice is up there in terms of CPU intensity on the Super ZZT side anyway.

Switching over should be pretty painless. I'll give it a go one of these days.

Re: Zeta - a different approach to modern-day ZZT

Posted: Thu Mar 21, 2019 1:19 am
by Smilymzx
Is there a way to actually do this in future versions?:

- .CHR format, with size support: Fixed Width of 8, Variable Height from 8 through 16, Default is 8x14 (Megazeux CHR Format)
- .PAL format support: See MegaZeux PAL format
- .PLD format support: basically all 64 colors from EGA format converted to VGA for editing (only default 16 colors editable)
- [Optional request] DOS-based "scanline mode" support: 25/43/50, (Is this 43 is default on 8x14 EGA and VGA?)

Some of this is actually from the TSR Quantum P. built, which I was to add into. but who needs that!

The PLD format was from an old editor, see ZZT custom palette (UPAL), both that and FM should've been superceded by the TSR that was made by Quantum P.

Re: Zeta - a different approach to modern-day ZZT

Posted: Thu Mar 21, 2019 7:14 am
by asie
Smilymzx wrote:Is there a way to actually do this in future versions?:

- .CHR format, with size support: Fixed Width of 8, Variable Height from 8 through 16, Default is 8x14 (Megazeux CHR Format)
- .PAL format support: See MegaZeux PAL format
- .PLD format support: basically all 64 colors from EGA format converted to VGA for editing (only default 16 colors editable)
- [Optional request] DOS-based "scanline mode" support: 25/43/50, (Is this 43 is default on 8x14 EGA and VGA?)

Some of this is actually from the TSR Quantum P. built, which I was to add into. but who needs that!

The PLD format was from an old editor, see ZZT custom palette (UPAL), both that and FM should've been superceded by the TSR that was made by Quantum P.
There's already some in-code work to support some of this:

- A few remaining places assume 8x14 is hardcoded, but those can be eradicated - the data is already effectively passed around as a byte array, so loading a .CHR would be trivial (and ZZFont is already supported for 8x14 sizes!). For the web version, you can just replace ascii.png - it does not generate the texture at runtime for now.
- The palette is a bit more hardcoded, but it wouldn't be difficult to add .PAL support likewise.
- I'm not familiar with the PLD format, sorry.
- "Scanline mode"? I thought ZZT is hardcoded to do 80x25...

What I would probably do is either:

- upon loading a .ZZT file, check for a .CHR and .PAL file with the same filename - if present, load them,
- or just add web/SDL frontend arguments...

Re: Zeta - a different approach to modern-day ZZT

Posted: Sat Jun 29, 2019 8:05 pm
by asie
So, there was a minor update on the 16th of June to fix a screenshot corruption bug. As I now hold a full-time job, it will be a bit harder for me to update Zeta.

HOWEVER! If you're a ZZT game developer, and need help publishing the games on Itch.io or your personal website via the HTML5 port, post in this thread and I'll help you. Let's get those ZZT productions more widespread again!

Re: Zeta - a different approach to modern-day ZZT

Posted: Thu Aug 01, 2019 2:28 pm
by emmzee
Thanks, just switched my itch.io page from the archive.org DOSBox implementation to Zeta

https://emmzee.itch.io/daedalus-obelisk-zzt

Yup registered just to say that.

Re: Zeta - a different approach to modern-day ZZT

Posted: Fri Aug 02, 2019 3:18 pm
by Zephyr
Having a bit of trouble figuring out how to run Zeta with kevedit.

I read this:
To use Zeta with KevEdit, edit default.zln to replace "action zzt [...]" with the following:

action zzt run zeta86 -t %1
I assumed "default.zln" was a file created in the kevedit folder when kevedit is installed but I can't find it anywhere.

Re: Zeta - a different approach to modern-day ZZT

Posted: Sun Aug 04, 2019 4:46 pm
by asie
Zephyr wrote:Having a bit of trouble figuring out how to run Zeta with kevedit.

I read this:
To use Zeta with KevEdit, edit default.zln to replace "action zzt [...]" with the following:

action zzt run zeta86 -t %1
I assumed "default.zln" was a file created in the kevedit folder when kevedit is installed but I can't find it anywhere.
Huh. It did get created for me when I was testing... Could you try creating one by hand?