Documenting installing UT2004 64-bit on linux Ubuntu  (Read 5441 times)

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Documenting installing UT2004 64-bit on linux Ubuntu
« on: October 31, 2024, 22:38 »
1. Installed Ubuntu - I used Ubuntu 24.04.1 LTS from here: https://ubuntu.com/download/desktop

2. Copied across my entire UT2004 directory from Windows, on a USB stick, to my home directory on Linux, and renamed it
Code: [Select]
.ut2004 (dot ut2004). I'd already got the ut2004-bin-linux-amd64 executable from the linux 3369 patch. Made it executable:

Code: [Select]
chmod +x ut2004-bin-linux-amd64

3. Grabbed the 64-bit libraries needed for UT to run.

From the ~/.ut2004/System directory I ran the following commands to install and create a symlink to each. This gets you libSDL-1.2.so.0 & libstdc++.so.5 &  Openal for sound: and creates a symlink for them in the System directory:

Code: [Select]
sudo apt-get install libsdl1.2debian
ln -sf /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0  .

sudo apt-get install libstdc++5
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.5  .

sudo apt-get install libopenal1
ln -sf  /usr/lib/x86_64-linux-gnu/libopenal.so.1.23.1 ./openal.so

4. Created a file "cdkey" in ~/.ut2004/System directory containing my CD Key

5. Edited UT2004.ini for opengl and alaudio:

Code: [Select]
[Engine.Engine]
RenderDevice=OpenGLDrv.OpenGLRenderDevice
AudioDevice=ALAudio.ALAudioSubsystem

6. Slightly late, changed to using KDE, as without it the in-game display sliders for contrast, brightness and saturation didn't work: https://linuxcapable.com/how-to-install-kde-plasma-on-ubuntu-linux/

7. Two commands that are useful (from Holyspam):

Mesa drivers have mesa_glthread flag which enables multi-threading on their OpenGL driver implementation: https://linuxcapable.com/how-to-install-kde-plasma-on-ubuntu-linux/


Set up CPU for performance:
Code: [Select]
sudo cpupower frequency-set --governor performance


Run:
Code: [Select]
cd ~/.ut2004/System/
./ut2004-bin-linux-amd64
« Last Edit: November 09, 2024, 22:28 by Piglet »

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #1 on: November 01, 2024, 15:23 »
Updated with a link to the v3369 linux patch. That has both the 32 bit and 64 bit versions of both client and server.

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #2 on: November 05, 2024, 23:39 »
Here's an update for 32 bit UT2004 on 64 bit Ubuntu, and for running either that or 64 bit UT:

Code: [Select]
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libstdc++5:i386 libsdl1.2-compat:i386 libopenal1:i386 libgl1:i386


To run 32 bit, I execute this:

Code: [Select]
#!/bin/bash

export MESA_GLTHREAD=TRUE

cd ~/.ut2004/System/

ln -sf /usr/lib/i386-linux-gnu/libSDL-1.2.so.0 .
ln -sf /usr/lib/i386-linux-gnu/libstdc++.so.5 .
ln -sf /usr/lib/i386-linux-gnu/libopenal.so.1 ./openal.so
ln -sf /usr/lib/i386-linux-gnu/libGL.so.1 ./libGL.so.1


./ut2004-bin

To run 64 bit UT2004 I execute this:

Code: [Select]
#!/bin/bash

export MESA_GLTHREAD=TRUE

cd ~/.ut2004/System/

ln -sf /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0  .
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.5  .
ln -sf  /usr/lib/x86_64-linux-gnu/libopenal.so.1.23.1 ./openal.so


./ut2004-bin-linux-amd64


To make it even smoother you can run this before UT:

Code: [Select]
sudo cpupower frequency-set --governor performance
and this afterwards, to return to power saving mode:

Code: [Select]
sudo cpupower frequency-set --governor powersave

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #3 on: November 09, 2024, 22:31 »
Small update, rather than boosting all cores, you can set the game to run on a specific one that you boost - e.g. core 1:

Code: [Select]
sudo cpupower -c 1 frequency-set --governor performance

Code: [Select]
#!/bin/bash

export MESA_GLTHREAD=TRUE

cd ~/.ut2004/System/

ln -sf /usr/lib/i386-linux-gnu/libSDL-1.2.so.0 .
ln -sf /usr/lib/i386-linux-gnu/libstdc++.so.5 .
ln -sf /usr/lib/i386-linux-gnu/libopenal.so.1 ./openal.so
ln -sf /usr/lib/i386-linux-gnu/libGL.so.1 ./libGL.so.1


taskset -c 1 ./ut2004-bin

and afterwards can set the core back to normal:

Code: [Select]
sudo cpupower -c 1 frequency-set --governor powersave

dk uk

  • Newbie
  • *
  • Posts: 9
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #4 on: November 17, 2024, 22:26 »
Hi Pig,
I've installed Ubuntu with dual boot - but my system now boots into Linux by default. Any ideas how I can change this to default to Windows 11?
I'm not clued up on linux and haven't got to the copying UT file bits over. It's just I sometimes use RealVNC and want it to boot to Windows as default...

-Adler-

  • Junior Member
  • *
  • Posts: 47
  • Country: 00
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #5 on: November 21, 2024, 18:21 »
Hi Pig,
I've installed Ubuntu with dual boot - but my system now boots into Linux by default. Any ideas how I can change this to default to Windows 11?
I'm not clued up on linux and haven't got to the copying UT file bits over. It's just I sometimes use RealVNC and want it to boot to Windows as default...

RealvNc is also available for Linux:
https://www.realvnc.com/de/connect/download/viewer/linux/


How to Change Default Boot OS in Dual Boot: Linux or Windows
« Last Edit: November 21, 2024, 18:25 by -Adler- »
-----------------------------------------------------------------
Sorry, but I don't trust anything that bleeds for five days and doesn't die.

Stealer

  • 1337
  • *
  • Posts: 299
  • Country: gb
    • 76561197992159424
    • StealerNinja
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #6 on: November 21, 2024, 21:15 »
Hi Pig,
I've installed Ubuntu with dual boot - but my system now boots into Linux by default. Any ideas how I can change this to default to Windows 11?
I'm not clued up on linux and haven't got to the copying UT file bits over. It's just I sometimes use RealVNC and want it to boot to Windows as default...
Off the top of my head I believe you have to press F8 or F6 to bring up the boot menu, during power on or hard reset. If you've got the OS's on different drives/partitions you can just select your boot preference in your bios [del] key on boot.
Stealer.T32

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #7 on: November 21, 2024, 21:45 »
For me it's delete of F2 to get into the bios and then select the drive I want to boot from (if it's not the default one).

Annoyingly if I want to boot to Linux I find that I have the default set to windows - so after a few boots I get round to changing it. Then I want windows a few times in a row. Rinse and repeat...

dk uk

  • Newbie
  • *
  • Posts: 9
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #8 on: November 27, 2024, 20:54 »
Thanks for all the answers.
I've changed Bios to boot into Windows - I was just hoping that I could select Windows as default using the Linux boot menu (Grub?)

I suppose it's no great hardship as I'm likely to be infront of my PC on the ocassions I need Ubuntu...

  :)

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #9 on: November 28, 2024, 10:03 »
You should be able to set Windows as default in grub:

https://help.ubuntu.com/community/Grub2#Configuring_GRUB_2

-Adler-

  • Junior Member
  • *
  • Posts: 47
  • Country: 00
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #10 on: December 01, 2024, 11:21 »
small instructions:

e.c. current boot order:


Open a terminal (“CTRL” + “ALT” + “T.”) and enter the command.
Code: [Select]
sudo nano /etc/default/grub
Change default value:
Code: [Select]
GRUB_DEFAULT=2Since Windows is placed 3rd in the boot order and the order starts with 0, in the special case you change GRUB_DEFAULT from 0 to 2.



save changes:
Close the file with the F2 key and confirm saving with “Y” (Yes).
And also confirm “File name to save” with the ENTER key.

update grub:
After saving, the values ​​are written to the boot manager using the following command. A restart now results in Windows booting automatically.
Code: [Select]
sudo update-grub
grub menu after boot:
The preselection is set to 'Windows Boot Manager' in the GRUB boot menu.

-----------------------------------------------------------------
Sorry, but I don't trust anything that bleeds for five days and doesn't die.

Piglet

  • 1337
  • *
  • Posts: 3262
  • Country: gb
Re: Documenting installing UT2004 64-bit on linux Ubuntu
« Reply #11 on: December 27, 2024, 22:04 »
So, aside from text to speech (doesn't work in Linux),

Under [SDLDrv.SDLClient] in UT2004.ini:

Code: [Select]
[SDLDrv.SDLClient]
TextToSpeechFile=/home/youruserid/tts.txt

In the command line, before starting UT:

echo "Starting" > ~/tts.txt; tail -f ~/tts.txt | while read line; do echo "$line" | festival --tts; done;

The_Coolest

  • Newbie
  • *
  • Posts: 8
  • Country: il
...
Code: [Select]
sudo cpupower -c 1 frequency-set --governor powersave

This doesn't work correctly, at least on my system.
Even though the governor is changed, the CPU keeps boosting until I toggle the power plans.
Same behavior with a single core or all cores. I suggest you check it. You can use `turbostat` to see the package power or my Core Temp utility for that or any other hardware monitor utility I guess.

Here are a few screenshots, note Power, Frequency and VID fields.
Before doing anything, idle, Balanced power plan:


While UT is in main menu (core 14):


After exiting game and calling 'sudo cpupower -c 14 frequency-set --governor powersave'


After toggling power mode:

holyspam

  • 1337
  • *
  • Posts: 344
  • Country: gr
It depends on BIOS and kernel - if you have CPPC1+2 enabled in BIOS, i believe the latest versions of the kernel will use amd_pstate+schedutil as default governor, in this case powersave will not disable boost

If you want the "legacy" behavior, you will have to disable CPPC from BIOS

edit: legacy is called acpi-cpufreq
« Last Edit: Today at 10:54 by holyspam »

The_Coolest

  • Newbie
  • *
  • Posts: 8
  • Country: il
I have no intention of switching to legacy behavior.
I'm no Linux pro, but if you can switch the power profile from the UI, it should be possible to toggle it the same way with a command.
I tried looking for how it's done, and found this:
https://ubuntuhandbook.org/index.php/2023/10/command-cpu-power-mode-ubuntu-22-04/
Haven't tried it myself yet. You either need to install powerprofilesctl or run a convoluted command, I guess this isn't really an issue as this would be executed as a script anyway.