[PSA] Steps to make your mod work on Linux+Mac

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

[PSA] Steps to make your mod work on Linux+Mac

Post by CulunTse » Sat, 27. Jun 15, 13:50

Public Service Announcement: Steps to make your mod work on Linux+Mac

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
Step 2: lowercase all subfolders ('Economy', 'Macros', etc)
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

<entry name="some_macro" value="extensions\Your.Awesome_Mod\assets\structures\Economy\production\Macros\some_macro"/>
becomes

Code: Select all

<entry name="some_macro" value="extensions\your.awesome_mod\assets\structures\economy\production\macros\some_macro"/>
What about my macro refnames?
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
Last edited by CulunTse on Tue, 22. Mar 16, 18:30, edited 2 times in total.

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Sat, 27. Jun 15, 13:50

Reserved:
List of mods tested to work on Linux
(Formatting shamelessly copied from the awesome mod-overview by NZ-Wanderer

Working on Linux almost working under linux
You'll need to rename some files to lowercase for these ones.
Mods in this list don't have cat/dat files, so only your default file manager is enough to correct them. Working on Mac
(I don't have a mac, so I can't test for you, however, if it works on linux, you have good chances)
  • ???
Version history:
- 2015-06-30: confirmed working of Log-Everything
- 2015-07-05: Confirmed working of w.evans Station Engineers (starting from v0.05); added section for 'almost working' with OOZ-ship-build and project Fedhelm as inaugural listing
- 2015-07-11: confirmed MitchTech Station Logistics works, as well as Bar-Music and Desexualised Clubs
- 2015-08-05: confirmed working of Black Market Seminars, BlackRain's NPC on your stations, Inventory Craft Items Marked, MitchTech Enhanced Money Transfer (had a backlog of stuff tested-but-not-posted-yet. Sorry! but I also want to actually play the game ;-) )
- 2016-03-22: tentatively added Strude's mods: training upkeep missions and rare engines scan best
- 2016-04-01: added jth's awesome mods after he tested on a Linux vm
- 2017-05-01: Added Upgrade All Button to the "almost working" list
Last edited by CulunTse on Mon, 1. May 17, 14:05, edited 11 times in total.

User avatar
YorrickVander
Posts: 2672
Joined: Tue, 29. Oct 13, 22:59
x4

Post by YorrickVander » Sat, 27. Jun 15, 18:38

a good point well made :)
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Sun, 28. Jun 15, 06:41

Thanks for this, Crunchy. I'll work through my other stuff later this week.

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Sun, 28. Jun 15, 08:36

Couldn't resist and been having a slow day, so thought might as well. Worked through everything, and the following mods ought to be compatible with the Linux and, I would hope, the Mac versions of X:R:

MarineRebalance,
BetterAutoAim
SmalltalkHack,
Epic Capital Ship Shields,
Station Engineers,
Engineer Drone Fix,
Slightly More Useful Plot Station,
Miscellaneous IZ Combat Tweaks,
Miscellaneous OOZ Combat Tweaks

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13923
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Sun, 28. Jun 15, 11:51

mine are sadly incompatible because i like to use CamelCase. i wont make a big update for all, but i will shift this gradually either when i make the next Version or when someone wants to use it in linux - just drop me a note and i will change the filenames to lower case
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Juggernaut93
Posts: 2712
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Sun, 28. Jun 15, 15:15

My Log Everything extension should work with Linux, as I only used lowercase letters. I can't test it though.

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Sun, 28. Jun 15, 15:34

Glad to see some preliminary interest in this topic!

@UniTrader
Don't worry! I don't expect everything to drop everything and work on linux compatibility. We're all volunteers here after all.
I just want this information to be out there, to make it maximally easy for everyone to either help themselves, or for mod-authors to adapt it for them.
I believe that the easier I make it, the more people will do it :-)
(Yes, I'm an optimist ;-) )



@Juggernaut
I'll try and give the Log-Everything a go then :-)

User avatar
Juggernaut93
Posts: 2712
Joined: Sun, 17. Jul 11, 21:03
x4

Post by Juggernaut93 » Sun, 28. Jun 15, 17:07

CulunTse wrote:@Juggernaut
I'll try and give the Log-Everything a go then :-)
Great, thanks :)

User avatar
NZ-Wanderer
Posts: 1506
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer » Sun, 28. Jun 15, 23:14

Hey guys, just got pointed in this direction :)

I will put a note at the top of my list pointing to this list so that Mac and Linux have a nice little home to call their own :)

PS: no need to shamelessly copy my list, feel free to use the complete formatting of it if you want :)

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Mon, 29. Jun 15, 08:22

P.S. Walker.Evans thanks for adapting your many mods! I'll try to give them a round of testing too.
For the combat mods, what should I look out for to see if it's your mods, and not the vanilla scripts? (I have an unused capped succelus and Balor, but I've not used them in vanilla yet, so I won't see any difference.

@NZ-wanderer: thanks for the link!

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Tue, 30. Jun 15, 22:37

@Juggernaut: Log Everything works!

@W.Evans
I tried the latest StationEngineers; it is detected under linux in the extension list, but I couldn't assign engineers to my station:
no "work here" option when docked, stations "select" grayed out in map-view from space after selecting "work somewhere else for me".

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Tue, 30. Jun 15, 22:44

@CulunTse, Sucellus and Balor would be optimal for testing MICT since they'll be the most obvious. MICT behavior for them would be to jump to extremely long range facing the target and start banging away. If the target gets close, they should move (jump/boost/move) away. Vanilla behavior would have them start moving toward the target, and, er, sometimes keep moving towards the target. Make sure your ships have good crews though (at least 4 stars in all primary skills), or MICT won't kick in.

I'll look into Station Engineers, thanks!

edit: hm. About station engineers, another puzzle. It only alters one file: \md\NPC_Engineer.xml. The altered nodes should still hit in 3.53 and in 3.60b1. No capitalized folders. The file name itself has capitalized letters, but that's straight from the vanilla files. Think that md files should be in small caps as well?

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Wed, 1. Jul 15, 08:32

MICT/MOCT will probably take a while for me to test. Right now XR is half an hour here, an hour there for me. Executing a small fleet battle doesn't easily fit that pattern :-)
4/4/4 staff won't be a problem, I'll check beforehand.

I plan to try the engineers file with small letters too and let you know what happens. It surprised me too.

CulunTse
Posts: 73
Joined: Mon, 15. Jun 15, 08:10
xr

Post by CulunTse » Sun, 5. Jul 15, 13:42

re: Station Engineers:
renaming extensions/w.e_stationengineers/md/NPC_Engineer.xml to lowercase fixed it; I could immediately assign station engineers (yay!)

I updated the guide with another step to mention this.

MICT is still on the todo-list. If the high temparatures outside don't cook my GPU (or me) I should get some time in today :-)

Post Reply

Return to “X Rebirth - Scripts and Modding”