VaultNetwork.netVault Network Boards
Author Topic: Editing Dat Files... Hoping to Skin AC [Locked]
Chainz_TD  1 star
Title: Retired.
Posts: 95
Registered: 2001-12-29 20:25:49
I miss the differant skins, hope you get something worked out.

 

-----signature-----
Carlon
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Here's the deal I'm the best there is. Plain and simple.
I wake up in the morning and I piss excellence. ~ Ricky Bobby
Zenodice  1 star
Posts: 63
Registered: 2004-8-22 19:07:13
I'm gonna work on this a bit and see what I can manage, if anyone wants to compile a list of the various UI coords in ACview that would make things a lot easier for anyone who wants to work on this.


I know graphics start int he 0600000 section.

0600100 - Skill Icons

0600200 - Map & Stat Icons

0600400 - Old Race & M/F Icons


Also, anyone who wants to do this will need ReadDat and WriteDat, both of which are found here: http://vnboards.ign.com/ac_utilities/b5432/98059790/p1/

 

-----signature-----
AC - D3 - GW2 - PS2
ACC Wiki: http://ac.wikkii.net/
Helenisstyck
Title: Loopy the Flame Warrior
Posts: 2
Registered: 2001-6-6 14:28:32

 

-----signature-----
Shiki - Darth Jihad - Vangar the Valorous - Helenisstyck
http://haiku.cc.ehime-u.ac.jp/
Surge_MT  1 star
Posts: 213
Registered: 2001-5-9 11:10:00
I just tested a command-line utility ( http://perso.orange.fr/pierre.g/xnview/en_nconvert.html ) to convert RAW(BGR) images to PNG (or whatever other editable format you prefer), so you don't have to use the IrfanView import for step (3) in my previous post. I am working on a wrapper script to perform the conversion back to RAW, preppend the header/offset, and insert the converted file back into the .dat file.


That leaves the next big task as step (1), reiterated by Zenocide, which is to identify all of the locations of the images in the .dat file. Luckily, this task only needs to be done once to get the "default" set of graphics.


When you navigate the tree in acview, the data is shown in the right hand panel, along with the image properties (color depth, dimensions). Perhaps someone good with C# can modify the source code to acview (it's open source, you can download it from the link in my first post) so instead of displaying the info it can read the whole tree and write the info to a file, or just use the acview export to png and dump the files in one step.


Then we sort the images we want and put them into a repository for the artistically inclined among us to modify.

 

-----signature-----
The scripts/links below don't work anymore...I should really change my signature:
Skill Calculator: http://www.strikefast.net/skillcalc/
Salvage Calculator: http://www.strikefast.net/tinkering/salvaging/
***
09-11-01
Zenodice  1 star
Posts: 63
Registered: 2004-8-22 19:07:13
I'm still stuck on turning the bin file into raw data so I can manage to edit it, could you post how you're extracting the images as a bin and then converting them so you can edit them, then converting back, your other posts left me a bit confused, if you could clarify in a step procedure or what you used to do it that would be swell.


Also are you getting the same thing with ACView where it shows textures in greyscale only and often shows them doubled up? It looks terrible and makes exporting them nearly impossible and hard to discern which textures are what.


Now the good news, i've located the health bar image and a ton of other GUI locs and figure things out a bit.


Anything with a -4120 is an icon file, predominantly things like weapons/armor/spellcomps/spells etc, so when you're looking for the gui or texture images look for the odd ones out that have a different set of digits after the - seperator.


I believe at 06003700 is when the ToD textures start, from there theres a lot of unreadable data.


In any case, here's a few of the GUI locs I managed to find, maybe we should start compiling a list.


-Map-

0600127D-205881 (World Map)

06000261-786456 (Old World Map?)


-Compass-

060011FB-294 (North Icon)

06001938-294 (East Icon)

0600193A-294 (South Icon)

0600193C-294 (West Icon)


-Intro-

0600195C-50724 - 06001979-50724 (Loading Bar-Patching)


~~TOP~~

-Stats-


06001131-1116 (Health Bar Left Side)

06001132-8172 (Health Bar Center)

06001133-864 (Health Bar Right Side)

06001134-1032 (Mana Bar Left Side)

06001135-7836 (Mana Bar Center)

06001136-1200 (Mana Bar Right Side)

06001137-1200 (Stamina Bar Left Side)

06001138-7836 (Stamina Bar Center)

06001139-948 (Stamina Bar Right Side)

06001146-7836 (Empty Bar Left Side)

06001147-1200 (Empty Bar Center)

06001145-948 (Empty Bar Right Side)


-Status Icons-

060016D0-1704 - 060016D1-1704 (Portal Storm)

06001103-1704 (Encumbered Bag Inactive)

0600110F-1704 (Encumbered Bag Yellow)

06001106-1704 (Vitae Inactive)

0600110C-1704 (Vitae Active)

06001111-1704 (Buff Spells Active)

06002629-1704 (Debuff Spells Active)

06002817-1704 (Chess Icon Active)


-Menu Icons-

06001148-2712 (Help Button Active)

0600114A-2712 (Help Button Inactive)

06001932-2376 (Quit Button Inactive)

06001933-2376 (Quit Button Active)


~~MIDDLE~~

-Inventory-

0600121C-2037 (Encumbered Bar Full)

0600121D-2037 (Encumbered Bar Empty)

0600127E-4120 (Inventory Bag)


-Character Attributes-

060002C8-1899 (Strength Attribute Icon)

060002C4-1899 (Endurance Attribute Icon)

060002C6-1899 (Quickness Attribute Icon)

060002C9-1899 (Coordination Attribute Icon)

060002C5-1899 (Focus Attribute Icon)

060002C7-1899 (Self Attribute Icon)


-Character Skills-

06000F90-16944 (Specialized Skills Background)

06000F86-16944 (Trained Skills Background)

06000F98-16944 (Untrained Skills Background)

06000F89-16944 (Unusable Skills Background)

06000F93-16944 (Skills Active)

0600016E-1224 (Arcane Lore Skill Icon)

0600209A-1224 (Armor Tinkering Skill Icon)

0600015D-1224 (Axe Skill Icon)

0600015F-1224 (Bow Skill Icon)

0600209E-1224 (Creature Magic Skill Icon)

06000160-1224 (Crossbow Skill Icon)

0600016A-1224 (Deception Skill Icon)

06000133-1224 (Healing Skill Icon)

0600016B-1224 (Jump Skill Icon)

0600209F-1224 (Life Magic Skill Icon)

0600016D-1224 (Lockpick Skill Icon)

0600016F-1224 (Mace Skill Icon)

0600209C-1224 (Magic Item Tinkering Skill Icon)

06000170-1224 (Mana Conversion Skill Icon)

06000173-1224 (Run Skill Icon)

060035AE-1224 (Salvage Skill Icon)

06000178-1224 (Staff Skill Icon)

0600017B-1224 (Sword Skill Icon)

0600017C-1224 (Thrown Weapons Skill Icon)

06000167-1224 (Unarmed Combat Skill Icon)

0600209D-1224 (War Magic Skill Icon)

0600209B-1224 (Weapon Tinkering Skill Icon)

060012B1-993 (Lower Stat Inactive)

060012B2-993 (Raise Stat Inactive)


-Character Equipment/Inventory-

06000F68-3096 (Necklace Icon)

06000F6A-3096 (Bracelet Icon Left)

06000F5D-3096 (Bracelet Icon Right)

06000F6B-3096 (Ring Icon Left)

06000F5A-3096 (Ring Icon Right)

06000F6E-3096 (Clothing Icon Empty)

06000F5D-3096 (Bracelet Icon Right)

06000F5E-3096 (Missile Ammo Icon)

06000F66-3096 (Weapon Icon)

06000F6C-3096 (Shield Icon)


-Examine-

0600114C-10884 (Examine Bar Left Divider)

0600114D-135024 (Examine Bar Background)

06001126-13602 (Examine Item Background)

0600193E-13602 (Target Health Empty)

0600193F-13602 (Target Health Full)


-Combat-

06001919-2364 (Attack Action Status Empty)

06001923-528 (Attack Speed Slider)

06001920-1944 (Combat Bar Left)

06001921-17880 (Combat Bar Center)

06001922-19224 (Combar Bar Right)

0600191F-891 (Combat Options Inactive)

0600191A-891 (Combat Options Active)


~~BOTTOM~~


-Chat-

06001395-79224 (Chat Bar Extended Inventory Background)

06001396-28824 (Chat Bar Text Input Inactive)

06001397-28824 (Chat Bar Text Input Active)

060012C4-432 (Chat Bar Divider Small)

060012C5-7032 (Chat Bar Divider Big)


-Character Menu-


0600111F-2859 (Allegiance Icon Inactive)

06001121-2859 (Allegiance Icon Active)

06001119-2778 (Spellbook Icon Inactive)

0600111B-2778 (Spellbook Icon Active)

06001122-2778 (Char Stats Icon Inactive)

06001124-2778 (Char Stats Icon Active)

06001116-2778 (Compass Icon Inactive)

06001118-2778 (Compass Icon Active)

0600111C-3183 (Options Icon Inactive)

0600111E-3183 (Options Icon Active)


-Actions Menu-

06001129-2163 (Use Icon Inactive)

0600112A-2163 (Use Icon Active)

06001128-2070 (Examine Icon Inactive)

06001127-2070 (Examine Icon Active)


-Hotbar-


060010F9-3096 (Hotbar # 0)

060010FA-3096 (Hotbar # 1)

060010FB-3096 (Hotbar # 2)

060010FC-3096 (Hotbar # 3)

060010FD-3096 (Hotbar # 4)

060010FE-3096 (Hotbar # 5)

060010FF-3096 (Hotbar # 6)

06001100-3096 (Hotbar # 7)


~MISC~


-Unknown-

0600128A-50844 (GUI?)

0600129C-12312 (GUI?)

0600129D-12312 (GUI?)

0600129E-12312 (GUI?)

 

-----signature-----
AC - D3 - GW2 - PS2
ACC Wiki: http://ac.wikkii.net/
Surge_MT  1 star
Posts: 213
Registered: 2001-5-9 11:10:00
Here's the exact process:


===================

1) Find an image you want to edit using ACView. Let's take the left edge of the health bar, located at 06001131 (the "-1116" is the size, it's not important).


2) When you select this location in ACView, the hex dump appears in the top right frame. Scroll to the bottom to see the details, they will be needed to convert the RAW file to an editable format:

Image Form=6

24 bit BGR Image

Width=13 Height=28 Size=1112 bytes, 370 pixels]


3) Extract the RAW image with the command "readdat -f client_portal.dat 06001131". This will create the file "06001131.bin"


4) Convert the image to png with the nconvert tool I linked to above, using the following syntax: "nconvert -in raw -ctype bgr -size 13x28+24 -out png 06001131.bin" This will generate an editable png graphic file named "06001131.png" (note the 13x28+24 in the command...this is the (Width)x(Height)+(Offset). Width & Height come from the values in step 2, and so far all the images I tested have had an offset (header) of 24 bytes. I don't know if this is consistent or not. If the offset is wrong, the image will look like it was cut in half and put together backwards.


5) Edit the png file and save the new version of the graphic


6) Convert the file back to RAW format using the following command: "nconvert -v -in png -out raw -ctype bgr 06001131.png" This will create a file named "06001131.raw"


7) Using a hex editor, open the "06001131.bin" file and copy the first 24 bytes. Note that 1 byte is 2 hex characters. (i.e. "0A 15 D4" would be 3 bytes)


8) Using a hex editor, open the "06001131.raw" file, and paste the characters copied from step 7 into the start of the file, and save it.


9) Insert the resulting file back into the AC Dat file with the following command: "writedat client_portal.dat -f 06001131=06001131.raw"


===================


Some notes:

A) If you're getting the image info from ACView, it may be easier to ignore steps 2-4 and just click the "save" button to save a png file directly from acview. The problem with that is the filename for the image at the "06001131" location would be "1131.png", and will make it more difficult to re-import at the end. I was hoping someone could modify the ACView source to automate the export with the proper filename so these parts wouldn't need to be done manually. Once you have all the images, you only need to start at step (5).


B) I still haven't found a good utility to automate steps 7 & 8...I'm most comfortable using Perl, but a Perl script wouldn't be very convenient for most people to download and use (it requires extra software installed first). For the whole process to be user-friendly, it has to be like the old skins: download a bunch of graphics and a batch file and it does all the work for you.

 

-----signature-----
The scripts/links below don't work anymore...I should really change my signature:
Skill Calculator: http://www.strikefast.net/skillcalc/
Salvage Calculator: http://www.strikefast.net/tinkering/salvaging/
***
09-11-01
Darktorizo  1 star
Posts: 216
Registered: 2006-12-10 14:00:32
Wonderful Progress Guys!!!!


Quick Question: Can anyone confirm for me, or is it just me... Left Bracelet 06000F6A (Filesize 3096 bytes)Can not be written? When I write a new file to the location it doesn't show up. Instead of an Icon it show a bluish square.


I am very impressed where all this is going, Keep up the good work.

 

-----signature-----
Guinevere du Avalon - Level 275 - Mage (WarMeleeD Spec)2 Hour Buff Bot - TD
~* Explorer of Dereth *~
GoArrow Database Updates (Full): http://db.tt/6UlVIW
GoArrow Database Update Page: http://db.tt/9lJUeE4
Surge_MT  1 star
Posts: 213
Registered: 2001-5-9 11:10:00
I was able to write 06000F6A ok...did you copy the 24-byte header from the original file to the start of the resulting file before importing it? Whenever i forget that step the location gets corrupted.

 

-----signature-----
The scripts/links below don't work anymore...I should really change my signature:
Skill Calculator: http://www.strikefast.net/skillcalc/
Salvage Calculator: http://www.strikefast.net/tinkering/salvaging/
***
09-11-01
Darktorizo  1 star
Posts: 216
Registered: 2006-12-10 14:00:32
I copied the header, and it would randomly come out either 3096 or 3095 bytes, either way, it would come out corrupted. Will check and get back to you.

 

-----signature-----
Guinevere du Avalon - Level 275 - Mage (WarMeleeD Spec)2 Hour Buff Bot - TD
~* Explorer of Dereth *~
GoArrow Database Updates (Full): http://db.tt/6UlVIW
GoArrow Database Update Page: http://db.tt/9lJUeE4
Zenodice  1 star
Posts: 63
Registered: 2004-8-22 19:07:13
Thanks surge, this should help quite a bit, also note that if you download that tool make sure to get the full version of XnView + Nconvert, otherwise you'll end up trying to run that command from the command line and getting an error.


Darktorizo, what are you using to hex edit the raw data? I'd suggest hex workshop as it's free and does the job perfectly, you can grab that here: http://www.bpsoft.com/downloads/


When copying the header from the original using hex workshop you should be seeing something like this: http://img440.imageshack.us/img440/7776/hexworkshopheader3nv.jpg


After that simply open up your .raw file and paste it into the start of the file, HW will usually ask if you want to make a backup then it should work fine, just save and import it back into the dat using surge's steps above.


Also, I'm actually learning and fairly skilled in C# so I will take a look at the ACView source tonight and see what can be done with it, the first thing I'm hoping to do is incorperate some kind of label system so we can properly label and identify the objects in the client_portal.dat file.


As for automating the steps, writing a program that just uses the utility you have here probably wouldnt be that difficult, i'll have to get used to the process myself and see if I can whip up a standalone "patcher".


Skins would require all the raw files and you could simply have a batch file mass insert them with the writedat utility, then of course you could make a quick little interface in VB or C# to have people simply point to the skins folder and it would automatically run the batch and make a backup. In any case, thats getting a little ahead of ourselves but the point is it could be done.


Here's a quick little proof-of-concept I did with the in-game map, its kinda poor resolution because I wanted to keep it small so people could check it out, but basically I added a cross at the 0.0 marks and put my name in the bottom right corner, of course if I make real skins i'll try not to be so arrogant as to put my name on it


http://img412.imageshack.us/img412/341/maphax5ay.jpg

 

-----signature-----
AC - D3 - GW2 - PS2
ACC Wiki: http://ac.wikkii.net/

VaultNetwork.net is an independently operated community forum and is not affiliated with, endorsed by, or technically based on IGN, GameSpy, FilePlanet, GameStats, or the former IGN/GameSpy Vault Network.
References to VaultNetwork.net mean this site/domain. VNBoards-style presentation is a visual homage only. By using this site, you agree to the forum rules.