Author Topic: dat file writing
kgober 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
so, I finally got around to finishing the code to support dat file writing.

1. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/WriteDat/bin/ and download WriteDat.exe
2. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/ReadDat/bin/ and download ReadDat.exe
3. go to http://acdev.cvs.sourceforge.net/acdev/AC.Utility/bin/ and download AC.Utility.dll
4. go to http://acdev.cvs.sourceforge.net/acdev/AC.DatFile/bin/ and download AC.DatFile.dll
5. put all four of those files in the same directory (it's ok for you to put them in your AC folder, or you can put them elsewhere, but I don't recommend that you put them on a network share unless you know how to set up .NET security policies / trusts / zones)
5. MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON! (e.g. client_portal.dat)
6. use ReadDat.exe to extract a file from the datfile (e.g. ReadDat -f client_portal.dat 0e00000e)
7. edit the file using your editor of choice
8. IF YOU DIDN'T MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON, DO IT NOW!
9. use WriteDat.exe to write the changed file back to the datfile (e.g. WriteDat client_portal.dat -f 0e00000e=newfile.bin)

yes, this procedure is cumbersome. no, I do not plan to do anything about it anytime soon.

-ken

p.s. these utilities require the .NET Framework v1.1. not v2.0, which is what Decal currently requires. but that's ok, you can put both 1.1 and 2.0 on the same computer (I have both on mine). if you don't have the 1.1 framework for whatever reason, get it and install it.

 

-----signature-----
Link to this post
Sucamarto 
Posts: 20,839
Registered: May 15, '01
Extended Info (if available)
Real Post Cnt: 20,746
User ID: 96,777
Subject: dat file writing
Skins here we come

 

-----signature-----
Sucamarto's AC Heaven - http://acheaven.buwahaha.com
Sucamarto - (275) Bunny Master
Panumbriis Shadow - (275) - Sword,Cook,Alch,Tinker
Allegiance - Tasia the True
"May the seed of your loin be fruitfull in the belly of your woman" Neil
Link to this post
Lord_Anton 
Title: Wu Fez 4 Life!
Posts: 12,530
Registered: Aug 27, '04
Extended Info (if available)
Real Post Cnt: 12,191
User ID: 960,835
Subject: dat file writing
awesome.

 

-----signature-----
They can't deport us all
http://www.btnhboard.com/
Where's Waldorian?
Link to this post
kgober 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
take note, i have no idea what bmpswap used to do (specifically i don't know how it handled the fileid that's prepended onto the beginning of every file in portal.dat) but readdat and writedat do not make any special effort to add or remove this fileid. so if you have old tools that expect it to be gone, or automatically added it when writing a file, don't be surprised when readdat/writedat don't do dat.

oh, one more thing: when replacing a file, the new file does not have to be the same size as the old one. by size I mean the file size measured in bytes. also, you can write new files that didn't previously exist -- you are not limited to only using pre-existing file ids. but be warned: there is currently no way to *delete* new files once you've written them. the only way to get rid of them is to go back to using a backup copy of a datfile from before you added these new files.

-ken

 

-----signature-----
Link to this post
sui101 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
In theory would this work for extracting the 10-12mb world map of Dereth? I'm currently using a converter that changes the new client_cell_1.dat file to the old school (pre-tod) Cell.dat file structure system so I can extract the map with older (pre-tod) programs. I would love it happy

 

-----signature-----
Link to this post
Drakier 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
in theory, if you knew how the reading of the dat worked for creating the map, then yes... you should be able to use these dat tools to read ANY file from ANY dat (ac tod format)... converting it to the proper data though might be a different thing however..

for example.. spelltable data is encoded AND stored in the dat file.. so it's not as simple as just extracting the data to get a working spelltable.. you have to alter the data AFTERWARD.. I believe the BMPs in the dat file are the same.. you have to go beyond just extracting the binary data, and convert it to the proper format for the BMP (or WAV for sound).

 

-----signature-----
Link to this post
kgober 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
if the world map were contained in a single file within cell.dat, then yes, this tool would work.

however, the world map is (as far as i know) constructed by reading many smaller files, and putting all the data together. this tool will take care of the reading of those smaller files, but it doesn't know how to put all the individual landblock files together to make a single complete map.

so, you still need those older (pre-tod) programs in order to do the second part. and, because those older programs only work with the old cell.dat file structure, you still have to use CellConverter.exe. if you want to use CellConverter.exe with the newer AC.Utility.dll and AC.DatFile.dll, i've recompiled a new version of that as well, which you can also find on SourceForge (just browse to it, CellConverter is found in the same place as ReadDat and WriteDat).

-ken

 

-----signature-----
Link to this post
sui101 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Well I was hoping for an easier answer, but aren't we all hoping for those, LoL!!

Thanks for the sweet stuff though anyhow Kgober, as was said, this'll definately open some doors for people happy

 

-----signature-----
Link to this post
Harbinger67 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Heh, I can't get it to do anything. Mostly because I'm an idiot though.

So, I click the readdat thing and it brings up a dos window thing, then it goes away. Awesome. What am I not doing right?

 

-----signature-----
Link to this post
kgober 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
all of the "DatUtils" are command-line tools. first open a Command Prompt window, then cd to the directory containing ReadDat or WriteDat, then run the commands from there.

-ken

 

-----signature-----
Link to this post
Harbinger67 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Awesome, thanks. I've had a skin idea in mind for a while now.

 

-----signature-----
Link to this post
Xp.Passup.System 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Yay skins! Be nice to add some more spice to ac!

 

-----signature-----
Link to this post
servian 
Posts: 181
Registered: Oct 7, '05
Extended Info (if available)
Real Post Cnt: 180
User ID: 1,083,004
Subject: dat file writing
doesn't dereth explorer "update maps" button give you latest map with all green landblocks that were changed? Seems like it does it for me.

 

-----signature-----
(none)
Link to this post
sui101 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Dereth Explorer does have an update map feature yes, but it only updates the map as Gawa (the dev of DE) updates his map on his server. The update feature contacts his server for the maps. I like being able to pull them myself as then I can complete the map and not have any green spaces as long as I continue to explore all the green areas. Green areas are places you've never been, or places that have been updated since the patch.

 

-----signature-----
Link to this post
kgober 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
update!

i've fixed some bugs in the dat writing code which prevented new files from being written properly in certain difficult-to-explain situations (the bug would be triggered if your new file ended up in certain specific places in the btree directory structure). also, i've added support for file deletion. also also, I've added a few more comments in some of the more difficult-to-follow parts of the source code, for those who have any interest in looking at the source.

I have not, however, gotten around to packaging all the datutils into a single zip file. so, you will have to download all the files individually again (except for AC.Utility.dll, which didn't change).

I STRONGLY RECOMMEND YOU RE-DOWNLOAD THE FILES IF YOU ARE USING WRITEDAT.EXE !!!

-ken

 

-----signature-----
Link to this post
servian 
Posts: 181
Registered: Oct 7, '05
Extended Info (if available)
Real Post Cnt: 180
User ID: 1,083,004
Subject: dat file writing
there an update map feature that scans your client_cell_1.dat file and creates map of all landblocks you havent visited or that were changed in last update.

The Default map is one that is downloaded, the standard map is the one that is gotten from doing the scan of your cell dat.

There more then 1 map that can be displayed in dereth explorer.

 

-----signature-----
(none)
Link to this post
sui101 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Is there a utility for extracting updated maps for Dereth Explorer? http://vnboards.ign.com/ac_utilities/b5432/98046357/p1/

You posted the exact same thing on that thread Servian, however, if you go back and look at it now, you'll see that Gawa_Ibn_Edwas the creator of Dereth Explorer posted right after you, telling us all he needed to get the updated map himself, so we could download from his server, the updated map. Now this isn't the only thing these Dat Utilities are used for, so lets give some other people a chance to post about other features happy

 

-----signature-----
Link to this post
Gawa_Ibn_Edwas 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
To avoid confusion: Dereth Explorer has four maps: Default, Standard, Height and Black & White.
Only the default map comes with the update function, the other three maps can/must be updated with the 'map extraction' function in Dereth Explorer. It scans your cell file, extracts the landblock data and uses this to generate the maps. It is not possible to download the other three maps with the updater, you must update them yourself.

The difference between Default and Standard map is that the default map has a different color setting and removes any ugly spots (unused portions of land mass) from the map. For details on how to switch maps in DE, go to http://www.direlands.net/derethexplorer/documentation/ and click on 'Map options toolstrip'.

 

-----signature-----
Link to this post
Chazcon 
Title: FOR THE VITAE!
Posts: 5,298
Registered: Dec 11, '01
Extended Info (if available)
Real Post Cnt: 5,149
User ID: 541,776
Subject: dat file writing
Oh god, now I'll be putting new skins together every night...

THANKS A LOT!

just kidding, seriously, thank you kgober

 

-----signature-----
Chazcon - Aluvian swordsman
You say, "FOR THE VITAE!"
Ru tells you, "CHAZ!"
Simply Red tells you, "I am SO not recovering your body!"
-- Good times.
Link to this post
sui101 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Wow,
My bad there Gawa and very sorry Servian, I hadn't a clue. I just started using DE a few days ago and love it already, but damn, woulda never thought it extracted landblocks on it's own with that update feature. That post you made on the thread I linked to made me think that all the more too, LOL. Damn fine program!

 

-----signature-----
Link to this post
Rizgar 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
tag

 

-----signature-----
Link to this post
Drakier 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
Rizgar: According to the sticky thread at http://vnboards.ign.com/ac_utilities/b5432/93082716 , tagging posts is no longer allowed on this particular forum. If you want to tag a post, you should PM yourself with the information or add it to the Active Topic notification.

 

-----signature-----
Link to this post
Rizgar 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
sorry I didnt know that, I guess I'll just post "cool, I cant wait to try this out at home after work" instead or some other generic reply?

Anywho, any luck on skins/texture replacements? teaser screenshots?

 

-----signature-----
Link to this post
BmoguaPK 
Title: i pwn n00bs
Posts: 12,940
Registered: Jul 17, '06
Extended Info (if available)
Real Post Cnt: 12,892
User ID: 1,156,309
Subject: dat file writing
yay..skins!

 

-----signature-----
"I have found Christian dogma unintelligible. Early in life, I absenteed myself from Christian assemblies."
"Intelligence plus character - that is the goal of true education."
grin grin grin
Link to this post
Rizgar 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
anyone make skins yet?

 

-----signature-----
Link to this post
Ezekiel_ibn_Buzi 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
I find it completely amazing the things y'all continue to come up with. I was just coming here to find a simple arrowhead making proggy.

Cheers

EZ

 

-----signature-----
Link to this post
Darktorizo 
Posts: 266
Registered: Dec 10, '06
Extended Info (if available)
Real Post Cnt: 266
User ID: 1,190,502
Subject: dat file writing
so, I finally got around to finishing the code to support dat file writing.

1. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/WriteDat/bin/ and download WriteDat.exe
2. go to http://acdev.cvs.sourceforge.net/acdev/DatUtils/ReadDat/bin/ and download ReadDat.exe
3. go to http://acdev.cvs.sourceforge.net/acdev/AC.Utility/bin/ and download AC.Utility.dll
4. go to http://acdev.cvs.sourceforge.net/acdev/AC.DatFile/bin/ and download AC.DatFile.dll
5. put all four of those files in the same directory (it's ok for you to put them in your AC folder, or you can put them elsewhere, but I don't recommend that you put them on a network share unless you know how to set up .NET security policies / trusts / zones)
5. MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON! (e.g. client_portal.dat)
6. use ReadDat.exe to extract a file from the datfile (e.g. ReadDat -f client_portal.dat 0e00000e)
7. edit the file using your editor of choice
8. IF YOU DIDN'T MAKE A BACKUP COPY OF THE DAT FILE YOU PLAN TO WORK ON, DO IT NOW!
9. use WriteDat.exe to write the changed file back to the datfile (e.g. WriteDat client_portal.dat -f 0e00000e=newfile.bin)

yes, this procedure is cumbersome. no, I do not plan to do anything about it anytime soon.

-ken

p.s. these utilities require the .NET Framework v1.1. not v2.0, which is what Decal currently requires. but that's ok, you can put both 1.1 and 2.0 on the same computer (I have both on mine). if you don't have the 1.1 framework for whatever reason, get it and install it.


I am sorry for resurrecting an old post, but I have to ask... In #7 It Says "edit the file using your editor of choice" I get the rest, but can you recommend an editor for the outputted .bin from ReadDat?

Thank you in advance.

 

-----signature-----
Guinevere du Avalon - Level 275 - Mage (War\MeleeD 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
Link to this post
Drakier 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
It depends on what TYPE of file you extract.

If you extract a SOUND file (WAV) then you need to use sound editing software to change it

If you extract an IMAGE file (BMP) Then you need to use photo editing software to change it

etc etc etc.

 

-----signature-----
Link to this post
Zenodice 
Posts: 6,622
Registered: Aug 22, '04
Extended Info (if available)
Real Post Cnt: 6,534
User ID: 958,400
Subject: dat file writing
I think what he's asking drakier, is how to edit the file outputted in the .bin format, as ReadDAT only outputs a file as a .bin file, so basically he wants to know what he should use to turn the .bin into something editable via photoshop or other image editing soft.

I usually use Hex Workshop for hex editing bin files, but as for changing them as an image file i'm not quite sure on how to output from ReadDAT to something that is redily editable via image software.

 

-----signature-----
AC - D3 - GW2 - PS2
ACC Wiki: http://ac.wikkii.net/
Link to this post
Drakier 
Posts: ????
Registered: ????
Extended Info (if available)
Real Post Cnt: 0
User ID: 0
Subject: dat file writing
that's my point...

the BIN file is just a BINARY output file.. rename it to a WAV and it's a wav file... rename it to a BMP and it's a bitmap file.

It's all just binary data. The only difference is how you read it. Certain programs are designed to read binary data in a WAV format, just as other programs are designed to read binary data in a BMP format.

BIN is just "binary data".. and "binary data" has no "type" to it. It's all about what will read that binary data correctly.

 

-----signature-----
Link to this post
Darktorizo 
Posts: 266
Registered: Dec 10, '06
Extended Info (if available)
Real Post Cnt: 266
User ID: 1,190,502
Subject: dat file writing
As far as skinning AC:ToD Read Here: http://vnboards.ign.com/Message.aspx?topic=100919960&brd=5432&start=101063664
grin

 

-----signature-----
Guinevere du Avalon - Level 275 - Mage (War\MeleeD 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
Link to this post

Valid XHTML 1.0 Transitional Powered by PHP