TES5Edit / TES5Edit

xEdit by Elminster; Updated and maintained by Sharlikran, Zilav, and Hlp
Mozilla Public License 2.0
753 stars 141 forks source link

FO4Edit : Phase one : Rough Decoding #206

Closed Sharlikran closed 8 years ago

Sharlikran commented 8 years ago

Records in the list below that are checked indicate the record has a rough draft. It does not mean that the record fully decoded.The last phase of course is to use the GECK to further refine the decoding.

The last time records were decoded for Skyrim we fleshed out a rough draft for all of the records just to get them to dump the information without errors or unknown subrecords. Fields should be marked with Unknown at first and then later updated as know values are discovered.

Remember using the command line parameter -more will cause FO4Dump to output suggestions for fields marked with unknown with byte offsets. If you use it to discover a specific value or look for FormIDs Make sure to use -dg and specify the top group you are working on. Use it sparingly because although the information is helpful there is a lot of extra data dumped to the text file.

All new subrecords should be commented with { New to Fallout 4 } in the const section at the beginning of wbDefinitionsFO4.pas.

fireundubh commented 8 years ago

I figured out the structure of the PRPS element.

  wbPRPS := wbArrayS(PRPS, 'Properties', wbStruct('Property', [
    wbFormIDCk('Attribute', [AVIF]),
    wbFloat('Value')
  ]));

I don't know how to use wbEnum, but here's a (probably) complete list of actor values that can be used to resolve the "possibly hardcoded" AVIF references.

zilav commented 8 years ago

Updated, thanks. Interesting, PRPS contained in a lot of other mainrecords but trying to substitute with FormID doesn't always work, at least when I tried on ACTI and CONT. Looks like it's meaning depends on the record type. Keep decodings coming :)

zilav commented 8 years ago

For "hardcoded " forms you need to create .dat file (renamed esp plugin without masters) with them. Usually it is created by checking records in official editor without any plugins loaded, but for now we could only guess. So try with the your own forged .dat file, if it works then please share to be included with FO4Edit.

fireundubh commented 8 years ago

trying to substitute with FormID doesn't always work, at least when I tried on ACTI and CONT.

It works on ACTI and CONT as well.

I checked all of the record types in the ESM that have the PRPS element.

So try with the your own forged .dat file, if it works then please share to be included with FO4Edit.

Here's a screenshot of a CONT record with an AVIF property resolved with a .dat file.

container_properties_and_dat

Here's the .dat file with most, if not all, AVIF records not included in the ESM. (Just Form IDs and EDIDs.)

Download via MediaFire

zilav commented 8 years ago

Thanks! Working fine now, I replace wbPRPS definition for all records that have properties. By the way we are working on this branch currently sharlikran-fo4dump

elezraita commented 8 years ago

I'm not sure what to do with this information except give it you. It looks like I found a couple of record types not listed here under COBJ. The first is FNAM, seems to be the keyword that determines which category the recipe falls under in the crafting menu. For instance an FNAM value of 'RecipeDrug "DRUG" [KYWD:0010215A]' will make the recipe appear in the submenu "DRUG". The second is INTV, which seems to be the hex number of objects created by the recipe. I found that a value of 14 00 00 00 makes 20 of the object at a time in game, and 19 00 00 00 makes 25. Obviously, most (if not all) of the vanilla recipes have INTV of 01 00 00 00. Looking in TES5Edit, it looks like INTV was NAM1 in Skyrim, and I suspect that the number is hex in FO4Edit only because INTV is still unknown.

zilav commented 8 years ago

INTV has some non zero data in the last 2 bytes so I defined only first two and count. As for FNAM, it can contain several KYWD references. I'll rename it as Category for now until GECK is out.

Dominus-Sicarum commented 8 years ago

Don't know if this is right place to post it, but... FNAM field in PERK entries is responsible for swf animations displayed in the ui for that perk. fnamperk

BMASTER91 commented 8 years ago

Hey guys, I found the fire rate. It's possible, that it's the same place like every other weapon. There is a multiplier and a decimal number. Second is calculated like this 1/(10*"your wished fire rate")=decimal number to put in. Or you can put in 1 and use the multiplier instead. Otherwise I think it's best to use a multiplier of 1. The first marked is the multiplier. fo4 edit fire rate

zilav commented 8 years ago

Minigun, laser masket and a lot of other weapons have 0.0 as the second value (decimal), so I'm not sure about that. Maybe the first value is base RoF, and the second is multiplier of not zero. Check this please.

BMASTER91 commented 8 years ago

@zilav You're right. I just tested that. Though only with the minigun. Since I'm currently searching through the 10mm parameter.

I still don't know how to search for all those files for an object/weapon/item. If I use Ctrl+F and search for 10mm at best, it finds just the weapon. Any help with that?

zilav commented 8 years ago

Wait for official editor :) Trying to decode binary data now is a waste of time imho, just play the game and enjoy.

capmac commented 8 years ago

Some infos on the NPC_ record MWGT: the three values are for the body specs: Thin/Muscular/Large, 0 to 1

MSDK and MSDV: Facial features types and values like Ears, Mouth, Eyes, Nose Example Nose type Roman 2, 50% 4 bytes for the type (MSDV) and 4 bytes for the value (MSDK). At the same position.

The FMRI and FMRS records are facial dimensions. FMRI identifies a facial area like jaws or chin.

The TETI and TEND records contain the extras. Makeup, markings, blemishes, damage and interestingly the eyebrows too. TETI identifies the specific feature. Example Eye Shadow 3 with color 05

Wrote a short program to parse a savegame export to compile the records in the right format for pasting them back into FO4Edit

See result here ;) https://youtu.be/ZD4TngGDrhk

zilav commented 8 years ago

Thanks, looking good in video :) But if you can't provide enumeration values/types/flags/whatever for all those types to define in FO4Edit to display instead of hex values, that information is of no use.

capmac commented 8 years ago

No, I mostly just copied them. The extras I had to decode partially. Not complete by far. But it might help

02 00 DF 04 Eyebrows Thin Arched 02 00 D7 04 Eyebrows Average 02 00 D9 06 Sun Scorched 02 00 DA 06 Red Nose 01 00 90 04 Skin color 64 D6 C5 C0 00 89 04 Burned 01 00 2A 07 Blush 3 01 00 28 05 Lipstick 00 FF FF FF FF FF FF None 01 00 46 07 Eye Liner Waterline 01 00 56 07 Eyeliner 1 01 00 E2 06 Eyeliner 2 01 00 43 07 Eyeliner 3 01 00 44 07 Eyeliner 6 01 00 57 07 Eye Liner Lower 1 01 00 00 07 Eye Shadow 3 01 00 B6 06 Lip Color

badilator commented 8 years ago

I'm new, sorry if I do something wrong. I've found the BSMS fields at the end of a RACE record (the ones after each skeleton node name) are 3 floats for each of the 3 body profiles, a total of 9 floats. I do not know if is normal, they are written right to left and are the scale values of the nodes: for instance in humanrace LBreast_skin : thin x 00 00 80 3F = 0x3F800000 = 1 y 07 22 21 3F z 69 6D 37 3F muscolar x 00 00 80 3F y C5 FB 42 3F z 90 65 23 3F fat x 00 00 80 3F y C7 F4 63 3F z EC A7 A7 3F

you can see the effects here, some nudity: http://www.nexusmods.com/fallout4/mods/3945/

vagar commented 8 years ago

Hey, while trying to edit an OMOD entry, I figured out what some of the unknown data seems to mean. I hope you can implement those for easy editing.

I'll just leave my notes in the 'mod_HuntingRifle_Receiver_MoreDamage3_AmmoConversion' (.50Cal Receiver) here: http://pastebin.com/VGFctKPq

zilav commented 8 years ago

@capmac I would need a complete list of possible, because as soon as I define those values as enumeration, all unknown ones will be displayed as integer instead of hex bytes, and that would be even worse I think. @badilator thx, updated @vagar Do you mean DATA subrecord in OMOD? It is already fully decoded in the latest version.

Sharlikran commented 8 years ago

@capmac I have a compiled version of FO4Dump if you want to try it and see if you can come up with a list. You know what you have discovered better then us at this point. What Zilav means by enumeration is to add a string to a decimal value.

enum

  wbSoundLevelEnum := wbEnum([
     'Loud',
     'Normal',
     'Silent',
     'Very Loud'
    ]);

Something like that. In TES5Edit you would get the kind of menu I am showing in the screen shot. The screen shot is pretty small but see how I have the values turned on? It starts with 0 for Loud, 1 for Normal and so on.

However, if you don't think it's a single decimal value and that it isn't going to be a drop down menu then just clarify what you think it might be. For example, if you feel that Thin, Muscular, and Large are values between 0 and 255 then clarify the location in the subrecord that the values are found.

Sharlikran commented 8 years ago

@elezraita @Dominus-Sicarum @BMASTER91 @badilator @vagar

I have a compiled version of FO4Dump if you want to try it.

The best thing I can suggest is to place the exe in your data folder. Open FO4Edit and make a copy of one record. For example WEAP - Weapon and call the file Test_WEAP.esp or something like that. Make a Batch (.bat) file in the data folder and add a command line that looks something like this.

FO4Dump "Test_WEAP.esp" > "FO4Dump.txt" 2> "FO4Dump_CON.txt"

That will produce two files. FO4Dump.txt will be the plugin's information. FO4Dump_CON.txt will contain what is normally shown in the console. Any errors will be in the CON file but you probably won't see any for now since we are done with the rough drafts. The only file you need to really look at is FO4Dump.txt.

FO4Dump -more "Test_WEAP.esp" > "FO4Dump.txt" 2> "FO4Dump_CON.txt"

To expand the amount of information shown for the unknown fields in your test file add the parameter -more. You will get attempts at the values with byte offsets that looks something like this.

            Offset 0 AsU32
              AsU32 #0: 3
              AsU32 #1: 0
              AsU32 #2: 0
              AsU32 #3: 131071
              AsU32 #4: 491978752
              AsU32 #5: 18
              AsU32 #6: 411698433
              AsU32 #7: 16777216
              AsU32 #8: 324125
              AsU32 #9: <Error: Expected 4 bytes of data, found 3>

Then if you are looking for the value 3 or 18 you will have somewhere to start.

FO4Dump -dg:WEAP "Fallout4.esm" > "FO4Dump_WEAP.txt" 2> "FO4Dump_CON_WEAP.txt"

If you want to dump all of the WEAP records from Fallout4.esm I recommend that. Adding the record to the file name of the text files lets you have a separate file for each Top Group you want to look at.

Sharlikran commented 8 years ago

@fireundubh Do have a copy of the Embarcadero Free Trial? It won't compile xEdit but you could use it to compile FO4Dump. Since you have made scripts you don't really need to be shown how the syntax works that much. That might compile FO4Dump but I have not tried it. The reason it might not is because our source code is mostly for XE, and XE3 but I think they are on XE10 or so. The compiler might not compile it and say there is a depreciated function or something. You can try it if you want though.

capmac commented 8 years ago

Ok guys. Lets start with the simple one first. MWGT. You already decoded the value types correctly. Floats. It seems though that only the last 4 digits are set. Example 0.333300

So in the NPC_ record MWGT - Body Thin 0.000000 to 1.000000 Muscular 0.000000 to 1.000000 Large 0.000000 to 1.000000

However there is a check you need to apply. The sum of the above three values has to be 1. It doesn't break the game if its not. But the the selection won't be in the "triangle" (character creation).

I'll look into what FO4Dump does. Thanks...

zilav commented 8 years ago

xEdit doesn't perform such kind of checks. It is possible, but we rely on users to know what they are editing and how. Please open new issues of you have updates, this one is getting too long.

Sharlikran commented 8 years ago

xEdit doesn't perform such kind of checks. It is possible, but we rely on users to know what they are editing and how.

I can see the possible need to have a check for that though. You are right normally we don't do that but for Fallout 4 we may need to make a few exceptions based on what it is.

Sharlikran commented 8 years ago

@elezraita @Dominus-Sicarum @BMASTER91 @capmac @badilator @vagar

I guess it would be a good idea to open a new ticket for the record you are talking about. If you want to provide feedback for NPC just make a ticket for it. Call it Decoding NPC or whatever.

zilav commented 8 years ago

Almost everything has been decoded, the rest will be updated in later versions.