scottvr / wadzilla

"It Runs Doom." "Zork?" "Yes." Wadzilla converts Doom WAD files into ZIL text format suitable for compilation to an Infocom-style game, because Doom on Everything.
33 stars 3 forks source link

Output is not ZIL #2

Open Quuxplusone opened 4 months ago

Quuxplusone commented 4 months ago

Here's how I managed to experiment with this repo on an M1 MacBook:

git clone https://github.com/scottvr/wadzilla
cd wadzilla
curl -O "https://raw.githubusercontent.com/dabignerd/doom-wads/master/zips/Freedoom%20-%20Phase%201%20(v0.12.1).zip"
unzip "Freedoom%20-%20Phase%201%20(v0.12.1).zip"
pip install bs4
python wadzilla.py --basewad FREEDOOM1.WAD

brew install mercurial
hg clone https://foss.heptapod.net/zilf/zilf
cd zilf
brew install --cask dotnet-sdk
dotnet build Zilf.sln
cd ..

zilf/bin/Debug/net8.0/Zilf -c output.zil
# ...produces a mass of errors!

The Python script wadzilla.py generates an output file named output.zil. Problem is, despite the extension, that file definitely doesn't contain ZIL code! As of this writing, it starts with:

<ROOM 0 FLAT3/SFLR6_4>
FLOOR HEIGHT: 0, CEILING HEIGHT: 104
Floor: Unknown texture FLAT3
Ceiling: Unknown texture SFLR6_4
Walls:
 - SKSNAKE2
 - Right: STARGR1, Left: ASHWALL
 - Right: SKSNAKE2
 - Right: SKSNAKE2
 - Right: SKSNAKE2
 - Right: SKSNAKE2
Things:

Steve Meretzky's Learning ZIL shows a typical room description in actual ZIL:

<ROOM LIVING-ROOM (LOC ROOMS)
  (DESC "Living Room")
  (EAST TO KITCHEN)
  (WEST TO STRANGE-PASSAGE IF CYCLOPS-FLED ELSE "The wooden door is nailed shut.")
  (DOWN PER TRAP-DOOR-EXIT)
  (ACTION LIVING ROOM-F)
  (FLAGS RLANDBIT ONBIT SACREDBIT)
  (GLOBAL STAIRS)
  (THINGS <> NAILS NAILS-PSEUDO)>

So, output.zil bears no resemblance to ZIL at all. The ZILF compiler will immediately complain because the room's name is 0, which is not a Lisp atom; it needs to be something like ROOM-0 instead. And FLAT3/SFLR6_4 isn't Lisp syntax. And then there's a bunch of YAMLish stuff with hyphens and colons that's also clearly not ZIL. And there's no mention of exits from any room. And so on.

Your FAQ currently contains super misleading sentences like:

Although in theory it “works”, it does not create an entertaining experience as a game

You can generate a stand-alone ZIL file, or give my tool an existing ZIL file and tell it to throw a Doom teleporter disk on the floor, where you would then enter the Martian hell [...]

So can you play further than the first doom level?

At present you cannot create a ZIL file (only this weird sort of YAML-hybrid debug output), and you certainly cannot enter or play the first Doom level. What you have actually made here ("so far") is simply a way to dump WAD files from binary into structured text. It has nothing to do with ZIL. The only "experience" it provides ("so far") is that you can read the tool's output with your eyeballs. The output doesn't feed into anything else.


Now, the good news is that since the output isn't ZIL ("yet"), you have the option to give up on ZIL and make it output Inform6 code instead. ;) Inform6 code (see the Inform Designers' Manual) can be compiled straight to .z5 or .z8 via the very widely available inform6 package, thus widening your target audience from "people who can build C#/.NET code" to "people who can install a package."

scottvr commented 4 months ago

Hey thanks man.. Yeah, you get it.. I introduced some silly syntax shit in the output (sleep deprivation) at some point and apparently never looked back and doubled down moving forward from just outputting debug messages to outputting “ZIL”.

tests? Did someone say something about tests? Smacks my own head. I’ll fix. I was fishing for help when I posted it, and it has proved a useful endeavor so far. Thanks a lot.

Lulz.. oh me.. that’s a pretty embarrassing mistake though. sorry. I did try to disclaim actual usability claims in my writeups, but I realize now most people TL;DR right through that. I appreciate you actually taking time for this.

scottvr commented 4 months ago

lol I realize now that with all my attention on populating and formatting the read me and wiki page, that amongst all the copies pulls and pushes trying to get some pretty disorganized local development directories in a state where they could be shared on GitHub, at some point I introduced some (btw you pretty accurately called it that it was debug output. I think I mention in the wiki or faq that I was highly amused by the results at the point where I was just spewing debug text and I knew what it meant) early format where obviously devops dayjobs experience had crept in as influence for the stylization and uh boy… as I said, that’s embarrassing.

I’ll have to try not to read any HN commments in case they be demotivating hate-filled comments from people who have experienced what you have described :-) and just stay heads down until I merge all the right syntactical structure back in amongst the heavier lifting actual progress I made, and make the code reality match the docs.

You make a compelling argument re Inform, so I’ll keep that tab open as I work toward resolution.

scottvr commented 4 months ago

I just pushed with corrected syntax. I think I introduced the problem when I was aiming for a single ZIL file output, instead of the multi ZIL file output I should be using. ROOMs should be ok, but of course, now things are no longer placed in them until I get the additional files worked out. I can leave this open though until Things are fixed

Quuxplusone commented 4 months ago

Okay, I got a bit nerdsniped: https://github.com/scottvr/wadzilla/compare/main...Quuxplusone:wadzilla:ajo I think you're going to have trouble with ZILF if it really only supports 255 objects in the whole game.

The next thing you'll have to figure out is how movement should work.

(The "Empty game template" linked from https://foss.heptapod.net/zilf/zilf/-/wikis/Getting-Started was super useful.)

scottvr commented 4 months ago

Okay, I got a bit nerdsniped: main...Quuxplusone:wadzilla:ajo I think you're going to have trouble with ZILF if it really only supports 255 objects in the whole game.

The next thing you'll have to figure out is how movement should work.

(The "Empty game template" linked from https://foss.heptapod.net/zilf/zilf/-/wikis/Getting-Started was super useful.)

I love that you have no time to wait and see if I’ll even try to address it all. :-) Really, that’s awesome. I knew some folks would be amused by the idea, but didn’t really have high hopes that anyone would step up and help out. That’s awesome. Thanks! We can get as close as is technically possible within whatever other constraints there still may be to discover.

Regarding these aforementioned uknown limitations, I feel certain it will come as no surprise to you that this not a project that naturally emerged because I happen to be an expert in both ZIL and the DOOM internals; not at all. I only knew the idea was a fun one so have been learning how things are structured in these game files, and just glossing over output syntax documentation far enough to find an example that looks like it fits the case for whatever thing I’ve just learned needed to be done. No meticulous planning or strategy, in fact none at all beyond a few minutes ahead of implementation. “OK how to ingest a WAD?” (go read on the Doom wiki) “ok what should I do with these lumps?” (Go read on the doom wiki) “ok, now how should we get this list of 8 character texture names transformed into something fun to read?”

That last ponderance is actually why I have pushed no commits in the last day:l, having arrived at at least solution workable enough to test for feasibility, with not-entirely-discouraging early results. (it’s along the lines of how Wadzilla gets the Things descriptions, but a little less structured.)

I did start down the CV and multimodal ML model route, but with the amount of immediate interest in playing DOOM in Zork (DiZ?) that is readily apparent when certain folks hear of the ludicrous idea, I quickly realized that I am not willing to foot the financial cost of neither GPU hosting nor a whole lot of API calls, so I found an alternate route that isn’t as high tech as AI, but it does score higher in ludicrousness.

Thanks again for joining the effort and taking the initiative when you caught me slacking. :-)