Zelda Classic in the browser

OpenZC Development Topics
Post Reply
connor.clark
Posts: 1
Joined: Thu Feb 11, 2021 2:14 am

Zelda Classic in the browser

Post by connor.clark »

TL;DR: I made a prototype web version of a Zelda Classic-like game engine [1] [2]. To support it, I made a tool that the ZC community might find useful [3]. Plus, a general inquiry about compiling ZC to WASM.

A few months ago, I found myself with some weeks of vacation and wanted to make a game engine for a zelda-like game. I work on developer tooling for web developers, so my expertise lies with web technology, so that’s what I chose. Actually finishing this project was never a goal; I mainly wanted to take a step back from another web game I’m making, so that I could rethink some design (in)decisions that had arisen.

Over the last decade I’ve played a few amazing quests in Zelda Classic. Pretty quickly in my game engine prototype I figured I should spend less time making my own equivalent of tileset assets, maps, enemies, etc., and leverage some ZC quest files to bootstrap things and get to the more interesting parts. To do that, I needed a way to extract data from quest files to JSON, so I made a tool.

The Zquest data tool only reads data, and doesn’t support every possible version of quest files (I only added support to read quest files I wanted to read; adding more is straightforward but time consuming). There’s also a simple feature for extracting images of the tileset; I didn’t really need this, so it’s not very fleshed out. You must hardcode a Cset to get something that isn’t garbage. I had no need to write anything back to quest files, but the process would be the same (lots of reverse engineering, reading the save/load code in ZC). I imagine that if a writing feature were implemented, ZC quest makers could use this tool to do bulk edits that would otherwise be time consuming to do in the editor. I’d be happy to work more on this tool if someone would find it useful.

Initially, I was making the enemy logic myself, not copying whatever ZC did. I began to lose motivation when attempting to re-code the ZC logic in JS–the complexity was just growing too quickly. If I picked this up again, I’d probably instead design the enemy logic myself and not attempt reverse engineering ZC's enemy logic (which really means recoding the entire engine). I briefly looked into if it’d be possible to compile the ZC enemy logic into WASM to reuse it, but at that point, you might as well compile all of ZC to WASM.

Speaking of WASM, is there any interest in modifying ZC to compile to WASM? When I tried, I recall mostly getting errors from the allegro library. ZC currently uses allegro 4, and I see that allegro 5 supports emscripten. I’m sure there are other large tasks required to enable a WASM export, but allegro 4 -> 5 seems like the largest task. I think so many more people would pick up ZC if it could run in a browser. This possibility alone makes me shy away from continuing my “Quest Maker” prototype.

[1] https://hoten.cc/quest-maker/play/
[2] https://github.com/connorjclark/quest-maker
[3] https://github.com/connorjclark/zquest-data

Post Reply