Set Up Mapping on Linux - WapaMario63/-mlptf2-Maps GitHub Wiki
As you obviously have noticed, none of the tools for mapping are available on Linux, however, you can still run them in wine or proton!
Get Windows Binaries
First thing you need are the windows binaries for TF2, which can easily be acquired within steam itself. You need to launch steam with -console
as a parameter. You can just launch steam in the terminal this way.
$ steam -console
Once steam is open you will see a "Console" tab, here is where you can download 'depots', in our case we want the TF2 Windows binary depot. You will need the game ID and the depot ID, which you can find on SteamDB, but I'll spoonfeed it to you: 440
is the steam store ID for TF2, and 232251
is the depot ID for the Windows binaries. With this, you put the following in the steam console:
download_depot 440 232251
Wait till it finishes and navigate to this directory: ~/.local/share/steam/ubuntu12_32/steamapps/content/app_440/depot_232251/
and copy everything in it to your own TF2 installation folder alongside the Linux binaries.
Get Hammer Running
You now have all the tools installed, though I'd also advice getting Hammer++ installed, its just better and it might even have better wine/proton compatibility. Install that in your TF2 bin/x64
directory just like on windows.
Steam Proton Method
- Add
hammer.exe
orhammerplusplus.exe
as a non-steam game. - Go to Properties and change compatibility to the latest Proton version.
- Run it.
Lutris Wine Method
- Add a new game and select "Add Locally Installed Game", fill in basic info and select Wine as the Runner.
- In Game Options tab, set the executable to hammmer/++ and the working directory to your TF2 bin folder. Wineprefix folder can be anywhere you want. I suggest making a dedicated Wine prefixes folder in your home directory and then create a, for example, a folder named "hammer" to use as a wineprefix directory.
- In Runner Options, select a wine or proton version, you can try using your system wine or one of the proton versions. Leave DXVK Enabled.
- Save it and run it.
Issues
Permafreezes
If interacting with the 2D view or resizing brushes in the 3D view cause a permafreeze, try using Proton GE or Wine GE, an older version of it. I found that ProtonGE 7.41 and Lutris-GE-Proton 7.24 run best.
Installing Proton-GE on steam:
- Download Proton-GE 7.41: https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/GE-Proton7-41
- Extract it inside
~/.steam/steam/compatibilitytools.d/
. a. If there is nocompatibilitytools.d
folder, create it. - Restart steam, it should now show up as an option in Properties > Compatibility.
Installing Proton-GE on Lutris:
- Go to the hamburger menu on the right then Preferences > Runners > Wine > Package Icon Button on the right.
- Select Install Lutris-GE-Proton-7-24 (or lutris-ge-lol-7.14)
- Configure your Hammer entry to use Lutris-GE-Proton-7-24 as the wine version in the runner options.
Doesn't Run
If you don't already have protontricks
and winetricks
installed go into your package manager of your distro and do so.
- If you used Steam: Open it and select the Non-Steam shortcut of hammer you created. If you used Lutris: Next to the play button there is a wine button, click that and select Winetricks.
- Select default wineprefix then "Install a Windows DLL or component".
- Install the following as taken from a TF2Maps thread:
dotnet20, dotnet48, vcrun2003, vcrun2005, vcrun2008, vcrun2010, vcrun2012, vcrun2013, vcrun2015
- Hope to Celestia it runs this time.
Map Compiling
You can compile your map within hammer just fine, however, for publishing, switch to expert mode and switch to the "LDR + HDR Full Compile -final" preset. Disable running the game from it since that won't do anything, you'll have to open TF2 manually yourself.
Note: A tool similar to CompilePal is currently being developed that works natively on Linux that will make this process just as easy as using CompilePal. This includes asset packing so it will make the guide below unnecessary.
Packing Assets
If you have a bunch of custom assets in your map (you will because you put mares in it, right anon?), you need to pack them and to do so it requires use of bspzip
, which it needs a file that lists every single asset used to be packed, which is tedious. Luckily, there is this terminal tool that will detect custom assets in your compiled map and write it all for you! Download it here: https://github.com/WapaMario63/Mares-BSP-Asset-Detector/releases/tag/v0.1.1
Steps for packing map assets:
- Have dotnet 6.0+ installed so check your distro's package manager if you haven't already.
- Run the tool you downloaded:
$ ./assetdetector <your map bsp> <your TF2 game folder>
- It will spit out a file named
detected_assets.txt
. You can move this somewhere in your TF2 folder if you want and rename it. - Run in wine
bspzip.exe
with these parameters:
$ wine bspzip.exe -addlist "Z:\<your unpacked map bsp>" "Z:\<your detected_assets.txt file>" "Z:\<your packed map bsp>"
- Map file size will probably be stupidly huge, so compress it! Run
bspzip.exe
again like so:
$ wine bspzip.exe -repack -compress "Z:\<your packed map bsp>"
Your map is now ready for distribution. Zip it along with your map VMF, upload it a file host of your choice and post it in the thread!