tracktwo / xcomsave

46 stars 16 forks source link

Feature Request: Support for Version 22, Saves of XCom 2 (+ War of the Chosen) #21

Closed zipacna closed 3 years ago

zipacna commented 3 years ago

Just wanted to ask, if there are plans/resources to support XCom 2. I Read about some incomplete attempts by someone (I think on Reddit), but that got cut short by their lack of time.

Tried release 1.8.2 and got the message unsupported version 22. Which I am assuming is the save format of War of the Chosen (with all DLCs). As at least the version can be read, so I am assuming some success is there.

This is kinda of closely related to #19 as I am a student with some programming knowledge (Python, C#, Java, GoLang) but no C++ and just the basic understanding of C.

With some pointers (pun intended) I might be able to contribute or even hack together a port to Python or C# (kinda interested in the JSON parsing going on).

tracktwo commented 3 years ago

I started on supporting xcom2 right after it came out, but stopped not due to lack of time but for technical reasons.

The main problem is that the save format is almost, but not entirely, self-describing. For EW it's easy enough to fudge the parts that don't have sufficient info to be able to parse in isolation because very few mods mess with the save file format. The code in make_struct_property and determine_array_property_kind are two examples of this, with certain struct types used in EW hardcoded there. With XCOM2 mod support we can't really accurately guess what info is present in the save file or be able to properly handle arbitrary structs. Unambiguously parsing the save requires processing the game and mod script packages to determine the full format, and that's a pretty big job. Plus since mod support is so built into xcom2 usually the easiest solution for doing something with the XCOM2 save format is to implement it as a mod instead of trying to do it outside the game.

Other than the xcom2 support one of the original plans I had for this library was to be a small, self-contained and portable library that could be used by other applications or other languages, so this should hopefully be pretty usable from python or C# with the right language bindings if you're intersted in adding on. The JSON reading/writing was just a proof-of-concept, I wanted to make a better GUI app or web app to do more user friendly edits to saves but never got around to that, and then xcom2 came out and the demand for EW tools dropped off a whole lot.

zipacna commented 3 years ago

hm, looking into modding XCOM2 is probably no small task either. The original intention of my request was to have an independent tool for checking the save file (due to being stuck on the worldmap). But from what I gathered online the Geoscape/Worldmap seems pretty fragile in that regard. Maybe I should roll back to playing EU/EW instead.

You can close this Issue for now I think, will let you know, if I look deeper into it.