clockworkpi

Let's play Brutal Doom!

Ok so here we go:

3 Likes

Awesome job on this! Glad you finally got some closure on a good thing!

Another thing to include in the zdoom.ini file is

snd_mididevice=-2 if you also want to have music.
This activates Timidity++.

I’ve added a forced resolution into my *.sh launch script, forcing the 320x240 resolution. (I’m guessing the 324x240 resolution specified was an error?)
eg.

zdoom -width 320 -height 240 -iwad /home/cpi/games/ChocoDM/DOOM2BFG.WAD -file /home/cpi/games/ChocoDM/brutalv20b.pk3 

(I’ve installed the launch files to the /usr/games/zdoom directory, so I can just use the shorter alias to start it, but that’s just my own OCD preference)

Running the script without any parameters telling it where to find PAK files can allow you to choose which WAD file to use. You’ll need to specify the directory in the zdoom.ini file.
eg.

[IWADSearch.Directories]
Path=~/games/ChocoDM
[FileSearch.Directories]
Path=~/games/ChocoDM

I chose to have the WAD directory as ROM=/home/cpi/games/ChocoDM, since this is a path already installed on a stock 0.5 system, and is where the chocoDM built in wrapper expects WAD files to be. Just keeping things tidy.

Alternatively, if you’ve got a lot of .WAD/.pk3 files, you can make an action.config file to specify which WAD to use. Unfortunately I don’t know how to independently choose both -file and -iwad arguments, besides having discrete action.config files for each -file combination.

ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad, WAD, pk3, PK3
LAUNCHER=zdoom -width 320 -height 240 -iwad
TITLE=Zdoom
EXCLUDE=
SO_URL=

Keep in mind, this won’t load the Brutal Doom mod. If you want it to, you’ll need to provide -file /home/cpi/games/ChocoDM/brutalv20b.pk3 before -iwad in the launcher line. I didn’t include it, since other WADS such as Heretic, Hexen and Strife are incompatible with Brutal Doom.

Unfortunately, zdoom doesn’t save any mappings you make within the wrapper. You’ll need to specify your keys yourself in the zdoom.ini. Here’s the problem. Not all of the variables are there for you to map. Not very convenient. Worse still, the key binds that are there aren’t really in any particular order, so it will take forever to find what you need.
I’ve written out all of the key bind options, in the order that they appear in the Doom 2 key config menu in game. That way, you can map something that feels comfortable in game, test it out, and then copy down what you want in the zdoom.ini file. If you want to clear an entry within zdoom, push shift+menu (which is the back space key)
You’ll need to find the [ Doom.Bindings ] section in the zdoom.ini file, and delete everything up until the next heading, replacing it with this. You can also apply it to Hexen.Bindings, Heretic.Bindings, Strife.Bindings etc, since they all pretty much use the same format.

[Doom.Bindings]

=+attack
=+altattack
=+reload
=+zoom
=grenadetoss
=+user1
=+user2
=+user3
=+user4
=+use
=+forward
=+back
=+moveleft
=+moveright
=+left
=+right
=+jump
=+crouch
=crouch
=+moveup
=+movedown
=land
=+mlook
=+klook
=+lookup
=+lookdown
=centerview
=+speed
=toggle cl_run
=+strafe
=+showscores
=togglescoreboard

=messagemode
=messagemode2

=weapnext
=weapprev
=slot 1
=slot 2
=slot 3
=slot 4
=slot 5
=slot 6
=slot 7
=slot 8
=slot 9
=slot 0

=invuse
=invuseall
=invnext
=invprev
=invdrop
=invquery
=weapdrop

=togglemap
=chasecam
=spynet
=screenshot
=toggleconsole

=showpop 1
=showpop 2
=showpop 3

=menu_main
=menu_help
=menu_save
=menu_load
=menu_options
=menu_display
=menu_quit
=menu_endgame
=pause
=quicksave
=quickload
=sizedown
=sizeup
=bumpgamma
=togglemessages

Any entries you don’t put in an entry for will be erased, so don’t worry about deleting any unused lines, or commenting them out.

Here’s the keys/letters to put in, corresponding to each key. In particular, it refers to the up/down/left/right as arrows. Here’s how I’ve bound mine, simulating a WASD configuration.

uparrow=+forward
leftarrow=+moveleft
rightarrow=+moveright
downarrow=+back

Shift+Select (-) and Shift+Start (+) are referring to their Keypad variants, and are prefixed with “kp”.
I have them mapped to advancing menu items backwards and forwards like this. (mainly for Hexen)

kp-=invprev
kp+=invnext

(PgDown is referred to as pgdn)
11c1191c4e9394779edaaed3958128d256fbf98c_2_690x391
The light key bindings are all backwards, re: holding shift. This means that the shift+ABXY will all end up bring duplicates of the light key buttons. Be careful when considering mappings not to double up!

1 Like

Thanks for these infos!
In the zdoom.ini I provided the controls are already mapped.

1 Like

Aha! I didn’t check that! Just thought it had the resolution and efx fixes! All good!. :slight_smile:

Just providing it, in case people want to map their own. Eg, I personally prefer to not have the light key module installed, so have a VERY different mapping! Plus there are a lot more of the commonly used bindings that are automatically removed from the zdoom.ini file.

Who knows? Someone might really want the spy net feature.

Imagine. Being at a LAN party. Everyone has a gameshell, and spy net is allowed. Screen cheating, via a small handheld device. This legitimately sounds fun, and I am tempted to do this!

I have updated my zdoom.ini on dropbox with:
snd_mididevice=-2

1 Like

Potentially, you could probably do away with all of the FMOD references in the build process to save a bit of time and space, since we’re now using a working openal sound driver.

Basically, omit

 -f output_sdl/liboutput_sdl.so f='-UFMOD_LIBRARY -UFMOD_INCLUDE_DIR' && [ -d fmodapi44464linux ] && f="-DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex{a}-4.44.64.so 
-DFMOD_INCLUDE_DIR=fmodapi44464linux/api/inc”

and not bothering with doing

wget -nc http://zdoom.org/files/fmod/fmodapi44464linux.tar.gz
tar -xvzf fmodapi44464linux.tar.gz
cmake … -DNO_FMOD=ON

The fact that we’re doing cmake … -DNO_FMOD=ON, disabling FMOD anyway kinda makes it redundant going to all the trouble of installing it.

I think you might be doubling up on make, doing it both in the above step 4, and using the cmake … -DCMAKE_BUILD_TYPE=Release later on, in step 5.
Also, step 2 finishes with cd zdoom/build. Assuming we’re in the same session, you technically wouldn’t need to have another cd zdoom/build in step 4.

Speaking of the make process, the .sh script from the original post is referring to the file that’s still in the build directory. If you’ve installed it to the /usr/games/zdoom directory (along with zdoom.pk3), you can remove the entirety of the /home/cpi/zdoom directory, cleaning up your home directory and saving space. I’m just extremely pedantic about leaving installation files behind!

Looking at the zdoom wiki linux installation page, it looks like you’ve basically followed it all, but stopped at the installation stage.
https://zdoom.org/wiki/Compile_ZDoom_on_Linux

a='' && [ "$(uname -m)" = x86_64 ] && a=64 h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' ../src/gitinfo.h)" d='' && [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ] && d=-alpha o=output_sdl/liboutput_sdl.so && l='' && [ -f "$o" ] && l="$o \ fmodapi44464linux/api/lib/libfmodex${a}-4.44.64.so" chrpath -r '$ORIGIN' zdoom sudo cp -v zdoom zdoom.pk3 $l \ /usr/games/zdoom$d/

The problem here is, chrpath -r '$ORIGIN' zdoom doesn’t appear to work. (changing the root path)
You can work around it, using patchelf instead.

sudo apt-get install patchelf

Then instead of chrpath -r '$ORIGIN' zdoom, run:

patchelf --set-rpath '$ORIGIN' zdoom

It doesn’t appear to install a non alpha/developmental copy of the files, by simply copy pasting what’s on the wiki page. Run this to fix this:

a='' && [ "$(uname -m)" = x86_64 ] && a=64
h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' ../src/gitinfo.h)"
d='' && [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ] && d=-alpha
o=output_sdl/liboutput_sdl.so && l='' && [ -f "$o" ] && l="$o \
fmodapi44464linux/api/lib/libfmodex${a}-4.44.64.so"
patchelf --set-rpath '$ORIGIN' zdoom
sudo cp -v zdoom zdoom.pk3 $l \
/usr/games/zdoom/

And then create a different launch script, running:

h="$(sed -n 's/.*#define GIT_HASH "\(.*\)".*/\1/p' ../src/gitinfo.h)"
d='' && [ -z "$(git describe --exact-match --tags $h 2>/dev/null)" ] && d=-alpha
printf %s "\
#!/bin/sh
exec /usr/games/zdoom/zdoom \"\$@\"
" > zdoom.sh
chmod 755 zdoom.sh
sudo mv -v zdoom.sh /usr/bin/zdoom

After doing all this, you shouldn’t need the contents of /usr/games/zdoom ever again, so remove it.

sudo rm -r /home/cpi/zdoom/

And one final small fix to the tutorial: Steps 7 and 8 refer to the files Doom2.wad and doom2.wad. They should both be the same file name, including capitalisation, so either change the Doom2.wad to doom2.wad, or change the path in your SH file.

1 Like

lol I will read all of this and try to learn from it for sure.
Thanks

1 Like
I've cleaned up your installation

A lot of the steps you included, copied from the wiki include a lot of a=, h=, d= etc statements. This is great for having it installed on various configurations and systems. But since we all have basically the same configurations and even usernames (cpi), we can possibly clean it up and make it more elegant, putting in the exact input required.
It’s basically like doing algebra, re how to work out where each defined variable goes. It will clean up the installation A LOT. Hell. We could even write an automated script to install it all.

Eg.
Reviewing step 5.


a=’’ && [ “(uname -m)" = x86_64 ] && a=64 c="(lscpu -p | grep -v ‘#’ | sort -u -t , -k 2,4 | wc -l)” ; [ “c" -eq 0 ] && c=1 rm -f output_sdl/liboutput_sdl.so f='-UFMOD_LIBRARY -UFMOD_INCLUDE_DIR' && [ -d fmodapi44464linux ] && f="-DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex{a}-4.44.64.so

-DFMOD_INCLUDE_DIR=fmodapi44464linux/api/inc”

cmake … -DCMAKE_BUILD_TYPE=Release $f &&

make -j$c

The first line includes definitions. If we know what we want to type, we can just remove them.

The second line we can just ignore, since we’re probably not going to need to install anything to do with fmod.

In the third line, the $f is referring to f="-DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex{a}-4.44.64.so

Again, we’re not working with fmod, so we can remove it. cmake … -DCMAKE_BUILD_TYPE=Release

In the fourth line, the -j$c is referring to c="(lscpu -p | grep -v ‘#’ | sort -u -t , -k 2,4 | wc -l)” ; [ “c" -eq 0 ] && c=1 , ie an identifier for how many cores we have.

Just change the $c to 4, because we know that we have 4 cores. make-j4

So after all of that, we can simplify the entirety of step 5 to:

cmake .. -DCMAKE_BUILD_TYPE=Release && make-j4

(note: I have also fixed up a typo, where you have used three dots (…) instead of two (…)

Of course, we still need to edit the oalsound.cpp before doing make, but that’s easily achievable with this:

sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp

This is basically step 3, done a bit more eloquently.

Putting it all together, I would say that we can probably skip the entirety of step 4. This simplifies the entire process down to:

sudo apt-get -y install g++ make cmake libsdl2-dev git zlib1g-dev libbz2-dev libjpeg-dev libfluidsynth-dev libgme-dev libopenal-dev libmpg123-dev libsndfile1-dev libwildmidi-dev libgtk-3-dev timidity nasm tar chrpath patchelf

git clone git://github.com/rheit/zdoom.git

sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp

mkdir -pv zdoom/build

cd zdoom/build

cmake .. -DCMAKE_BUILD_TYPE=Release  

make -j4

(I added the -y argument, so you don’t need to push y to confirm installing each package. I also added patchelf to the install list, since we’ll need it for a step later re: installing)

Here’s the step to install the files we just made with cmake. I guess this is kinda optional, but isn’t? Not doing it is the equivalent of installing a game on your computer in your desktop folder. I prefer to install things in a more conventional installation path.

sudo mkdir -pv /usr/games/zdoom

patchelf --set-rpath '$ORIGIN' zdoom

sudo cp -v zdoom zdoom.pk3 \
/usr/games/zdoom/

printf %s "\
#!/bin/sh
exec /usr/games/zdoom/zdoom \"\$@\"
" > zdoom.sh

chmod 755 zdoom.sh

sudo mv -v zdoom.sh /usr/bin/zdoom

Then finally, we can delete all of the files we just used to make the files. Consider this like doing your dishes after making dinner. You don’t have to do it, but someone’s going to get antsy if you don’t. :wink:

sudo rm -r /home/cpi/zdoom/

Test if it works with export DISPLAY=:0 zdoom -width 320 -height 240

As for running it on the gameshell, make an action.config file wherever you want, containing this. (assuming you’ve got a whole bunch of WAD files saved to the /home/cpi/games/ChocoDM directory)

ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad, WAD, pk3, PK3
LAUNCHER=zdoom -width 320 -height 240 -iwad
TITLE=Zdoom
EXCLUDE=
SO_URL=

All of that should be able to be added to a single script in order to streamline the process. I’m a bit lazy when it comes to making verbose visual output, so just make sure you kinda know what you’re doing if you do decide to do this. Otherwise there will be a hell of a lot of troubleshooting!

Here is a much simpler and cleaner way to install zdoom.
SSH into your gameshell, and run this.

wget -O /home/cpi/zdoom.sh https://www.dropbox.com/s/j2fu7twdrw7ec72/zdoom.sh?dl=1
chmod +x /home/cpi/zdoom.sh
./zdoom.sh

In case the dropbox links ever go down, and the script breaks, I have provided the essential files below:

Here are the contents of the script
#!/bin/sh
# WRITEN BY JAVELINFACE FOR THE GAMESHELL FEB 5 2020
echo "----------INSTALL PACKAGES----------"
sudo apt-get -y install g++ make cmake libsdl2-dev git zlib1g-dev libbz2-dev libjpeg-dev libfluidsynth-dev libgme-dev libopenal-dev libmpg123-dev libsndfile1-dev libwildmidi-dev libgtk-3-dev timidity nasm tar chrpath patchelf

echo "----------CLONE ZDOOM FILES----------"
git clone git://github.com/rheit/zdoom.git

echo "----------FIX ERRONEOUS FILES----------"
sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp

echo "----------MAKE ZDOOM----------"
mkdir -pv zdoom/build
cd zdoom/build
cmake .. -DCMAKE_BUILD_TYPE=Release  
make -j4

echo "----------INSTALL ZDOOM----------"
sudo mkdir -pv /usr/games/zdoom
patchelf --set-rpath '$ORIGIN' zdoom
sudo cp -v zdoom zdoom.pk3 \
/usr/games/zdoom/
printf %s "\
#!/bin/sh
exec /usr/games/zdoom/zdoom \"\$@\"
" > zdoom.sh
chmod 755 zdoom.sh
sudo mv -v zdoom.sh /usr/bin/zdoom

echo "----------ADD LAUNCHER MENU ITEMS----------"
mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad,WAD,pk3,PK3
LAUNCHER=zdoom -width 320 -height 240 -iwad
TITLE=Zdoom
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom/action.config

mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/06_brutal
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad,WAD,pk3,PK3
LAUNCHER=zdoom -width 320 -height 240 -file /home/cpi/games/ChocoDM/brutalv20p.pk3 -iwad
TITLE=Brutal Doom
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/06_brutal/action.config

echo "----------GIVE IT AN ICON----------"
wget -O /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom/zdoom.png https://www.dropbox.com/s/z4eezhuzhbdxi8t/zdoom.png?dl=1 

wget -O /home/cpi/apps/Menu/20_Retro\ Games/06_zdoom/brutal.png https://www.dropbox.com/s/hc6ye5w9yqjazjd/brutal.png?dl=1

echo "----------MODIFY INI FILE----------"
mkdir -pv /home/cpi/.config/zdoom
wget -O /home/cpi/.config/zdoom/zdoom.ini https://www.dropbox.com/s/9reeu639xn403l7/zdoom.ini?dl=1

echo "----------DOWNLOAD BRUTAL DOOM----------"
wget -O /home/cpi/games/ChocoDM/brutalv20b.pk3 https://www.dropbox.com/s/hc0sz5j2vun2t8d/brutalv20b.pk3?dl=1

echo "----------CLEANUP----------"
sudo rm -r /home/cpi/zdoom/
rm /home/cpi/zdoom.sh

Here are the contents of zdoom.ini

zdoom

1 Like

Great! Now it’s all clear and works like a charm.

Thanks!!

1 Like

Excellent. There were a lot of typos, and redundant errors in the original instructions. Plus, it’s way easier to just script the edits to be done to the erroneous file, as opposed to opening a separate text editor. I think that may have been part of the problem, ie @Lix 's text editor making auto corrections. He types with ellipsis’s quite a lot… like this… So I think his computer tried to auto correct it…
I’ve updated the script to also include downloading and installing brutal doom. Depending on when you ran the script, it might not be there. Also, I’ve made a separate script, if you’re using my custom DEOT OS image. It just respects the directory heiracy, and uses a matching icon.

2 Likes

Thanks!
For the Typo I don’t know I typed everything in the reply box directly.
For the rest, I am far from being able to simplify a compile script yet. I am a big NOOB in all of this.
I try things, sometimes it work, sometimes its a mess…
But with all of you guys to clean up things we are in business!

So is there a simple way for me to take your post a put it at the top of this page?
I would like people to see the correct way first.

Hey, haha I’m a huge noob as well. I’m a musician by trade, so don’t deal with this on a day to day basis like a lot of the other people here! I’m just extremely pedantic about tiny details, and basically treat code like writing music. It’s the same haha. I’m guessing it’s the same with you too and your graphic design work.

If you just copy the link, and add it to the the first post, that could work!
this one

Then you can comment out your original post. That said, for educational purposes even keeping mistakes is a great way for people to learn the thought process of how to work things out. It’s always tricky seeing solutions to your problems, asked and solved by people leagues ahead of you in skills and knowledge.

@javelinface sorry to disturb but I tried using your ssh script, worked like a charm zdoom is way better but I had 2 problems…

  1. ZDoom won’t launch Brutal doom and dont know of a way to do it. Tried changing the global autoload on zdoom.ini but it didnt work. (Just found out Brutalv20.pk3 only appears as an option in ZDoom when using LauncherGo, but still can’t use it since I can’t then select which wad to use)
  2. The really bad one… my “retro games” icon dissapeared. Storage is still being used. But I can’t access my emularors or games. :(( could you please help me? After using the script in ssh; the category dissapeared from the home menu on mine. (Also found out “Retro games” appears on my home screen when using LauncherGo but the performance is really worst compairing it to the standard Python Launcher…) I’m already feeling hopeless here. :frowning:

Hello! Welcome to the forums! :slight_smile:

Aha!! Yup! This is a bug in the launcher that needs to be addressed.
For now, move the zdoom into any where. Eg.

mv /home/cpi/apps/Menu/05_zdoom/ /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom/

To get rid of the bug re retro games going missing,

rm /home/cpi/launcher/Menu/GameShell/20_Retro\ Games/

It’s a completely empty directory that shouldn’t be there, and causes problems. This bug will cause problems trying to have any folder take up a spot before retro games.

As for making the brutal doom pk3 load, you can define the variable in the action.config. I didn’t do this, since it’s a manual thing to enable, if you’re using a doom/doom2 WAD. I’ll make a separate action.config to match:

mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/06_brutal
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad, WAD, pk3, PK3
LAUNCHER=zdoom -width 320 -height 240 -file /home/cpi/games/ChocoDM/brutalv20p.pk3 -iwad
TITLE=Brutal Doom
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/06_brutal/action.config

I’ll edit the script to make these changes by default! Thanks for pointing these out! :slight_smile:

Thank you for the welcome! And Already did and it worked! Thank you so much, my iconsappeared again, looks like it was indeed that bug that made my retro games dissapear.
And for the ZDOOM is there a way to make the PK3 appear in my ZDOOM app?
I’ve been trying to make it open other gameplay mods for Doom/Doom 2 wads like Doom 4 Vanilla v2.5.6, or Doom Exp v2.1 would like to know if there’s a way to choose them in a list instead of having to modify some auto-load configs everytime I wanted to try another mod. Sorry If I mess up with the basics, just got mine literally yesterday haha, I’m in love with it so far!
Thanks again!

There certainly is! Although, due to the constraints of how the action.config works, you can either choose a WAD or a PK3; not independently. You can edit the config of zdoom.ini to explicitly say which one you want, however since I don’t know what people have, want or have things named as, i couldn’t take liberties of pre configuring it. Here it is for now. I didn’t provide it in the script, since this thread is for brutal doom specifically, depending on the pk3 that’s provided.

mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/07_zdmods
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=pk3, PK3
LAUNCHER=zdoom -width 320 -height 240 -file
TITLE=ZDoom Mods
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/07_zdmods/action.config

Also congrats on diving in to some juicy stuff so early, since getting it! Believe me! You’ll have some sleepless nights, staying up waiting for things to compile, and trying new things; And of course having to restart A LOT!

Consider installing this as well: This allows you to push select twice to enable a virtual mouse mode. I have configured my game to use two key sets: One for standard keyboard, and one for the mouse. I have the A button (SNES) set to run forwards, and B button (SNES) to fire, leaving the DPAD for looking around. Good for tight spots. As you might have figured, the control config I’ve provided is catered to people who don’t use the light bar. I can make a different one, that more closely resembles a modern console style FPS if you’d like. @lix has also provided his own config that you can try out.

Damn, hahaha you read my mind! Actually I just found my easy way to modify my zdoom.ini, just tried Brutal doom and 4 Vanilla and it worked flawlessly.

And as I said before I do use the light bar (I’m trying to get used to it, I really don’t like the cables hanging out freely) I’m looking to make a proper fps feeling, that mouse mod really looks promising, I’ll try it and see how it improves the gameplay !

1 Like

@Officerpug
I already did all the steps before, just FYI
How’d did you make this work?
And where did you find the zdoom.ini?

Thank you

@HalfBlood zdoom.ini can be found in the directory /home/cpi/.config/zdoom,
You could just edit it’s global.autoload feature for Brutal Doom or D4V in it, or actually any mod combination you’d want to try out.
Under Global.autoload the correct path to look after the mod itself would go on like this:
Path=/home/cpi/games/ChocoDM/brutalv20b.pk3

No problem man, hope it helps!

1 Like

Appreciate your response @Officerpug , but after installing @javelinface cleaner way for zdoom the .config folder is nowhere to be found. But the zdoom and brutal doom apps work fine though