Tomb Raider

Tomb Raider

Not enough ratings
Tomb Raider 2013; Ubuntu 24.04.02 LTS fix
By Jim Taggart
Enables you to actually play the game.

Tomb Raider 2013; Ubuntu 24.04.02 LTS fix
   
Award
Favorite
Favorited
Unfavorite
Manual fix
Tomb Raider 2013 Ubuntu 24.04.02 LTS fix:

sudo dpkg --add-architecture i386; sudo apt update

###
Skip this:

sudo apt install libsdl2-image-2.0-0:i386 libgomp1:i386 libidn2-0:i386 idn:i386 librtmp1:i386 libldap2:i386 libnss3:i386 libxtst6:i386

###
and this first:

sudo ln -s /usr/lib/i386-linux-gnu/libidn.so.12 /usr/lib/i386-linux-gnu/libidn.so.11

sudo ln -s /usr/lib/i386-linux-gnu/librtmp.so.1 /usr/lib/i386-linux-gnu/librtmp.so.0

sudo ln -s /usr/lib/i386-linux-gnu/liblber.so.2 /usr/lib/i386-linux-gnu/liblber-2.4.so.2

sudo ln -s /usr/lib/i386-linux-gnu/libldap.so.2 /usr/lib/i386-linux-gnu/libldap_r-2.4.so.2

###

Create a TombRaider2013.sh file and chmod +x,
change the paths accordingly

(YOUR_STEAM_LIBRARY_LOCATION/steamapps/common...)

Place on desktop and enjoy.

#Copy and paste from here:

export LD_LIBRARY_PATH="YOUR_STEAM_LIBRARY_LOCATION/steamapps/common/Tomb Raider/lib/i686:$HOME/.local/share/Steam/ubuntu12_32/steam-runtime/lib/i386-linux-gnu:$HOME/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:$LD_LIBRARY_PATH" && cd "YOUR_STEAM_LIBRARY_LOCATION/steamapps/common/Tomb Raider/bin" && ./TombRaider

#To here

The problem is the missing libraries that the default launch script does not seem to find.
You can edit that but its contents may be replaced so here is the alternative fix.
Strangely enough the Rise of the Tomb Raider and Shadow of the Tomb Raider works just fine on Ubuntu 24.04.02 LTS.
Fast automated fix script for Ubuntu 24.04.02 LTS
#Tomb_Raider_2013_Ubuntu_24.04.2_LTS_FIX.sh

#-----------------------------------------------------------
#This script tries to find the missing libraries and places them to game_dir/lib folder,
#then it creates a launch.sh script where this library path is defined and then it
#creates a desktop shortcut to launch the game.

#Don't forget to set "Allow Launching" for the desktop shortcut.
#Now the game should launch from the shortcut.

#-----------------------------------------------------------

#You should only change the game_dir to your game folder, rest of the script should stay the same.
#Name the script to Tomb_Raider_2013_Ubuntu_24.04.2_LTS_FIX.sh and do
#chmod +x Tomb_Raider_2013_Ubuntu_24.04.2_LTS_FIX.sh

#then execute

#./Tomb_Raider_2013_Ubuntu_24.04.2_LTS_FIX.sh
#-----------------------------------------------------------

#!/bin/bash

# Define the game directory and executable
game_dir="YOUR_STEAM_LIBRARY_LOCATION/steamapps/common/Tomb Raider"
game_executable="$game_dir/bin/TombRaider"

# Define the destination directory
destination_dir="$game_dir/lib"

# Define the source directories
source_dirs=(
"$game_dir/lib/i686"
"$HOME/.local/share/Steam/ubuntu12_32/steam-runtime/lib/i386-linux-gnu"
"$HOME/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu"
"/usr/lib/i386-linux-gnu"
)

# Define the libraries to find
libraries=(
"libcrypto.so.1.0.0"
"libgconf-2.so.4"
"libhcrypto.so.4"
"libk5crypto.so.3"
"libminimum_thread_stack_size_wrapper.so"
"libroken.so.18"
"libXdamage.so.1"
"libasn1.so.8"
"libcups.so.2"
"libgio-2.0.so.0"
"libheimbase.so.1"
"libkeyutils.so.1"
"libpango-1.0.so.0"
"libssl.so.1.0.0"
"libavahi-client.so.3"
"libcurl.so.4"
"libglib-2.0.so.0"
"libheimntlm.so.0"
"libkrb5.so.26"
"libpangocairo-1.0.so.0"
"libsteam_api.so"
"libavahi-common.so.3"
"libdbus-glib-1.so.2"
"libgmodule-2.0.so.0"
"libhx509.so.5"
"libkrb5.so.3"
"libpangoft2-1.0.so.0"
"libtcmalloc_minimal.so"
"libcairo.so.2"
"libffi.so.6"
"libgobject-2.0.so.0"
"libicudata.so.51"
"libkrb5support.so.0"
"libpdf.so"
"libwind.so.0"
"libcef.so"
"libffmpegsumo.so"
"libgssapi_krb5.so.2"
"libicui18n.so.51"
"liblber-2.4.so.2"
"libpixman-1.so.0"
"libxcb-render.so.0"
"libCoreFoundation.so.476"
"libfmodex.so"
"libgssapi.so.3"
"libicuuc.so.51"
"libldap_r-2.4.so.2"
"libpng12.so.0"
"libXcomposite.so.1"
)

# Function to copy a library and handle errors
copy_library() {
local source_path="$1"
local dest_path="$2"
local lib_name="$3"

if [ -f "$source_path" ]; then
echo "Copying '$lib_name' from '$source_path' to '$dest_path'..."
if cp -v "$source_path" "$dest_path"; then
return 0 # Success
else
echo "Error: Failed to copy '$lib_name' from '$source_path'."
return 1 # Failure
fi
else
return 1 # Failure (file not found)
fi
}

# Function to create the launch script
create_launch_script() {
local launch_script_path="$game_dir/launch.sh"
local game_dir_for_script="$game_dir" # Use a more descriptive name

cat > "$launch_script_path" <<EOL
#!/bin/bash
export LD_LIBRARY_PATH="$game_dir_for_script/lib:\$LD_LIBRARY_PATH"
cd "$game_dir_for_script/bin"
./TombRaider
EOL

chmod +x "$launch_script_path"
echo "$launch_script_path" # Print the path to standard output
}

# Function to create a desktop shortcut
create_desktop_shortcut() {
local shortcut_path="$HOME/Desktop/Tomb Raider 2013.desktop"
local launch_script_path="$1" #take the launch script as argument

cat > "$shortcut_path" <<EOL
[Desktop Entry]
Name=Tomb Raider 2013
Comment=Launch Tomb Raider with custom library path
Exec="$launch_script_path"
Icon=steam_icon_203160
Terminal=false
Type=Application
Categories=Game;
EOL

chmod +x "$shortcut_path"
echo "Desktop shortcut created at $shortcut_path"
}

# Check for missing libraries at the start
echo "--- Checking for Missing Libraries ---"
missing_output=$(ldd "$game_executable" | grep "not found")
if [ -z "$missing_output" ]; then
echo "All required libraries found."
launch_script_path=$(create_launch_script) # Create the launch script
create_desktop_shortcut "$launch_script_path" # Create shortcut, pass script path
exit 0
else
echo "Missing libraries found. Proceeding to copy."
echo "$missing_output"
fi

# Ensure the destination directory exists
mkdir -p "$destination_dir"

# Find and copy libraries from source directories
echo ""
echo "--- Copying Libraries from Source Directories ---"
for library in "${libraries[@]}"; do
copied=false
for source_dir in "${source_dirs[@]}"; do
source_path="$source_dir/$library"
if copy_library "$source_path" "$destination_dir" "$library"; then
copied=true
break # Stop searching if found
fi
done
if [ ! "$copied" ]; then
echo "Warning: '$library' not found in any of the specified source directories."
fi
done

# Copy from i686 to lib, overwriting existing files
echo ""
echo "--- Final Copy from i686 (Overwrite Existing) ---"
i686_source_dir="$game_dir/lib/i686"
if [ -d "$i686_source_dir" ]; then
for library in "${libraries[@]}"; do # iterate only over the libraries we are interested in.
i686_path="$i686_source_dir/$library"
if [ -f "$i686_path" ]; then
echo "Copying '$library' from i686 (overwriting)..."
cp -v "$i686_path" "$destination_dir/$library"
fi
done
else
echo "Warning: i686 source directory '$i686_source_dir' does not exist."
fi

# Check for missing libraries at the end
echo ""
echo "--- Checking for Missing Libraries After Copying ---"
missing_output=$(ldd "$game_executable" | grep "not found")
if [ -z "$missing_output" ]; then
echo "All required libraries found after copying."
launch_script_path=$(create_launch_script) # Create the launch script
create_desktop_shortcut "$launch_script_path" # Create shortcut, pass script path
else
echo "Still missing libraries after copying:"
echo "$missing_output"
fi

echo "Finished processing libraries."