Dragon Age: Inquisition Modding Tools

All about modding tools for Dragon Age: Inquisition
It is currently Sat Jun 24, 2017 5:16 am

All times are UTC



Welcome
Welcome to the Dragon Age Modding tools forum

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!


Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 94 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Sun Jan 04, 2015 6:10 pm 
Offline

Joined: Sat Dec 13, 2014 1:24 am
Posts: 67
Has thanked: 10 time
Have thanks: 42 time
Yes I noticed as well! I can also confirm that the eyebrow style indeed changes! So, bit shift file until the xml is readable, search for 6E 21 FB 3B, and you can change the values to whatever you like, then shift the file back. Technically, you should be able to traverse the values from the xml and find what you are looking for, at least for the floating point values.

This is what the default, hf preset 4 looks like:
Code:
6E 21 FB 3B
E1 62 81 3F
9A 99 99 3F
00 00 00 00
00 00 00 00

I went to a different save with different eyebrows, used the above values, and the eyebrows changed in game. They don't look exact, (they are really thin) but they indeed changed. This is exciting. I haven't found the face shape stuff yet, but importing/exporting all of this from different saves seems very doable.
ricco19 has been thanked by:


Top
 Profile  
 
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Sun Jan 04, 2015 7:41 pm 
Offline

Joined: Sat Dec 13, 2014 1:24 am
Posts: 67
Has thanked: 10 time
Have thanks: 42 time
Sorry for the spam, but here's another example. Though the values in the xml are the same, the logic of the xml is more human readable and sorted properly.

From face code xml:
Code:
<category name="Makeup">
    <slider type="vec4" usage="Eye Shadow Color" shaderParam="MakeupColorEyesB" affectedComponent="4" x="0.12156" y="0.07449" z="0.00392" w="1.0"/>
--> <slider type="vec4" usage="Eye Shadow Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="1" max="1.0" step="0.1" y="1.0"/>
    <slider type="vec4" usage="Under-Eye Color" shaderParam="MakeupColorEyesA" affectedComponent="4" w="1.0"/>
    <slider type="vec4" usage="Under-Brow Color" shaderParam="MakeupColorUnderbrow" affectedComponent="4" x="0.77253" y="0.70980" z="0.56862" w="1.0"/>
    <slider type="vec4" usage="Under-Brow Intensity" shaderParam="MakeupGlitter_Eye_Lip_Lev_In_ub" affectedComponent="3" max="1.0" step="0.1" w="0.8"/>
    <slider type="vec4" usage="Eyelash Color" shaderParam="LashColor" affectedComponent="4" x="0.01960" y="0.01174" z="0.00392" w="1.0"/>
    <slider type="vec4" usage="Eyeliner Color" shaderParam="MakeupColorEyeliner" affectedComponent="4" y="0.00392" z="0.00392" w="1.0"/>
--> <slider type="vec4" usage="Eyeliner Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="0" max="1.0" step="0.1" x="0.7"/>
    <slider type="vec4" usage="Blush Color" shaderParam="MakeupColorCheeks" affectedComponent="4" w="1.0"/>
--> <slider type="vec4" usage="Blush Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="2" max="1.0" step="0.1" z="0.0"/>
    <slider type="vec4" usage="Lip Color" shaderParam="MakeupColorLips" affectedComponent="4" x="0.13725" y="0.07841" z="0.01960" w="1.0"/>
--> <slider type="vec4" usage="Lip Color Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="3" max="1.0" step="0.1" w="1.0"/>
    <slider type="vec4" usage="Lip Liner Color" shaderParam="MakeupColorLipLiner" affectedComponent="4" x="0.05490" y="0.05882" z="0.03920" w="1.0"/>
    <slider type="vec4" usage="Lip Shine" shaderParam="MakeupGlitter_Eye_Lip_Lev_In_ub" affectedComponent="1" max="1.0" step="0.1" y="0.6"/>
</category>


Now here is what I was editing:
Image

I assume all color/intensity values are stored in 160 bit blocks like this, through enough trial and error we should be able to find almost everything. From there a importer/exporter should be able to be built.
ricco19 has been thanked by:


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Sun Jan 04, 2015 10:06 pm 
Offline
Site Admin

Joined: Fri Dec 05, 2014 3:26 pm
Posts: 635
Has thanked: 921 time
Have thanks: 314 time
Awesome finds!

_________________
ar-lath-ma-vhenan


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 1:30 am 
Offline

Joined: Fri Dec 05, 2014 4:28 am
Posts: 64
Has thanked: 17 time
Have thanks: 41 time
Not making a lot of headway on the code front.
sub_14364316C handles the slider saving - specifically, everything having to do with VectorParameterHandles.
sub_143642D3F handles the overall face saving. I'm playing as Qunari, and the function does have a specific call for horns, so it might be a function only used for Qunari.
sub_143BE1E81 appears to be the entry point for the agent that handles all saving of player face data, likely with a bunch more.

I have no idea how the UsageHash entries are generated. That seems like a better way to go about this, but I wasn't able to find the right way to generate them.

For what it's worth, you appear to be bang on as far as bit length being used. The texture areas are prefaced with 00 00 40 and they're 8 bytes (0x40 bits) long. I wonder what bitstream writing code looks like in ASM?
wogoodes has been thanked by:


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 4:25 am 
Offline
Site Admin
User avatar

Joined: Fri Dec 05, 2014 3:43 am
Posts: 629
Has thanked: 14 time
Have thanks: 751 time
ricco19 wrote:
Sorry for the spam, but here's another example. Though the values in the xml are the same, the logic of the xml is more human readable and sorted properly.

From face code xml:
Code:
<category name="Makeup">
    <slider type="vec4" usage="Eye Shadow Color" shaderParam="MakeupColorEyesB" affectedComponent="4" x="0.12156" y="0.07449" z="0.00392" w="1.0"/>
--> <slider type="vec4" usage="Eye Shadow Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="1" max="1.0" step="0.1" y="1.0"/>
    <slider type="vec4" usage="Under-Eye Color" shaderParam="MakeupColorEyesA" affectedComponent="4" w="1.0"/>
    <slider type="vec4" usage="Under-Brow Color" shaderParam="MakeupColorUnderbrow" affectedComponent="4" x="0.77253" y="0.70980" z="0.56862" w="1.0"/>
    <slider type="vec4" usage="Under-Brow Intensity" shaderParam="MakeupGlitter_Eye_Lip_Lev_In_ub" affectedComponent="3" max="1.0" step="0.1" w="0.8"/>
    <slider type="vec4" usage="Eyelash Color" shaderParam="LashColor" affectedComponent="4" x="0.01960" y="0.01174" z="0.00392" w="1.0"/>
    <slider type="vec4" usage="Eyeliner Color" shaderParam="MakeupColorEyeliner" affectedComponent="4" y="0.00392" z="0.00392" w="1.0"/>
--> <slider type="vec4" usage="Eyeliner Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="0" max="1.0" step="0.1" x="0.7"/>
    <slider type="vec4" usage="Blush Color" shaderParam="MakeupColorCheeks" affectedComponent="4" w="1.0"/>
--> <slider type="vec4" usage="Blush Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="2" max="1.0" step="0.1" z="0.0"/>
    <slider type="vec4" usage="Lip Color" shaderParam="MakeupColorLips" affectedComponent="4" x="0.13725" y="0.07841" z="0.01960" w="1.0"/>
--> <slider type="vec4" usage="Lip Color Intensity" shaderParam="MakeupLevels_EyeSh_Eye_Bls_Lp" affectedComponent="3" max="1.0" step="0.1" w="1.0"/>
    <slider type="vec4" usage="Lip Liner Color" shaderParam="MakeupColorLipLiner" affectedComponent="4" x="0.05490" y="0.05882" z="0.03920" w="1.0"/>
    <slider type="vec4" usage="Lip Shine" shaderParam="MakeupGlitter_Eye_Lip_Lev_In_ub" affectedComponent="1" max="1.0" step="0.1" y="0.6"/>
</category>


Now here is what I was editing:
Image

I assume all color/intensity values are stored in 160 bit blocks like this, through enough trial and error we should be able to find almost everything. From there a importer/exporter should be able to be built.


The handle in the screenshot, is a hash of the shaderParam "MakeupLevels_EyeSh_Eye_Bls_Lp" which if you can see, holds the four params following it, in each of the components (XYZW) and the next handle is a hash of "MakeupGlitter_Eye_Lip_Lev_In_ub" which has the following sliders:

X: Not in List
Y: Lip Shine
Z: Not in List
W: Under-Brow Intensity


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 3:05 pm 
Offline

Joined: Fri Dec 05, 2014 4:28 am
Posts: 64
Has thanked: 17 time
Have thanks: 41 time
It seems clear that some form of the string seen in the XML is used to generate the hash, but I'm not sure exactly how. I'm testing versions of the string against the usual CRC/DJB2/FNV functions, with and without the usual initializers. I am always setting the string to lower-case. My blind guess is that the string needs to be prefaced with something. (edit : there are strings in memory that are prefaced with 'external_' but adding that doesn't result in the correct hash.)

It will probably be easier to work backwards and find the actual usage for each hash, rather than generate the hash. Create a character with every slider changed and then check the code.


Save game bitshift happens at DAI.exe+142FBE6F9 - that's in sub_142FBE5BD. The bitshift can be up to 31 bits, and the amount seems to be created by a rotating key of some kind, of which the lowest five bits is taken off to generate the next amount to shift. The horrible part is that the shift can change after only 24 bytes or so! In these areas, the shifting is constantly changing, and probably cannot be handled manually.

The rotation happens at the following locations : DAI.exe+142FC2654 and DAI.exe+142FB8F2D. The rotating key is held in the register pointer+0C locations you'll see there - [rcx+0c] and [rdi+0c]. I do not know what initially seeds the location.
wogoodes has been thanked by:


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 6:19 pm 
Offline
Site Admin

Joined: Fri Dec 05, 2014 12:05 pm
Posts: 179
Has thanked: 35 time
Have thanks: 212 time
I sooooo wish I could run DAI and debug it with a kernel debugger like ollydbg, but nooope.... and ida pro 6.5 with 64bit decompiler hasnt leaked yet either, so no offline research either... damn^^ but at least you guys can have the fun :P

greetz WV

_________________
Always backup your files!


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 8:33 pm 
Offline

Joined: Fri Dec 05, 2014 4:28 am
Posts: 64
Has thanked: 17 time
Have thanks: 41 time
I believe the amount of bitshift is related to the position of the stream in the FB SAVE block.

At the beginning, the FB SAVE header is written, and that takes 64 bytes. The position at the start is zero, so the data shifted with the lowest five bits of zero, which is zero. Following that, one blank byte is written, and then the next chunk starts at position 65 (0x41). The lowest five bits of this is 0x01, and so the next chunk is shifted one byte, which appears to be the same for the five save games I've checked.

Edit : Uranix, the bytes following FB SAVE may be time of save. I'm just going by the strings that I'm seeing when the data is written to memory.
wogoodes has been thanked by:


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 9:00 pm 
Offline
Site Admin
User avatar

Joined: Fri Dec 05, 2014 3:43 am
Posts: 629
Has thanked: 14 time
Have thanks: 751 time
wogoodes wrote:
It seems clear that some form of the string seen in the XML is used to generate the hash, but I'm not sure exactly how. I'm testing versions of the string against the usual CRC/DJB2/FNV functions, with and without the usual initializers. I am always setting the string to lower-case. My blind guess is that the string needs to be prefaced with something. (edit : there are strings in memory that are prefaced with 'external_' but adding that doesn't result in the correct hash.)


The hashes in my post above were just the shaderParam in lowercase generated using FNV. Which is what all the hashing in EBX files are done with.


Top
 Profile  
 
 Post subject: Re: FBCHUNKS files (ProfileOptions and save games)
PostPosted: Mon Jan 05, 2015 9:49 pm 
Offline

Joined: Sat Dec 13, 2014 1:24 am
Posts: 67
Has thanked: 10 time
Have thanks: 42 time
[quote="ricco19"]I'm waiting for the time I log in and my characters head is missing or looks like an alien.


Well, ****...

Spoiler:
Image


I guess more than the face mesh can be modified. Yes, the game is stable and playable like that. And yes, it is terrifying.
ricco19 has been thanked by:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 94 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred