Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

elements.data header

Newbie Spellweaver
Joined
Mar 20, 2021
Messages
47
Reaction score
4
Everyone seems to use some version or other of the same sELedit tool to edit elements.data. I get how the config files work, defining the structure of the file depending on the version of PW being ran... except the 8 bytes at the start.

e.g. looking at my elements.data from 1.5.5 (from 343's release), it starts with:

9C 00 00 30 9E AF F8 58 B0 0B

Now that B0 0B is the nbr of items in list #1 (EQUIPMENT_ADDON has 2992 items), and the rest of the data follows as per the config file.

The 9C I am guessing is the version number since this corresponds to the 156 in the config file name (PW_1.5.5_v156.cfg).

Which leaves those 5 pesky bypes in the middle (bolded) which I have no clue what they are for. Does anyone have any info? Many thanks.
 
Newbie Spellweaver
Joined
Feb 26, 2013
Messages
62
Reaction score
88
first 4 bytes are the version number. 9C 00 00 30 seledit just ignores the 30 byte but the official version number is 0x3000009C
second 4 bytes is a time stamp. 9E AF F8 58. Its supposed to be the timestamp of when the file was saved.
 
Upvote 0
Joined
Jul 26, 2011
Messages
2,030
Reaction score
396
first 4 bytes are the version number. 9C 00 00 30 seledit just ignores the 30 byte but the official version number is 0x3000009C
second 4 bytes is a time stamp. 9E AF F8 58. Its supposed to be the timestamp of when the file was saved.

there's another section after these sections, that has comments. I have seen it in some of the elements files. but the exact versions I can not remember
 
Upvote 0
Newbie Spellweaver
Joined
Mar 20, 2021
Messages
47
Reaction score
4
Figured out some more info. In the CFG file on exactly 3 of the lists, there's this value:

001 - EQUIPMENT_ADDON
4

021 - SKILLTOME_SUB_TYPE
AUTO

101 - NPC_WAR_TOWERBUILD_SERVICE
AUTO

So the 4 bytes (9E AF F8 58) are some data before the EQUIPMENT_ADDON list, and the other 2 lists have similar longer data. sELedit displays it in a box called "offset". This - - makes it look like its just some weird static data that's fixed for a particular elements.data version.

The "rules" files with sELedit replace the 3 "offsets" with diff values, but that's only when converting one format elements.data to another, so it doesn't have documented what the offsets for every supported version are.

So what's this data for? Why's it called an "offset" (normally nbr of bytes from start of file)? How can you predict how many bytes long it will be when the CFG just says "AUTO" (only the first one says "4")? Do we just ignore it and retain the existing values? I am just worried its some kind of checksum/hash that has to be updated if you edit any of the other data in the file.
 
Upvote 0
Newbie Spellweaver
Joined
Mar 20, 2021
Messages
47
Reaction score
4
Got to work what I was trying to do :) While sELedit works fine, you're modifying a binary file. Searching in it isn't great. You start to make many changes, you have no idea what you've changed and what you haven't and no way to track or compare one version to the next. So what I was trying to do was convert the whole of elements.data into XML so I could check the thing into git, then I could make progressive edits to it and see tracked changes from one version to the next, and wind back a version if any problems.

Fun part to this is the XML ended up being 325 MB and 7.6 million lines long. Notepad++ loads in the first section of it but then is very slow if you try to search for something near the end of the file, but once its got the whole thing loaded in its not too bad. git itself seems to manage fine. Takes maybe 20 seconds to diff the thing vs the previous version and see how many lines you modified but it works and can show you what lines changes and such.

Renamed about 500+ items, rebuilt the elements.data from the XML and deployed it to 1.5.5 server+client and both working well :)

I still don't get what the stupid offsets are, I just record the binary data in the XML at the appropriate place and re-save it back out as-is... like

Code:
    <armorruneEssence armorruneEssenceID="47234">
        <idSubType>406</idSubType>
        <name>Lost Incantation Amulet</name>
        <fileMatter>Models\Matters\物品\优化符掉落\优化符掉落.ecm</fileMatter>
        <fileIcon>Surfaces\图标\物品\召神符.dds</fileIcon>
        <fileGfx></fileGfx>
        <fileSfx></fileSfx>
        <damageType>1</damageType>
        <price>1</price>
        <shopPrice>1</shopPrice>
        <requirePlayerLevelMin>90</requirePlayerLevelMin>
        <requirePlayerLevelMax>105</requirePlayerLevelMax>
        <damageReducePercent>0.67</damageReducePercent>
        <damageReduceTime>2</damageReduceTime>
        <pileNumMax>9999</pileNumMax>
        <hasGuid>0</hasGuid>
        <procType>16403</procType>
    </armorruneEssence>
    <offset2>DD8976AB07000000FB21C0F0FB35B88293F858</offset2>
    <skilltomeSubType skilltomeSubTypeID="401">
        <name>Blade.</name>
    </skilltomeSubType>
 
Upvote 0
Back
Top