Zeta - a different approach to modern-day ZZT

Discuss how totally awesome Bang! is here.

Moderator: Terryn

asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

Zeta - a different approach to modern-day ZZT

Post 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.
User avatar
Appetite4
Official Clamp School Defender
Posts: 204
Joined: Tue Nov 18, 2014 4:57 am
Contact:

Re: Zeta

Post 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.
asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

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

Post 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.
User avatar
zamros
my power level is enormous
Posts: 543
Joined: Thu Mar 20, 2003 9:34 pm

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

Post 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.
User avatar
Saxxon
the Gargoyle.
Posts: 608
Joined: Tue Jul 25, 2006 10:02 am
Contact:

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

Post by Saxxon »

This is *awesome*.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

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

Post 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?
*POW* *CLANK* *PING*
ZZTBandit
Ordinery
Posts: 45
Joined: Wed Sep 07, 2016 6:07 pm
Location: neutral

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

Post 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.
asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

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

Post 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.
ZZTBandit
Ordinery
Posts: 45
Joined: Wed Sep 07, 2016 6:07 pm
Location: neutral

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

Post 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.
User avatar
Smilymzx
I hope she made lotsa spaghetti!
Posts: 182
Joined: Sat May 20, 2006 2:58 am
Location: LocacoLocacoL :LoL!

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

Post 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.
asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

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

Post 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...
asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

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

Post 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!
User avatar
emmzee
newcomer
Posts: 12
Joined: Thu Aug 01, 2019 2:24 pm

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

Post 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.
User avatar
Zephyr
aaaa my capilaries
Posts: 129
Joined: Sat Jul 26, 2003 11:12 pm

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

Post 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.
asie
1 full minit uv 1 secend mesiges
Posts: 67
Joined: Sun Mar 17, 2019 4:55 pm

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

Post 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?
Post Reply