BodbDearg / phoenix_doom

A backport of 3DO Doom to PC
MIT License
65 stars 11 forks source link

Working only with original REZFILE? #2

Closed Versusvs closed 4 years ago

Versusvs commented 4 years ago

Awesome work! I had a lot of fun with it. But I'm making my own version of 3DO Doom and have a modified REZFILE already. I'm trying to use modified REZFILE, which is working without any errors on a real 3DO and in any 3DO emulator. But your app crashes on startup with this message: "Failed to load a CEL format image used by the...". Does your app uses only hardcoded original REZFILE?

BodbDearg commented 4 years ago

Thanks @Versusvs! There's nothing in the code that requires a specific REZFILE, it's reading the data and resource file contents as-is. The resources need to be in the same order however as the original resources file since the game uses simple integer (array) indexes to access resources rather than names - that part is hardcoded for sure and was in the original code release too.

From the look of your error message it seems like the game might be having trouble loading the specific CEL image format that you are using. While I made every effort to support as much CEL modes as I could, it's entirely possible there may be specific formats that the game doesn't handle or support properly. I just did what I needed to make everything in the original game work basically, since documentation/examples for this image format are thin on the ground.

I would need to see your data to confirm but I suspect that might be the issue.

Versusvs commented 4 years ago

"that part is hardcoded for sure and was in the original code release too"

I think that's the reason. I added some resources to rezfile and app expects to see something else than it currently avalable at that index. It's not about cel format, I think... May be there's multiframed sprite at that index or wad lump or something... You can look at my doomrez.h file. https://github.com/Versusvs/3DO-Doom-WIP. I'll be happy if your app will support modified REZFILEs.

BodbDearg commented 4 years ago

I did a diff of your rezfile with the original 3DO one, it looks like quite a few new resources were added. This would cause some of the slots/indices that resources are stored in to shift within the REZFILE. This in turn would break the .exe I compiled (and the original 3DO binary) if you used this REZFILE since resources would now be in unexpected locations within the global resources list.

The only fix for this situation (unfortunately) is to modify PhoenixDoom's own DoomRez.h: https://github.com/BodbDearg/phoenix_doom/blob/master/source/Game/DoomRez.h to include your new resource ids, and recompile. The REZFILE is a very primitive file format and contains no information identifying the lumps in the file (unlike a .WAD) other than their position in the resource list, so if the order is upset in some way then everything breaks...

I can't fix this issue without breaking compatibility with the normal game or coming up with an entirely new modding mechanism that sidesteps the REZFILE, which I'm not prepared to do at this time: see https://github.com/BodbDearg/phoenix_doom/blob/master/docs/Q%26A.md