Jump to content

Photo

Zelda Classic in the browser


  • Please log in to reply
1 reply to this topic

#1 connor.clark

connor.clark

    Junior

  • ZC Developers

Posted 14 February 2021 - 10:10 PM

(originally posted on openzc.org, but it seems that forum is not very active yet. Tried AG forums next but registration is turned off... )

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.
 

  • DietWater likes this

#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 18 February 2021 - 01:18 AM

 

(originally posted on openzc.org, but it seems that forum is not very active yet. Tried AG forums next but registration is turned off... )

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.
 

 

 

 

 

The dependency on allegro 4 and other libs makes this entirely impractical, but feel free to use our basecode in any way that you see fit. One prior dev wanted to port ZC to JS, and, I literally lost it laughing. The ZC code is very much dedicated to old very specific resources and cannot be decoded easily any other way. 




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users