pivotal
Newbie
Posts: 2
Registered: 06-11 |
Wow, I didn't expect this much feedback! I went out of town shortly after I posted the thread, and I was without internet access, so I haven't responded yet.
natt said:
To differ between doom2 and tnt/plutonia, you have to get into texture stuff as well.
I'm sure you could make a basic iwad detector rather easily, but you could spend quite a long time on edge cases and whatnot.
I figured that making something that works 100% of the time would be difficult, so I'm going to shoot for 95%+, and let the user correct any mistakes. I hadn't thought about checking texture names, that's a good idea.
Gez said:
What you can try is search for map lumps. If they're in the form ExMy, you can assume they're for Ultimate Doom; if they're in the form MAPxx, you can assume they're for Doom II.
However, there are plenty of other IWADs. Maybe it require TNT.wad or Plutonia.wad rather than doom2.wad. Detecting such cases from a simple scanning of the directory would be impossible; you'd have to analyze the map lumps -- notably the SIDEDEFS lumps -- to find references to TNT- or Plutonia-specific textures.
The thing to keep in mind is just that unless you start keeping databases in your application, you'll have a system that might work most of the times (the overwhelming majority of PWADs ever made is for Doom II, followed by Ultimate Doom; everything else is a tiny minority) but still commit a mistake from time to time; so keep a way for the user to override automatic detection.
I figured out that I can search for ExMy and MAPxx to narrow down the search, but that still leaves the problem of PWADs that use TNT/Plutonia/Hexen/Strife/Chex Quest.
Like I said above, I'm not shooting for 100% accuracy. You make a good point about overriding autodetect. I figure I could try matching, and then display to the user what IWAD matched, and if it is incorrect, let the user specify the correct IWAD.
Also, to get around having to include a database of all known PWADs, I've been experimenting with searching the idgames database and scraping info from there. If a PWAD runs down the list of tests to determine the IWAD, and a conclusive match isn't found, I could scrape the info from the idgames database to get the correct IWAD.
wesleyjohnson said:
Everything they said, plus more.
Also need to determine the correct advanced port:
DoomLegacy has some unique sidedef type codes.
ZDoom has some unique sidedef type codes.
There is some IWAD wad recognition code in ZDoom (and in DoomLegacy) that already does a good job of determining the IWAD. I recommend looking at the GDESC_ code in DoomLegacy d_main.c as it is table based.
The same texture names appearing in a PWAD will restrict the possible IWADS.
There have been a few times I wished I had a tool to determine this, as many PWAD do not work as the notes described.
Some wads require more help.
Running caesar.wad on DoomLegacy, using FreeDoom IWAD requires also loading gothic2.wad, to get the PNAMES lump. Using the Doom original IWAD does not have this problem. Yet, if you are using FreeDoom because you do not have the original Doom wads, then it is rather important.
Download XWADTOOLS (for Linux), which has many little programs that already does some of this work, and has some docs.
You might start by deliberately running PWAD with the wrong IWAD, and seeing how the port errors occur. Then code a similar usage as a test (probably can get a good start from the port code that detects the error).
Thanks, this is all useful. Looking at code someone else wrote to solve a similar problem is always helpful. I'll check out XWADTOOLS to learn more.
Maes said:
Hey hey hey these are not enterprisey solutions. Clearly, we must define an XML-based metadata standard for WAD files, to be embedded as a lump in WAD files. Did I mention it would have to be XML-based?
Haha, if I went down this path, I could use this hardware XML appliance from IBM:
http://www-01.ibm.com/software/inte.../xi50/features/
hex11 said:
Seriously now, I like the CLI front-end idea. One feature that you might also consider is the ability to pull ratings/reviews from the doomworld database. It should be really trivial, if you can obtain the id <-> file mapping they use in their database. For example, TeamTNT's Icarus megawad is id 5191:
http://www.doomworld.com/idgames/index.php?id=5191
And you can easily pull just the reviews:
http://www.doomworld.com/idgames/if...iew.php?id=5191
There might even be a way to grab the rating score(s) also, without scraping the index.php page.
You could go further still, and allow submitting ratings/comments, since it's only necessary to solve a simple math problem. Then again, the site admins may or may not like that, but it's something to think about...
After I read the first couple posts in this thread, I started playing around with scraping idgames for info instead of trying to detect a bunch of difficult edge cases. Then I realized I could easily get ratings, allow WAD downloads, etc. Submitting ratings and reviews is a good idea, I'll consider that. I'll get in touch with whoever runs idgames first to get their approval.
Thanks for all the suggestions so far. I'll try to keep this thread updated.
Oh, one more idea I had was to do user-defined aliases. Let's say you're recording speedruns, and you're sick of typing out the command with arguments every time. My goal is to let you pick all the arguments you want to use, and save it as an alias so you can do it quickly.
Well, time to get coding.
|