svkaiser / Doom64EX

Doom64EX is a reverse-engineering project aimed to recreate Doom64 as close as possible with additional modding features.
http://doom64ex.wordpress.com/
GNU General Public License v2.0
239 stars 49 forks source link

Trying to launch doom64ex on Debian 8 - segmentation fault #29

Closed mdeguzis closed 7 years ago

mdeguzis commented 8 years ago

Data is in /usr/share/games/doom64ex after conversion.

error:

Z_Init: Init Zone Memory Allocator
CON_Init: Init Game Console
G_Init: Settting up game input and command
M_LoadDefaults: Loading game configuration
I_Init: Setting up machine state
D_Init: Init DOOM parameters
W_Init: Init WADfiles
Segmentation fault

Does this mean my ROM and/or ROM conversion to .wad was bad? The conversion method does not allow .bin ROMs either.

mdeguzis commented 8 years ago

nevermind, I'm dumb. forgot a file

pinkwah commented 8 years ago

Hey. Segfaults should preferably never happen. What file did you forget?

mdeguzis commented 8 years ago

Kex.wad. I need to include it in my Debian package I made. I'll probably choose something like /usr/share/games/doom64ex for a default path to install it and note it in output after package installation.

pinkwah commented 8 years ago

It should quit with a normal error when kex.wad isn't found, so there's definitely a bug somewhere.

kex.wad should be a part of the package, yes. It includes graphics that's not in the ROM (like a mouse cursor).

Here's the list of directories that D64EX looks in: https://github.com/svkaiser/Doom64EX/blob/master/src/engine/system/i_system.c#L479

It also checks ~/.local/share/doom64ex.

pinkwah commented 8 years ago

Reopening so I can remember to fix the segfault when I come home.

mdeguzis commented 8 years ago

Trying a new build now. Also, was thinking if there could be a CMakeLists definition for the install target, so it is not hardcoded to bin. I'm very excited to play this in any capacity. I build packages for SteamOS, so hopefully others will enjoy it too.

Maybe it goes something like:

# Directory where to install bin
if(${CMAKE_INSTALL_DIR MATCHES "games")
  set(INSTALL_DIR "games")
else()
  set(INSTALL_DIR "bin")
endif()

and

if (NOT WIN32)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/doom64ex DESTINATION $INSTALL_DIR)
endif ()
mdeguzis commented 8 years ago

It works fine. When you generate the doom files with the executable, they are not marked executable:

Sucessfully created /home/desktop/doom64.wad
Writing Soundfont File...

Sucessfully created /home/desktop/doomsnd.sf2
desktop@steamos:~$ ls -la /home/desktop/doom64.wad
-r-------- 1 desktop desktop 8641888 Jul 30 07:25 /home/desktop/doom64.wad

desktop@steamos:~$ ls -la /home/desktop/doomsnd.sf2
-r-------- 1 desktop desktop 5429302 Jul 30 07:25 /home/desktop/doomsnd.sf2

Once I did chmod 755 on those files, things worked fine. Id suggest changing the mode when running that wadgen tool

pinkwah commented 8 years ago

Ye, wadgen should set perms to 0644. (not 0755, since the files aren't supposed to be executed.)

I'm not sure what you mean about the install dir. The standard place for binaries is ${install_prefix}/bin/. Does SteamOS use a non-standard convention?

pinkwah commented 8 years ago

Oh, and I have to mention that it's not a good idea to include doom64.wad and doomsnd.sf2 into your package, since that would be a breach of copyright. I have no idea who currently owns the IP (probably ZeniMax), but it's best to avoid any C&D letters.

mdeguzis commented 8 years ago

I don't include those, no, just kex.wad. As far as bin, I. Believe games commonly install to /usr/games on Linux distributions. Maybe some FHS standard. I'd have to check.

pinkwah commented 8 years ago

Binaries (doom64ex) go in $prefix/bin/, data (kex.wad) goes in $prefix/share/.

If it's a system package, ie. your case, then the prefix is just /usr. Otherwise it's installed by the user through make install, then it goes into /usr/local.

You can also dump everything in /opt/doom64ex and symlink to the binary (/opt/doom64ex/doom64ex) to /usr/bin, but that's generally frowned upon. This is what somewhat lazily ported Windows programs do.

mdeguzis commented 8 years ago

It should be $prefix/games from all that I have learned in the past. That is why I referenced the FHS.

http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY
http://pingus.seul.org/~grumbel/tutorials/game_install/install_dirs-2.html

mdeguzis commented 8 years ago

But I think the more pressing issue is the 400 permission on the generated wad files. That was run on a .n64 ROM in my $HOME.

pinkwah commented 8 years ago

Yeah, you're right. Debian and friends put game binaries in /usr/games. Not entirely sure I understand what the point is, but it doesn't matter. I know that neither Fedora nor Arch put stuff there, and it seems to be an optional thing. It's not a problem to leave it as it is and just mv the binaries when creating a package for Debian.

Imho, the generated data should be 0644 (default when using fopen) and be placed in $XDG_DATA_DIR/doom64ex. Currently it places stuff in . because that's what the Windows version does.

I'm home now so I should have time to fix this sometime next week.

Here's a more up-to-date version of the spec, btw (2.3 was published in 2004): http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html

mdeguzis commented 8 years ago

The bin thing is fine however you want it. Ill just make a small patch for it to be in games. I thought I tried moving it but the program expected the bin location. I'll test that theory again later tonight.

pinkwah commented 8 years ago

I can't reproduce the missing kex.wad segfault. Instead, I get a

Error - W_Init: kex.wad not found

as expected.

mdeguzis commented 8 years ago

It was because I was missing the other wad files / and or they were only 400 create mode. I'll check again soon.