Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Hexen II - uHexen II: Hammer of Thyrion source port on RetroPie/Raspbian (Ready for download)



  • Hexen II - uHexen II: Hammer of Thyrion source port

    It is now possible to play Hexen II on RetroPie and Raspbian thanks to uHexen II: Hammer of Thyrion source port.

    This script provides an automatic installation for compiling and building Hexen 2 on Raspberry Pi and RetroPie.

    0_1540203084427_2018-10-21-204323_960x540_scrot.png

    Raspberry Pi 4B and Raspbian Buster: The port has not been tested with the latest RPI 4 and Raspbian Buster release. It is only guaranteed to work on the latest official release of RetroPie as the one that can be found on the RetroPie download page. Therefore users who has this might not be able to install the port and play the game. Users may need to wait for official release and support for Raspberry Pi 4B and Buster.

    Download/clone new hexen2 scriptmodule into RetroPie-Setup:

    wget https://raw.githubusercontent.com/tpo1990/Hexen2-RPI/master/hexen2.sh -P $HOME/RetroPie-Setup/scriptmodules/ports/
    

    After downloading scriptmodule, go to the experimental section in RetroPie Setup to install.

    Install time: 15 minutes.

    Build process:
    1: Download and install necessary required libs for SDL, Timidity and etc.
    2: Create folders Games and Hexen II with full path /home/pi/Games/Hexen II.
    3: Download uHexenII source files and 1997 Nov. demo of Hexen II.
    4: Compile uHexenII.
    5: Move pak0.pak file from 1997 Nov. demo of Hexen II into /home/pi/.HexenII.
    6: Create .desktop as a shortcut on Raspbian desktop and create Hexen II.sh file into Ports folder in RetroPie.

    Registered/Full version:
    If you own an original copy of Hexen 2, then it is possible to use it with Hammer of Thyrion source port. You will just need to copy pak0.pak and pak1.pak into /home/pi/.hexen2/data1 folder.

    Missionpack - Portal of Praevus
    First Copy the "portals" folder to /home/pi/RetroPie/roms/ports/hexen2/
    Copy Hexen II.sh and rename it to Hexen II Mission Pack: Portal of Praevus.sh.
    Edit Hexen II Mission Pack: Portal of Praevus.sh file with this line:

    "/opt/retropie/supplementary/runcommand/runcommand.sh" 0 "/opt/retropie/ports/hexen2/hexen2 -portals"
    

    Note: (The pak files may need to be patched with official 1.11 patch to be able to run).
    To do so: Install Hexen 2 on Windows -> Download official Hexen 2 1.11 patch -> Run official Hexen 2 1.11 patch -> Copy the pak files to your /home/pi/.hexen2/data1 folder.

    Music in game:
    To get music to play, you must go into Hexen 2 options and change music type to Midi only.

    Future plan:
    Make script available into RetroPie-script as a package (Need help for this)
    Create a script for HexenWorld and maybe make script available into RetroPie-script as a package.
    Adjustments in scripts.

    Notes:
    Hexen II runs at full speed with SDL and Timidity support as compared to the Quake 1 port Tyrquake. It runs both in X11 window and in RetroPie/ES. It is also possible to use your original Hexen II install disc by using the .Pak files. Multiplayer has not been tested yet although it looks as it will work. HexenWorld the online multiplayer client/server is also available to compile/build. I need to see how further the development and build goes.

    Disclaimer:
    This installation script is provided as is. Im not responsible for anything happening with your Raspberry Pi including corruption of SD card, Hardware damage. For support and help you can contact me here on RetroPie forums.

    Contributors:
    sonicsheppard
    QuakeGuy

    Notice. Im open for suggestions. :-)

    Screenshots:
    0_1540203363331_2018-10-21-203504_960x540_scrot.png

    0_1540203413401_2018-10-21-203626_960x540_scrot.png

    0_1540203438905_2018-10-21-204305_960x540_scrot.png

    0_1540203462566_2018-10-21-204428_960x540_scrot.png

    0_1540203473924_2018-10-21-204535_960x540_scrot.png



  • Manual Installation/Compilation in Raspbian desktop or by ssh connection

    Install SDL 1.2 and Timidity dependencies

    cd ~
    sudo apt-get update
    sudo apt-get install libsdl1.2debian libsdl-image1.2 libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-net1.2 libsdl-net1.2-dev timidity.
    

    Create Hexen2 install folder, download Hammer of Thyrion source and extract tar file into install folder.

    cd ~
    mkdir Hexen2
    cd Hexen2
    sudo wget https://vorboss.dl.sourceforge.net/project/uhexen2/Hammer%20of%20Thyrion/1.5.9/Source/hexen2source-1.5.9.tgz
    tar -xvf hexen2source-1.5.9.tgz
    

    Download Hexen2 Demo Nov. 1997, extract tar, create /home/pi/.hexen2 folder. go to install folder and run build_all.sh file to compile/make.

    cd ~
    cd Hexen2
    sudo wget https://netix.dl.sourceforge.net/project/uhexen2/Hexen2Demo-Nov.1997/hexen2demo_nov1997-linux-i586.tgz
    tar -xvf hexen2demo_nov1997-linux-i586.tgz
    sudo mkdir /home/pi/.hexen2
    cd /home/pi/Hexen2/hexen2source-1.5.9/engine/hexen2
    ./build_all.sh
    

    Move data1 folder with .pak files from demo into /home/pi/.hexen2 folder

    sudo mv /home/pi/Hexen2/hexen2demo_nov1997/* /home/pi/.hexen2/
    

    Create Hexen2 sh launch file in /home/pi/RetroPie/roms/ports and make executable.

    echo "#!/bin/bash
    cd /home/pi/Hexen2/hexen2source-1.5.9/engine/hexen2
    ./hexen2" > /home/pi/RetroPie/roms/ports/Hexen2.sh
    sudo chmod 755 /home/pi/RetroPie/roms/ports/Hexen2.sh
    

    Optional: Add Hexen2 shortcut on Raspbian Desktop and make executable.

    echo "[Desktop Entry]
    Version=1.0
    Encoding=UTF-8
    Name=Hexen II
    GenericName=uHexen2
    Comment=Hexen II: Hammer of Thyrion a Hexen II source port
    Exec=bash -c '/home/pi/Hexen2/hexen2source-1.5.9/engine/hexen2/hexen2 -f;$SHELL'
    Icon=/home/pi/Hexen2/hexen2source-1.5.9/engine/resource/hexen2.png
    Terminal=true
    Type=Application
    Categories=Game
    GenericName[en_US]=uHexen2
    " > /home/pi/Desktop/HexenII.desktop
    
    sudo chmod 755 /home/pi/Desktop/HexenII.desktop
    


  • Changelog
    05-03-2020: Added Raspberry Pi 4B and Raspbian Buster section.
    27-05-2019: Changed path in wget command to variable: -P $HOME/RetroPie-Setup/scriptmodules/ports/
    04-02-2019: Created Hexen2 scriptmodule and made a pull request to Master branch of RetroPie project. Added tpo1990/RetroPie-Setup github link for download/clone.
    11-11-2018: Updated Hexen2 install script to version 1.1 and added 2 install scripts. One for Desktop and one for RetroPie. Changed information in RetroPie topic and Readme in Github.
    06-11-2018: Created manual installation/compilation section in RetroPie forum topic. Added disclaimer.
    04-11-2018 : Created Github repository and released Hexen2 install script 1.0. Download link available.



  • Hi @tpo1990 ,

    I've just given this a go and it seems to work very well. Thanks very much!

    I did just have a question regarding the patching to 1.11. I have the original copy of the game .pak files (1, 2 and 4) as well as the add-on pak.3 which I have added into /home/pi/.hexen2/data1 as per the instructions on the HexenII -uHexenII sourceport site, however after doing so the game no longer launches and it says it needs to be patched to 1.11 using the h2patch which comes with the port.

    I don't know how to use this - I believe it's referring to this - /home/pi/RetroPie/roms/ports/HexenII/hexen2source-1.5.9/h2patch

    (Note that I have moved the files from Games to the ports folder).

    Any instructions on how to patch this to 1.11 so that it can work with the official .pak files (including the add-ons) would be very much appreciated.

    Thanks so much.



  • Hi @sonicsheppard

    Thank you for the feedback. Now i know it works for other people :-)

    Yes. According to the Hammer of Thyrion source port, it requires .pak0 and .pak1 from the full Hexen 2 original copy. Demo/Shareware only requires .pak0.

    This is the same approach as most Quake 1 ports, since Hexen 2 is using Quake 1 engine.

    I believe i also have an original copy somewhere but i will need the time to test and see if i run into the same problem as you do. It seems that it is only possible to patch the game .pak files on a Windows PC with the h2patch program.

    The reason why i choose the install path /home/pi/Games/hexenII was that i experienced the install folder of the port to be shown into RetroPie Emulationstation. But you can move the install folder to any desired location in Raspbian. Just notice that the .desktop shortcut file and also the .sh file must be edited to refer to this new location in Raspbian, in order for it to be able to launch Hexen 2. I might change this some time if any better suggestion shows up.

    After the script was finished with running on your RPI, did you try to run the game by the desktop shortcut in Raspbian from its default installation /home/pi/Games/hexenII?



  • Hi @tpo1990

    Yeah I was able to get all of the .pak files from my copies of the game; just like Doom and Quake as you say.

    I didn't realise you could only patch it on Windows using the h2patch program, does that require the game to actually be installed? I've not had the chance to try the h2patch program yet, so any info/steps on that would be appreciated if you've been able to use it?

    Since I just have a pre RetroPie setup on my Raspberry Pi, with no Desktop, I actually edited your install .sh to remove the section on setting up the desktop shortcut, so unfortunately I can't really comment on whether that bit worked.

    All I can say is that manually moving it to the roms/ports/ folder and editing the Hexen2.sh launch script in ports worked absolutely fine - with the shareware .pak anyway. My only stumbling block now is the patching as described above.

    Everything else works fine though from my brief checks :).

    Ta!



  • @sonicsheppard

    I could be wrong but i dont think it would require you to install your original copy of Hexen 2 on a Windows PC as long as it is only the .pak file that need to be patched with the h2patch program. It might just work with copying over the .pak files from your original copy. I will try to do this when the weekend shows up. :-)

    Good idea. That could be useful for also making it an option on only installing it for RetroPie without Desktop. I will continue working on an alternative install script for RetroPie without desktop and i will look into patching the pak files of the original Hexen2 with the h2patch program.

    I can always use positive input and suggestions on how to improve the script.

    Thank you.



  • @tpo1990

    Few updates from this over the past few days.

    I was actually able to install Hexen 2 and Portal of Praevus on my Win10 PC (shock); and in doing so was able to patch up the .pak files to 1.11 the "official" way.

    Copied pak0.pak, pak1.pak, pak3.pak and pak4.pak into "/home/pi/.hexen2/data1" and pak3.pak into "/home/pi/.hexen2/portals" has worked fine. Game booted fine with these patched paks now.

    I'm not 100% if pak3.pak (the Portal of Praevus addon) needed to go into data1 or portals folder, I've seen conflicting information so figured I just stick it in both for now.

    To confirm I did move the install from the Games folder in your original .sh script into "/home/pi/RetroPie/roms/ports/HexenII/hexen2source-1.5.9/" ; and edited the HexenII.sh in /home/pi/RetroPie/roms/ports/ to the following:

    #!/bin/bash
    cd /home/pi/RetroPie/roms/ports/HexenII/hexen2source-1.5.9/engine/hexen2/
    ./hexen2
    

    I was able to get Portal of Praevus working by creating a new HexenII - Portal of Praevus.sh and adding the -portals flag:

    #!/bin/bash
    cd /home/pi/RetroPie/roms/ports/HexenII/hexen2source-1.5.9/engine/hexen2/
    ./hexen2 -portals
    

    I've gotten the .mp3 music files and added them into "/home/pi/.hexen2/data1/music" and "/home/pi/.hexen2/portals/music" ; I've not tried this yet but the HexenII Source Port website states to change the music to ALL CODECS in the Settings menu. (Note: ripped music from my install CDs and converted .wav to .mp3).

    Final bit of info, my Nintendo Wii U Pro controller works great after enabling JOYSTICK 1 from the console!

    Thanks.



  • @sonicsheppard

    Wow. I must say you have made a bit of a progress. So actually by installing Hexen 2 and Portal of Praevus on Win10, patching official way did the trick. I still think it could have been done easier with the h2patch program. That is to be tested.

    By moving the install folder from Games folder into ports folder, did you happen to experience in Emulation station that you can see both the HexenII.sh file and the install folder? or only the HexenII.sh file?

    About the music part. It appears that the Hexen 2 source port does support music from the original copy of Hexen 2, but it it might need another dependency package installed in order to be able to play the music. It could be some codec. That is also to be tested.

    Did you need to change the joystick configuration in order for the buttons to match to your Nintendo Wii U Pro controller or was it enough to just enable JOYSTICK 1 from the console?

    Thank you for your assist. :-)



  • @tpo1990

    No problem, happy to help testing these FPS ports!

    You're probably right about the h2patch program, but I thought I'd try installing the games anyway as I wanted to rip the music from the CDs - two birds with one stone kind of thing.

    Yes the folder does appear under Ports along with the HexenII.sh after moving it. I have parse gamelists enabled in ES though so only the stuff I have scraped appears in the list, so it's not a problem for me. Could be for others though if they don't use that.

    I did have to configure my joystick buttons after entering JOYSTICK 1 in the console, but it was all done in-game using the Settings menu, and it was saved automatically. Pretty straight forward thankfully!

    Interesting about the music. I've only just copied the folders/files to my Pi, not actually had a chance to test it out yet. If it does need an extra dependency, I'm happy to test that out if you can point me in the direction of where to get it.

    Ta!



  • @sonicsheppard

    Once the weekend comes in i will do some more testing.

    That explains it. Before i released the script to RetroPie forum i was trying with several install locations in Raspbian and making the install script extract the files and install in /home/pi/RetroPie/roms/ports folder made me experience, that the install folder was showing up in Emulation station. I might try the Parse gamelist option. I dont know all RetroPie setup options yet. :-)

    I wonder if it could be possible to somehow make it as a libretrocore that would use a virtual gamepad for ease of use with an USB controller/gamepad, otherwise it sounds as it is pretty straight forward in configure USB controller/gamepad with the JOYSTICK 1 option.

    I think i saw somewhere on Hexen 2 source port that it would need some more dependencies for using music from the original copy of Hexen 2. I will help out as best as i can, as my goal is to make more game ports available to the RetroPie community. ;-)



  • Hi. I have a problem:

    root@retropie:~/Hexen2# sudo mkdir /home/pi/.hexen2
    mkdir: cannot create directory ‘/home/pi/.hexen2’: File exists
    root@retropie:~/Hexen2# cd /home/pi/Hexen2/hexen2source-1.5.9/engine/hexen2
    bash: cd: /home/pi/Hexen2/hexen2source-1.5.9/engine/hexen2: No such file or directory

    :>

    I'm doing it in terminal in Raspbian, step by step.

    Edit: Ok, nevermind, it's working. I had to make that directory.



  • @Krisu When i first created the script i had some problems with getting the invisible .hexen2 folder created as the Pi user. The folder got created as the root user, which made the executable Hexen2 file not be able to locate the Hexen 2 game paks (.pak files) as it were looking into the wrong directory. This should have been solved on the first release of the install script.

    Glad to know that you got it working. :-)

    Im working on improving the install script and making it easier to use. Also new ways of installing Hexen 2 will be featured as well.



  • Later I try to make full version and a addon get to work. What about Heretic 2 or Sin ? :>



  • @Krisu Yes you can always remove the demo pak files of Hexen 2 in the .hexen2 folder and use the full registered version from original Hexen 2 CD. Just keep in mind, that you might have to patch the pak files to v. 1.11 before copying them over into that same folder for it to work. If you dont use patched pak files (1.11) Hammer of Thyrion will not be able to run Hexen 2 and it will show an error message, that you need to use pak files of version 1.11.

    My primary goal is to make as many good old PC games available on the Raspberry Pi so that the Ports section can be expanded further, but that can only happen if a source port exists of the games and that the source port is supported to be build on Arm architecture, just like the Hammer of Thyrion which is a source port for Hexen 2. I have already planned more games that might work but that will come later and the games will be created in another thread for their own part.

    I have already tried to see if there is a source port for Heretic 2. Unfortunately i could not find any source port that can be used for our Raspberry Pi. Others might have better luck. I havent checked if there is a source port for Sin. :-)



  • @tpo1990 said in Hexen II - uHexen II: Hammer of Thyrion source port on RetroPie/Raspbian (Ready for download):

    My primary goal is to make as many good old PC games available on the Raspberry Pi

    I wish you luck and thanks for your work.

    Ok, I finished Q2 (again), so it's time for love-hate labyrinths and searching for switches in Hexen, but I can't get this to work.

    ======== Hexen II Initialized =========

    execing hexen.rc
    execing default.cfg
    execing config.cfg
    execing autoexec.cfg
    Host_Error: Host_LoadStrings: couldn't load strings.txt
    Shutting down Timidity.
    Shutting down SDL sound

    My pak files have correct md5 checksum, and they are updated to 1.11. I have searching for solution, but didn't find any. Can you? <:

    I have changed permissions to whole .hexen2 directory, but it didn't help.



  • @Krisu Thank you very much. I have noticed in RetroPie forum that others are trying to making more source ports available too. :-)

    The error: Host_Error: Host_LoadStrings: couldn't load strings.txt. This means that Hammer of Thyrion source port executable can not find the file strings.txt in .hexen2 folder that it need.

    You need to copy the strings.txt file from either the original Hexen 2 or the shareware Hexen 2 installation or from the original CD of Hexen 2. Hammer of Thyrion source port will not be able to load Hexen 2 correctly if the file is not found.

    You actually gave me an idea to prevent those errors. I will make an faq about which errors to look out for and how to fix them. I will do this in the upcoming weekend.



  • @tpo1990

    Omg, I've checked the directory of full version of H2, and there is a file named stings.txt . Didn't noticed it before - I've copied the pak files few times, I was thinking that is something wrong with the pak files (couse demo version launched without that error).

    Again thank for your help :)



  • @Krisu Yeah i know, as that with my first tries i also experienced the same error when trying to load Hexen 2 and found the solution earlier. :-)

    Glad i could help out again. :-)



  • i have uhexen2 succesfully compiled and running. however when i choose the character class demoness in the mission pack 'portal of praevus' and start the game it crashes. i dont have this problem with the windows version of uhexen2 so. all other things just run fine.

    btw when u bind quit to a key it doesnt quit instantly like in doom or quake ports. i got around this by binding killing the process for hexen2 binary to a button with xboxdrv.



Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.