Hacker News new | past | comments | ask | show | jobs | submit login

ZZT holds a special place in my heart. I played the shareware "Town of ZZT" as a teenager, made my own (very incomplete) worlds, and had fun with the programming language, ZZT-OOP -- a very quirky beast.

Every few years I have a silly notion I want to write a similar game but with a real programming language like Lua (or one of my own creation). Then I sketch up the easy stuff for a bit, but give up as soon as it gets hard. :-)

I think there's been something of a resurgence of ZZT stuff in recent times, thanks in no small part to Adrian Siekierka's work, particularly his "Reconstruction of ZZT", a reverse engineering of the lost Turbo Pascal source code. That project is incredible to me -- the reconstructed source code, when compiled with Turbo Pascal 5.5, compiles to an executable file that's byte-for-byte identical to the original ZZT.EXE. His description is here: https://blog.asie.pl/2020/08/reconstructing-zzt/

One fun thing I did do was take Adrian's Pascal source code, and write a Pascal-to-Go transpiler to produce a Go version of the same. It kinda works: https://benhoyt.com/writings/zzt-in-go/

There's also a fully functioning Rust port, which was written before the reconstructed source was available: https://github.com/yokljo/ruzzt




I played ZZT a lot, and found that you could unlock the other levels with a hex editor by just changing their name in the binary. From there, you could open it up in the editor and figure out how they implemented a lot of their stuff. ZZT-OOP was very quirky, but so cool for the time!


I went back to this since I was just a wee lad when I did this, and it's not quite what I remembered but I was close. You have to change the string "SECRET" in the header to anything else. At this point you can load the file into the board editor and see how things were done.

Here is an image of TOWN.ZZT loaded into the editor: https://i.imgur.com/mb9OFno.png

And here is the pascal string "SECRET" changed to "NECRET": https://i.imgur.com/kbh5xAm.png

I'm surprised that 12-year old me thought to do this.


To be exact, what you're editing is an array of ten 20-byte Pascal strings (so length-prefixed) which contain the world's flags. A ZZT Object can set or clear flags which are carried across boards; this mechanism was repurposed to add the "SECRET" flag, which blocks editing with the built-in ZZT Editor.

Unless... you use the "?" key to open the cheat console, and type in "+DEBUG" as a command (in ZZT 3.1+, IIRC) - then it will let you open the worlds and edit them as-is.


Yes, I dug in a bit further and found where it was checked in the editor. (at least in the reconstruction!)

https://github.com/asiekierka/reconstruction-of-zzt/blob/mas...

It looks like the SECRET flag was intended to prevent editing of both save files and built-in worlds.


The save file check is separate to the SECRET flag, but they are both meant to not be editable. (Of course, community-made external editors like KevEdit lift this restriction.)


I understand. With that being said, changing "SECRET" to "NECRET" and then saving results in a .SAV file with "SECRET" in place again.


Source reconstructions efforts are one of those things in programming that make me realise how little I know and how bad I actually am at this job!


If the Town of ZZT holds a special place in your heart, I _strongly_ recommend the Town Remix.


I also have fond memories of ZZT; my first encounter with it was a shareware disc of "SuperZZT's Monster Zoo", which I gather was a somewhat less-popular sequel with a screen that was allowed to scroll rather than paging over. Some of the fan-made worlds were really impressive in how they managed to accomplish visual and gameplay effects.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: