Using Tomb Editor and TombEngine with WineHQ (for building levels on Linux) - Tomb-Raider-Level-Editor/Tutorials GitHub Wiki
Written by Francis96
If you, like me, are a Linux user and you'd like to build using Tomb Editor, now you can to that without resorting to VMs or dual booting!
Installing Wine
First, you need to install wine (an open source "compatibility layer" that converts calls to the Windows API to linux kernel calls on the fly, allowing windows programs to run on linux with bare-metal performance) on your distribution. If you need help, have a look at the project's website:
https://wiki.winehq.org/Download
and look for specific instructions for the distro you are using.
To test if wine is installed and running, try running winecfg on the terminal.
This will init all DLLs for first use, and shortly after you should be greeted with the Wine configuration utility. You may be asked to install some libraries, like mono and gecko . You should answer Yes to both, but in my experience only mono is needed in most use cases (that's a wrapper to mscoree.dll that's used in .NET applications).
When winecfg window pops up, we know everything is up and running.
Installing TombEditor suite under wine
Then you can download TombEditor, just like you 'd do in windows. Download the installer (I'm using 1.7.1 x64 for the test), and run it.
You should be able to run the installer by double clicking on it, however in some distros you may have to associate .exe files to the wine executable.
Install as usual. At the end it'll ask to download and install windowsdesktop-runtime-6.0.33-win-x64 , click Yes and let it download, and install as usual.
After it installs, when you click on Finish on TombEditor setup you'll get the
You need .NET 6.0 installed. Do you want to download it now?"
question, this time answer No
Getting Tomb Editor to actually work
At this point, you'll have the Tomb Editor related entries aviable on the apps menu.
TombIDE, WadTool and SoundTool should already work out of the box. but for Tomb Editor and TombEngine itself we need to tweak a couple more things.
When you try to open tomb editor, you'll likely be disappointed, as the whole 3D room view will look pitch black.
However, texturing, lighting and objects work. Ignore the texture, it was just a test, I loaded the first image file I found and the stock TEN wad. :MegaLol:
It seems like the problem is only on the 3d geometry view, and only when the grid itself is displayed. What's on the grid only and it's pitch black? The grid lines. It seems like for some reason they are taking up the whole tile. I'm quite sure it's due to something going wrong between wine and SharpDX, but there's a workaround:
Make sure to close tomb editor, then navigate to the C: drive on the prefix you installed TombEditor to, (by default, it'll be an hidden folder named .wine\drive_c\ in your home folder), and open the file TombEditor\Configs\TombEditorConfiguration.xml with your favourite text editor.
Edit the grid line width at line 35, set it to 0, then save the file.
Et voilà, now it works!
Well, sort of. The lines are very thin, but it's usable. At this point, the whole editor works, with one exception being the Tools> Editor Options window. It'll trow some exception warning about fonts. You can safely click Continue and keep building, I'll have a look to TE's code and see if there's something to be done about that.
All the rest of the options windows and everything else I tested worked.
Fix d3dcompiler to get TombEngine up and running
At this point if you build the level it works, but if you try to play TombEngine will crash immediately after launch. This is due to the notoriously bad d3dcompiler_47.dll shipped with wine.
While you could just grab a good .DLL and put it in your executable folder, set an override for it in winecfg and be fine, it's better to fix it once for all using winetricks.
So first install winetricks from your package manager (if it wasn't already installed by wine as a dependency), then open a terminal and:
winetricks d3dcompiler_47
and TombEngine should now work as intended.
Other / good-to-know
I'm using wine version 9.15 (latest development version at time of writing). I'm not sure if it works with wine 9.0 (stable).
Fix for missing graphics drivers
If you are missing some of the mesa related packages required for 3d acceleration on your graphics card, you may not be able to get any of this running. In most cases, I found that installing steam on linux will pull all required packages at once, so if you can't get this working, try installing steam and rebooting.
Associate .exe files with wine automatically
If you can't open an exe file on double click, or it's opening in some other program default (e.g. an archive manager), try going to the file properties to change the default program. Also, make sure to set the executable bit (also found on the file properties or chmod +x on the terminal).
Improve performance on TombEngine
You can get better performance on TombEngine on linux by using DXVK. Linux vulkan drivers are quite good for pretty much anything made after 2015. These are DLLs that convert DX driver calls to Vulkan, and should ony be used for gaming. They works great on TEN, but you must not use these on any other piece of the TombEditor suite, or non-game programs, as they have problems when managing multiple windows at once and will cause crashes.
While you can install DXVK with winetricks, installing them for the whole prefix is not recommended for the above reason, but you can use DLL overrides to use them only for certain programs.
First open winecfg from the terminal or command launcher.
Then go to the Librairies tab, and add overrides for these DLLs, one at a time (just type part of the name to the listbox, and press down arrow till the right one is selected, and click Add).
- d3d9
- d3d10core
- d3d11
- dxgi
after adding the overrides you'll see they show up on the list as dll_name (Native, Builtin)
This means if any of those dlls is found in the .exe diretory, it will be used by wine instead of the default one.
So, download dxvk dlls from https://github.com/doitsujin/dxvk/releases , extract the ones you need (x86 or x64), and place them in the folder where the TombEngine.exe is located inside your project folder.
Again, don't place them in your TombEditor folder, as it won't work.