Jump to content

Modding XCOM under Linux


wghost81

Recommended Posts

So, XCOM for Linux is out and all Linux users are happy, including me. :smile:

 

First impression: the game is lagging. Especially video. Minimal system requirements are doubled for Linux. Bad optimization, Feral, very-very bad. Civ5 by Aspyr works way-way better.

 

So far I made just one very simple mod: removed intro movies. Works like a charm. :smile:

 

Linux file structure for XCOM:

 

Game itself is installed under steam library. Default path:

~/.local/share/Steam/SteamApps/common/XCom-Enemy-Unknown
Saved games and configs are stored in:

~/.local/share/feral-interactive/XCOM
EW files are stored under

~/.local/share/Steam/SteamApps/common/XCom-Enemy-Unknown/xew
and

~/.local/share/feral-interactive/XCOM/XEW
Profile and saved games are stored in savedata sub-folder and merged configs are stored in WritableFiles sub-folder.

 

For EU there is hashes.sha file located in steam game install folder under binaries/win32, but the game completely ignores it.

 

There is just one version.txt file under main game install folder, which contains

Version - 1.0 Beta 2
Built from revision - 51336 
Great! We're beta testers! :smile: EW doesn't have separate version file, so prepare for more patch mix-ups.

 

Packages under cookedpcconsole are identical to windows version.

 

Linux doesn't have "Program Files" problem, so default install path will do. Phoning home can be disabled via /etc/hosts.deny (su or sudo needed):

# Prevent Steam from Phoning Home (XCOM 2012)
ALL: prod.xcom.firaxis.com
ALL: 65.118.245.165
# Prevent Steam from Phoning Home (XCOM EW 2012)
ALL: prod.xcom-ew.firaxis.com
ALL: 65.118.245.139
And, of course, disable Steam auto-updates.

 

My next step will be to compile XCOMLZO and PatchUPK under 64 bit system (which I installed for XCOM and XCOM only :smile: ) and try to do some actual linux XCOM modding. :smile: But, since I'm still having some real life issues, I can't say anything about terms. So, any linux user is welcomed to use github repo

https://github.com/wghost/UPKUtils

and compile all the utils for your system. I used wxWidgets3.0 and CodeBlocks for development, so you'll need those too.

 

Edit: updated paths to be more readable and changed "phoning home" info.

Edited by wghost81
Link to comment
Share on other sites

  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

Little more info.

 

First, I can confirm that linux EU version ignores hashes.sha file: it runs fine with unpacked game packages.

 

Second, right way to disable "Phoning home" will be to edit /etc/hosts.deny file and add the following lines:

# Prevent Steam from Phoning Home (XCOM 2012)
ALL: prod.xcom.firaxis.com
ALL: 65.118.245.165

# Prevent Steam from Phoning Home (XCOM EW 2012)
ALL: prod.xcom-ew.firaxis.com
ALL: 65.118.245.139
And third: ini editing works too. Linux version ignores defaultgamecore.ini file, same as Windows version, but if you copy

~/.local/share/Steam/SteamApps/common/XCom-Enemy-Unknown/xcomgame/config/defaultgamecore.ini
to

~/.local/share/feral-interactive/XCOM/WritableFiles/XComGameCore.ini
game will read data from that file. I tested it and it works: http://steamcommunity.com/sharedfiles/filedetails/?id=274396273

 

I've also noticed, that EW writes launch.log file to ~/.local/share/feral-interactive/XCOM/XEW/Logs, but EU doesn't. Turns out, debugging features were disabled for EU (confirmed by Feral member on Steam forums).

Edited by wghost81
Link to comment
Share on other sites

UPK Utils and mods are working perfectly under Linux: http://steamcommunity.com/sharedfiles/filedetails/?id=276064734

 

Turns out, I'm not that bad at programming as I thought: all utilities compiled successfully under x86_64 linux OS. :smile: That's not my first cross-platform program, but sure is my first cross-architecture one. :smile: I need to check PatchUPK code, though, as integers under x86_64 are a whole new beast for me (I've never worked with x86_64 systems before).

 

Only problem so far is that Feral renamed all the packages to be lowercase. And I used original CamelCase names in all mod files. Since Linux file systems are case-sensitive PatchUPK fails to find a package, but converting package name to lowercase helps.

Link to comment
Share on other sites

UPKmodder is coded 100% in java, so in theory the jar file should run fine under Linux as well. Only problem is that I'm not running Linux so I can't test it. But I did do my best to avoid any Windows-specific constructions while coding.

 

If you test and find any problems, please feel free to let me know :)

Link to comment
Share on other sites

Amineri, tested it and it works after some minor changes. First, old projects won't open, because source-root path is different under linux. BTW, I tried relative path, but only absolute one works. After I changed source-root and opened my project, another problem appeared: program couldn't find 'config/operand_data.ini'. I've checked and found that folder is actually called 'Config' and register matters under Linux. So I renamed it to 'config' and UPK Modder worked. I haven't tested it extensively, though.

 

My suggestion will be to use relative path in project files and to make every internal config path lowercase.

Link to comment
Share on other sites

Manux123, sorry, I haven't added any docs nor cross-platform makefile yet. But I'm planning to do it. UPKUtils are CodeBlocks project and have cbp project file inside. XCOMLZO compiles without any problems and PatchUPK needs some minor changes, related to 64-bit system. I haven't yet looked at PatcherGUI code, but it will require more work to compile as it has some windows-related settings inside.
Link to comment
Share on other sites

I've updated github repo with modified source files and added cmake project files for easy cross-platform compilation.

 

Install gcc-c++ compiler, cmake, git and any wxGTK-devel package available for your distribution repository. Aside from PatcherGUI, which isn't ready for Linux compilation yet, there is just one program which requires wxWidgets - DeserializeAll. Everything else should compile perfectly without wxGTK installed.

 

Clone github repo and compile UPKUtils project:

git clone https://github.com/wghost/UPKUtils.git
cd UPKUtils/build
cmake .
make
To compile XComLZO packer/unpacker:

cd UPKUtils/XComLZO/build
cmake .
make
Readme files are available as part of Nexus UPKUtils file: http://www.nexusmods.com/xcom/mods/448 (I will add those to github repo later).

 

For now XComLZO is working with fully compressed packages only (ones which have additional package_name.uncompressed_size file) like xcomgame and xcomstrategygame. I will move this project to main UPKUtils project and add full compressed packages support later.

 

As usual, if you're using unpacked/modded packages, you have to delete uncompressed_size files for game to launch properly.

Edited by wghost81
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...