Jump to content

Android EW Modding Tools


Bogdacutu

Recommended Posts

This should hopefully be useful for anyone who is planning to make/port mods to the Android version of the game.

 

https://github.com/Bogdacutu/XComAndroidTools/releases

 

Tools provided (for most tools, just drop the file you want to use the tool with on the executable):

  • Sewer - unpacks obb files when given an obb file, or creates an obb file when given a folder
  • FixTOC - after doing edits, use this on the main directory (the one with Binaries, Engine and XComGame) to rebuild AndroidTOC.txt
  • Compressor - use this on a compressed upk file to decompress it, do it again to recompress (this will also automatically rebuild .uncompressed_size)
  • Decryptor/Encryptor - some files are encrypted (only tested with Coalesced_*.bin so far), use this with those files to decrypt/encrypt them respectively
  • Coalescer - like Sewer, but for Coalesced_*.bin files (which contain the configuration files)

How to use them:

  1. unpack obb with Sewer
  2. to edit ini files:
    1. decrypt Coalesced_INT.bin with Decryptor
    2. unpack it with Coalescer
    3. edit whatever you need to edit
    4. repack, encrypt
  3. to edit upk files:
    1. if the file is compressed, decompress it with Compressor
    2. edit whatever you need to edit
    3. recompress if desired (the engine works fine with decompressed files too)
  4. run FixTOC on the main folder
  5. pack the folder with Sewer
  6. copy obb to device, replacing the existing one
  7. ???
  8. profit

Some screenshots of results:

Observations:

  • Some generic UE tools work on the Android files too, such as UE Explorer
  • Some upk files appear to be encrypted; I haven't yet figured out how to handle them
  • PatchUPK doesn't work yet, but I've forked it and will try to get it working (although I haven't made a lot of progress on that yet)
  • If you did something wrong, the game will crash as soon as it loads whatever you edited
  • Iteration is pretty slow (since each obb file is 1-2GB), I might look into making a tool to patch the existing obb files directly on the device
  • OBB files normally have a size limit of 2GB, but I can't confirm whether or not the game actually limits the size (each packed file is limited to 2GB though)
  • xxx files are just upk files with a different extension
Edited by Bogdacutu
Link to comment
Share on other sites

Just finished porting PatchUPK, will upload the changes soon. https://github.com/Bogdacutu/UPKUtilsAndroid/releases/tag/7.3-android

 

Some PC mods work as-is; for example, the big head mod:

 

http://i.imgur.com/7mkPZQu.jpg

 

Also, the FixTOC tool only works when both obb files are extracted in the same folder, so for now I'd suggest just editing the TOC file manually until I fix the tool. First column is file size, second column is uncompressed file size.

Edited by Bogdacutu
Link to comment
Share on other sites

  • 5 months later...

OK, well I thought it was working but then the next time I tried to open XCOM I got this:

 

 

I ended up having to reinstall the game from fresh. Any ideas what caused this? Something to do with the TOC perhaps?

 


Also, the FixTOC tool only works when both obb files are extracted in the same folder, so for now I'd suggest just editing the TOC file manually until I fix the tool. First column is file size, second column is uncompressed file size.

 

What does this mean?

Link to comment
Share on other sites

Suggest you read the "Basic Guide to installing mods" wiki article; the "Environment" section in particular. Unlike other games you may be familiar with, XCom does not directly support modding the game. All mods (except edits to INI files) are "hacks" to the game executable. Steam then regards this as a "corrupted" copy of the game, and reinstalls, losing you all your mods. So you have to play XCom "offline" once you get it installed. Note there is a distinction between the "Steam Client" and a "Steam Game". The client updates fairly frequently, which is not a big deal as far as the game is concerned, except that it often results in resetting of the Steam settings for the game. So always check your game's "Steam Library" settings after a Client update.

 

As for what Bogdacutu means, all I can give you is an abstract interpretation. I am not a mod creator and haven't dealt with this before:

 

UPKUtils is a set of "command line" utilities for analyzing and patching uncompressed UPK files. Presumably "FixTOC" is one of those tools. I'm not familiar with the TOC file, but it most probably conforms to the general "UPK Format". The author of UPKUtils (wghost81) has also created a "UPK Format.pdf" file, which is available on the download page. The tool is for modifying a part of that format in the TOC file dealing with the compressed and uncompressed sizes of the "obb" files in question. Bogdacutu is saying his Android version of the tool currently requires that both the "obb" files involved in whatever customization is being undertaken must be extracted into the same folder, rather than being able to work on them still in the UPK file.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

Thanks for the tips, but the Basic Guide is about modding the PC/Steam version of the game, and says nothing about modding the Android version. As per my post above, what I've done is simply edit INI files, but when recompiling the OBB file (the package that holds all game files for Android) I suspect I may have updated the TOC file (Android Table Of Contents file) incorrectly. Presumably this is causing the game (or Google Play Store?) to see the OBB file as invalid.

 

I'd be grateful for any Android-specific guidance on updating the TOC file correctly. Thanks.

Link to comment
Share on other sites

Unfortunately what little knowledge we have related to Android is in the Basic Guide under "ARM / IOS Devices". Other than processor specific details, modding for XCom is "platform neutral". The "Android Table of Contents" and the "obb" file format would be "processor specific" (which I hadn't picked up on in my original reply). I believe that information is generally available about the platform on the Internet. It really has nothing directly to do with modding UPK files. It's "packaging" (as is a UPK), an alternative format to the "ZIP/7zip/RAR" archive files used on the PC side. More than likely the "FixTC" tool is using a library you are either missing or needs to be updated, but that is just a guess.

 

I will happy to add any information you discover on the matter to our wiki for the next Android user.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

If I recall correctly (don't have access to the game files atm), the TOC contained the size of each file, so you'd need to change the size there too if you edit any other file.

 

Oh, good. This caught your attention. Just the person I need to clarify something. (All my knowledge about Android is "third hand" at best.)

 

I now understand that Android uses the "obb" format much like the PC community uses ZIP files and the Mac community uses "packages" to distribute groups of related files (i.e. "archives"). The TOC under discussion is part of the "obb" package, correct? So my question is: does the "obb" format replace the UPK format as the package for XCom files for the Android/ARM/IoS platform, or is it a "wrapper" around the UPK file package? (The UPK contains individual files used by the game and originally comes on the PC in a compressed "archive" format which is not readily accessible to hex editing. After it is decompressed, the UPK package is still present but the file contents can now be addressed directly with a hex editor.)

 

From your response above, it sounds like the TOC is at least acting in the role of the UPK header, which similarly has the size of each file.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...