As an enthusiastic Linux gamer, I heartily thank EgoSoft for making a native linux port of X-rebirth, and all modders for adding so much to the game.
Beware though, there are a few oddities to take into account with cross-platform compatibility, some of these also affect mods.
The majority of mods already work without problems, because they are either very simple, or accidentaly follow the rules below already.
This post is supposed to be a one-stop howto to making your mod work on Linux and Mac (and also SteamOS, which is Linux Inside(tm))
I'll be updating it as I learn more through my own experimentation.
Observations and tips from others are welcome, please reply below, and I'll merge them into this first post!
Step 1: lowercase extension folder name
X-rebirth does not detect mods with CAPITALS in their extension foldername:
steamapps/common/X Rebirth/extensions/Your.Awesome_Mod/ -> Not detected under Linux+Mac
steamapps/common/X Rebirth/extensions/your.awesome_mod/ -> Detected under Linux+Mac
By 'not detected' I mean that the mod won't be listed in the in-game extensions menu and won't have any in-game effect.
but the 'X' in X-rebirth is big?
Yes, the steamfolder for 'X Rebirth' is in capitals. It seems the game engine works with relative paths. So the engine-part that loads the mods only gets the 'extensions/your.awesome_mod' part, not the entire thing leading up to it.
What symbols can I use in extension folder names?
- a-z (lowercase only, NOT A-Z)
- 0-9
- . _
- maybe others, but no guarantees
Even if your extracted gamefiles have 'Economy' and/or 'Macros' written with capitals, inside your mod they should all be written with lowercase-only: 'economy', 'macros'.
But I'm obsessive about having the same casing as the gamefiles!
So am I, but it won't work on Linux+Mac, I tried. Sorry!
Step 3: lowercase all diffing .xml files
It seems XML diffs aren't properly apply if they are named in uppercase.
Even if the original gamefile is UPPERcase or mixed-case, if you are applying a diff to it, name your diff.xml in only lowercase.
But I'm obsessive about having the same casing as the gamefiles!
So am I, but it won't work on Linux+Mac, I tried. Sorry!
Step 4: fix references in index/macros.xml
Since we 'changed' the paths where our assets are (lowercasing them is a change of folder, see below), we must fix any references in index/macros.xml.
Go through your macros.xml and change all uppercases in the "value=" to lowercase:
Code: Select all
## BAD: v v v v v
<entry name="some_macro" value="extensions\Your.Awesome_Mod\assets\structures\Economy\production\Macros\some_macro"/>
## good (all lowercase)
<entry name="some_macro" value="extensions\your.awesome_mod\assets\structures\economy\production\macros\some_macro"/>
Macro names (and pointing to them with 'ref=') seem to be not affected by this. Some_Macro and some_macro both seem to work.
Be aware though, in savegames it seems all macro-id's are stored as lowercase.
What about my mod-id in content.xml?
Go nuts! lowercase, uppercase, dots, dashes, underscores all work
content.xml > "<content id="my.SUPER_AwEsOmE-mod" ...>" should work.
Testing VM
If you want to test this yourself, but don't have a Linux machine handy, jth has written a detailed guide on how to set up a Virtual Machine that can run steam and XRebirth.
Because you need graphics acceleration, it is slightly more involved than normal, but jth guides you through it.
jth's instructions to set up a Linux vm running DR
Background: Why is this happening?
Ah, so you're interested in the nitty-gritty details? Good!
The underlying cause is that Windows is different from all the other operating systems. Windows treats paths case-insensitve.
Most other OSes (Linux, Mac, BSD's) treat them case-sensitive.
TL;DR:
My Documents\
my documents\
My DoCuMEnTs\
on Windows+DOS --> all the same folder
on Linux+mac+BSD --> three different folders
This is often grounds for confusion, and has caused many a headache for people leaving the Windows-world for the first time.
update history
2015-06-27: first post
2015-07-05: added step3-lowercase xml-diffs; added faq about content.xml id
2016-03-21: linked jth's vm instructions
2022-05-13: improved formatting of macros example, since this is also relevant for X4