Jump to content

Beyond DefaultGameCore.ini - Analyzing the Game Scripts


Beknatok

Recommended Posts

A few days ago, Dreadylein posted script code in the "Next Steps" thread, showing how PSI GIft is calculated. I asked him how he got into it and he was gracious enough to point me in the right direction yesterday.

 

Since that information is not widely known yet, I thought I'd start a new thread to focus research into digging through the game scripts and analysis of the mechanics.

 

The two files of interest are XComGame.upk & XComStrategyGame.upk. The former dictates the "tactical game" whereas the latter dictates the "strategic game."

 

Use Gildor's Decompress tool to unpack the UPK. Then go find UE Explorer. You can use that to peruse the contents of the UPK.

 

There's a LOT to dig through. If you do not have a programming background, you may be overwhelmed at what you find. You've been warned.

 

 

For the uninitiated, go to the Objects tab. From there, you'll have to find Classes related to what you are interested in.

 

 

Let's dive deeper into the PSI example. PSI gifting is controlled via the PSI labs. This is part of the strategic layer of the game, so we want to open XComStrategyGame.upk for analysis. There's a class called XGFacility_PsiLabs. Looking into that class, we see a number of Functions that help us find out exactly how the construct works. You can also deduce references to other classes. For example, XGStrategySoldier is the class utilized for soldiers, which is referenced repeatedly here.

 

Other things of interest include references like this:

 

class'XGTacticalGameCore'.default.PSI_GIFT_CHANCE

 

Look familiar? It's a reference to the variable PSI_GIFT_CHANCE which is located in DefaultGameCore.ini (now embedded inside XComGame.ini).

 

For another example, jump over to XGFundingCouncil. Here, you'll see a number of constants that have been hardcoded. You'll see functions on how council missions are generated, maintained, etc.

 

 

So have at it, take a look, and let's see what other interesting things people uncover.

 

(There's a buried cheat/debug manager... if we can override the IsRetailGame() check, whereever that's controlled.)

 

UPDATE:

 

To help the uninitiated, here's a link to Unreal's UnrealScript documentation:

 

http://udn.epicgames.com/Three/UnrealScriptReference.html

Edited by Beknatok
Link to comment
Share on other sites

  • Replies 102
  • Created
  • Last Reply

Top Posters In This Topic

rather a lot to take in in one go...

 

the UE Explorer lets me get the names of the constituent ogg files (sounds, voices).... but as i thought previously, without access to changing the object reference i cant substitute one set of voices for another ;-(

 

still, ALL the other stuff to look through now ;-)

Link to comment
Share on other sites

Dont be lazy ! :D

 

After some thinking about, i decided what way i try first.

As proper Decompressing, Decompiling and Recooking is just too much reversing to lead to a result in a okish timeframe i guess our best bet is altering the upks after they are loaded into memory

First Step should be finding out if the decompress them on the fly or if they just decompress on the loading of the files

Link to comment
Share on other sites

First thing i checked, dont think steam would cry :D the other mods already mess around with the memory, even if they modified the data before the binarie was startet, as there is no anti cheat like vac in place i dont think they check the upks against hashs, at least i dont see a cause for this
Link to comment
Share on other sites

Has anyone actually determined what is the exact process flow, when the game is started up?

 

Ex:

 

Consume all Engine\Config\*.ini files

Consume all XComGame\Config\*.ini files

Consume all DLC\Config\*.ini files

 

I would suspect that from studying the Unreal Engine, we should be able to get an answer to that. Once we've determined that, then we can find an appropriate "step" to intercede and inject our own "mods."

 

Arguably, DLC could be considered a "mod." Perhaps piggybacking on the load DLC step, would give us the in that we need to inject our own code.

 

Thoughts?

Link to comment
Share on other sites

Would get you into the same problem as before :) If i remember correct the dlc manager awaits dlcs as cooked upks

 

For your other question, mess around with the files and start the game with -log flag, think i saw the loadings there

 

@daemonjax

another realy strong point for this aproch is .. if we try it another way we would every time rely on heavy modding of the binary himself, dont know how far the devs would let us go without complaining.

Edited by dreadylein
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...