3dfxdev / EDGE

EDGE Source Code
http://edge2.sf.net
74 stars 10 forks source link

IWAD handling (EGM vs INI) #74

Open Corbachu opened 4 years ago

Corbachu commented 4 years ago

So, now that we have proper INI support, one of the big things I want to do is change how IWADS are handled. Currently, EDGE has a list of defined IWADS in e_main, but of course it only loads what is found in root. My plan here is to change this, perhaps implementing GTK3 handling from QZDoom, or something alike that will give the user a list of current IWADS found and which one it wants to load.

I was also thinking of making it smarter when it comes to handling DOOM episodes - in the case of DOOM, DOOM 2, and SIGIL all being present, give the user the option to load all three at once to give the full episode list. Currently this works perfectly on EDGE out of box, but only if you drag both Doom.wad and SIGIL.wad over EDGE’s executable with DOOM2 present in the directory.

At any rate, the code in e_main is old and was continually patched over, so implementing proper IWAD handling would be awesome.

Another related item is that if EDGE detects unknown IWADS with the magic number, we can list those as well. DARKWAR will also need to be listed.

Conversely, we could also support loading text files named .EGM and have INI point to that. See the following: EGM Specification Tech Sheet

So either basic strings in the INI that gets written if user selects always remember IWAD (maybe we can also give them an option to manually browse for those). Or we implement the EGM format and have EDGE’s INI look for those and determine IWAD and PWAD handling, which would be pretty clean for modders to use as well.

[EGM]
IWAD=%s;
PWAD=DOOM, SIGIL;
//Optional below?
IWAD_PATH=%s;
EGM_MODULE=%s;

Ideally, we would need the system to load the proper namespaces externally in the root ./base folder as well (this is all working but it is very buggy as it was all hacked in over existing code, the dreaded DDF_DIR string), or we could just have EGM work that out for us. Might need to additionally take a look at WAD management handling in w_wad (which also desperately needs a total rewrite).

Comments and/or thoughts on plan of action or implementation concerns?

Corbachu commented 2 years ago

I decided to combine both efforts - initial startup values will be in the INI, but the EGM will tie the rest of this together. https://github.com/3dfxdev/EDGE/commit/e34f6684b512cca7a75a7a67ee2e57b4d238317e