Author Topic: decompiling game scripts  (Read 2298 times)

Twiglard

  • Guest
decompiling game scripts
« on: April 16, 2018, 02:00:06 am »
Hey,
I need to verify and add some stuff for the wiki. How do you guys decompile dialogs and scripts properly? I only did it the brute force method (strings Unix utility).

Twiglard

  • Guest
Re: decompiling game scripts
« Reply #1 on: April 16, 2018, 12:12:35 pm »
.NET isn't a problem. After deserializing file types such as dialogs or computer interactions, are field types known? Are they named in the serialization metadata? If this goes well, I can make a dialogue-tree recovery program, allowing for displaying the dialog and script stuff in a human-friendly format. This is simple stuff providing I can parse the data.

I'm in particular interested in verifying the Faceless DC reputation thing. Given the reputation change occasions are placed all over the game, it's replaying everything since around Rail Crossing quests. There are 2^N permutations where N is the amount of interactions with the Faceless.

Then the exact friendliness threshold from the counter isn't known, making replaying the permutations even harder. As you know the sources differ.

Should I message PhrygianDominant right away or is there more existing info you can share?

And thanks.

Edit: Wow, the spec has class metadata and all. For Dotfuscator usage it's tedious but doable. Less tedious than modifying Dalvik code and that's not even hard. Been there, done that.
« Last Edit: April 16, 2018, 12:20:56 pm by sthalik »

Twiglard

  • Guest
Re: decompiling game scripts
« Reply #2 on: April 17, 2018, 12:40:54 am »
Wow, the output on the debug channel is pretty amazing. Global property changed: "npc_tanner_met" = 'true'. I don't see property reads but it's helpful. It's good that Styg added much output on the debug channel.

Edit: Actually the JSON output from udlg makes some sense. I got it not to crash at runtime with json output.

Ideally I'd like to extract and analyze the exact script logic (like people did for Fallout 2), sort of out of principle. Of course the ABI can change at any time but still, having an understanding without depending on the dev team is the ideal scenario.
« Last Edit: April 17, 2018, 02:05:40 am by sthalik »

Twiglard

  • Guest
Re: decompiling game scripts
« Reply #3 on: April 18, 2018, 04:15:18 am »
The .json dumps have visible logic to them, e.g. the "id-ref" member works as a jump to another entry but I'm not sure of the exact semantics.

The actual Faceless attitude calculation doesn't seem to be included anywhere in the .udlg files. I saw that variables set at Foundry or RC quests aren't used anywhere else in any other .udlg file.

FWIW, I fixed udlg json dumps in my fork, see https://github.com/sthalik/udlg I don't like the existing tool's architecture and overall code verbosity. But then it gives pretty good output with the few fixes.