logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,677
Total Threads: 8,798
Posts: 95,842

Administrators:
DeeZire, Redemption

There are currently 32 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements

DeeZire Online > Editing Community > LOTR: Battle For Middle Earth I & II Editing » Christmas present: reverse-engineering Asset.dat

LOTR: Battle For Middle Earth I & II Editing Discuss any modding related issues to do with the Lord Of The Rings: Battle For Middle Earth I and II RTS games here.

Reply
 
LinkBack Thread Tools
Old 12-26-2004, 02:28 PM   #11 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: The Netherlands
Posts: 141
Send a message via ICQ to Rene
Default

I think you are correct about reading the entries in reverse order. I checked it and it is correct for all these entries:

Code:
StringEntry #:6 armyantsm_gm01.w3d ARMYANTSM_GM01.A8 3 
    armyants.tga 
    armyantsa.tga 
    armyantsb.tga 
StringEntry #:7 armyantsm_gm01.w3d ARMYANTSM_GM01.A4 3 
    armyants.tga 
    armyantsa.tga 
    armyantsb.tga 
StringEntry #:8 armyantsm_gm01.w3d ARMYANTSM_GM01.A2 3 
    armyants.tga 
    armyantsa.tga 
    armyantsb.tga 
StringEntry #:9 armyantsm_gm01.w3d ARMYANTSM_GM01.A1 3 
    armyants.tga 
    armyantsa.tga 
    armyantsb.tga 
StringEntry #:10 armyantsm_gm01.w3d ARMYANTSM_GM01.A7 3 
    armyants.tga 
    armyantsa.tga 
    armyantsb.tga 
StringEntry #:11 armyantsm_gm01.w3d ARMYANTSM_GM01 6 
    armyantsm_gm01.a1 
    armyantsm_gm01.a2 
    armyantsm_gm01.a4 
    armyantsm_gm01.a7 
    armyantsm_gm01.a8 
    h*armyantsm_gm01
The last one describes the entire object using references to the entries that are above it. One of those entries describes what textures it uses.


It looks like I misread your question about the hlod container name. Most of the time it is the same as the filename without the extension. It can only be 15 characters long but is stored in a 16 byte string. There are exception in the name but I've only encountered those in very few models.


It could also be that it doesn't tell us the container name but the skeleton name it uses. Could you post a model entry that uses an external skeleton? That are the models that are named "*_skn.w3d" like the mumumakil_skn.w3d. In the hlod part it makes a reference to mumumakil_skl.w3d.
Rene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-26-2004, 06:43 PM   #12 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

I have posted the full file to http://www.tibed.net/beta/asset.dat.zip
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-27-2004, 12:31 PM   #13 (permalink)
Senior Member
 
Join Date: Jul 2004
Posts: 605
Default

Which W3D format are we talking about?

...Because the 3D model format used in Shockwave is W3D too

This google is quite informative:

http://www.google.com/search?num=100...on&btnG=Search
DarkSideDave is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-27-2004, 01:38 PM   #14 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

We're talking about the W3D format as used in Renegade, Generals and BFME. I believe it is a shorthand for Westwood-3D and I don't think it's the same as the shockwave one.

Also, Rene, I forgot to include one string of every subentry... which happens to match the 2nd string in the StringEntries:
Entry #0: 201_wp_01.tga 01C4C95E4C57CD09
Sub #0: 201_wp_01.tga TEX 0 0
and something like that. I have succesfully matched them now, btw. Gotta go now.
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-27-2004, 02:42 PM   #15 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: The Netherlands
Posts: 141
Send a message via ICQ to Rene
Default

W3D is indeed Westwood3D and it doesn't match the shockwave files.

I'm working on the code to read through the files and generate the correct output. I expect to have it working in a day or two. Still don't know what the big number after an entry is though.
Rene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-27-2004, 05:44 PM   #16 (permalink)
Senior Member
 
Join Date: Jul 2004
Posts: 605
Default

Hmmm.... we could appeal to SlashDot to help solve the problem?

There's quite a bit of Anti-EA people there anyway

Btw... sorry for not really contributing much... I'm more into DotNet and WinForms than the advanced stuff you guys are doing such a great job at

Keep it up
DarkSideDave is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-28-2004, 07:39 AM   #17 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

Well we're still making progress... I think Rene is anyway. There's just one big unknown at the moment.

I have uploaded the 'fixed' text version of the files, and also an XML version which has Entries and StringEntries integrated (I can match them together): http://www.tibed.net/beta/asset_xml_text.zip .

Here is a snippet (TibEd 2 XML format, so not everything comes from the asset.dat file):
Code:
<node id="401">
<attr name="filename">armyantsa.tga</attr>
<attr name="unknown">01C4C95E4D8DBC33</attr>
<node id="0">
<attr name="kind">TEX</attr>
<attr name="name">armyantsa.tga</attr>
<attr name="offset">0</attr>
<attr name="size">0</attr>
<attr name="lastid">0</attr>
<attr name="lastname">0</attr>
</node>
<attr name="lastid">1</attr>
<attr name="lastname">0</attr>
</node>
<node id="402">
<attr name="filename">armyantsb.tga</attr>
<attr name="unknown">01C4C95E4D99A7DC</attr>
<node id="0">
<attr name="kind">TEX</attr>
<attr name="name">armyantsb.tga</attr>
<attr name="offset">0</attr>
<attr name="size">0</attr>
<attr name="lastid">0</attr>
<attr name="lastname">0</attr>
</node>
<attr name="lastid">1</attr>
<attr name="lastname">0</attr>
</node>
<node id="403">
<attr name="filename">armyantsglow.w3d</attr>
<attr name="unknown">01C4C95E907C5482</attr>
<node id="0">
<attr name="kind">HIER</attr>
<attr name="name">H*ARMYANTSGLOW</attr>
<attr name="offset">0</attr>
<attr name="size">284</attr>
<attr name="lastid">0</attr>
<attr name="lastname">0</attr>
</node>
<node id="1">
<attr name="kind">MESH</attr>
<attr name="name">ARMYANTSGLOW.CYLINDER01</attr>
<attr name="offset">284</attr>
<attr name="size">7914</attr>
<entry name="0"><e f="key">str</e><e f="value">exlightstreaks3.tga</e></entry>
<attr name="lastid">0</attr>
<attr name="lastname">1</attr>
</node>
<node id="2">
<attr name="kind">HLOD</attr>
<attr name="name">ARMYANTSGLOW</attr>
<attr name="offset">8198</attr>
<attr name="size">124</attr>
<entry name="0"><e f="key">str</e><e f="value">armyantsglow.cylinder01</e></entry>
<entry name="1"><e f="key">str</e><e f="value">h*armyantsglow</e></entry>
<attr name="lastid">0</attr>
<attr name="lastname">2</attr>
</node>
<attr name="lastid">3</attr>
<attr name="lastname">0</attr>
</node>
<node id="404">
<attr name="filename">armyantsloc.w3d</attr>
<attr name="unknown">01C4C95E907EB6D7</attr>
<node id="0">
<attr name="kind">HIER</attr>
<attr name="name">H*ARMYANTSLOC</attr>
<attr name="offset">0</attr>
<attr name="size">284</attr>
<attr name="lastid">0</attr>
<attr name="lastname">0</attr>
</node>
<node id="1">
<attr name="kind">MESH</attr>
<attr name="name">ARMYANTSLOC.PLANE01</attr>
<attr name="offset">284</attr>
<attr name="size">853</attr>
<entry name="0"><e f="key">str</e><e f="value">exgradient2.tga</e></entry>
<entry name="1"><e f="key">str</e><e f="value">sfe_bluernga.tga</e></entry>
<attr name="lastid">0</attr>
<attr name="lastname">2</attr>
</node>
<node id="2">
<attr name="kind">HLOD</attr>
<attr name="name">ARMYANTSLOC</attr>
<attr name="offset">1137</attr>
<attr name="size">124</attr>
<entry name="0"><e f="key">str</e><e f="value">armyantsloc.plane01</e></entry>
<entry name="1"><e f="key">str</e><e f="value">h*armyantsloc</e></entry>
<attr name="lastid">0</attr>
<attr name="lastname">2</attr>
</node>
<attr name="lastid">3</attr>
<attr name="lastname">0</attr>
</node>
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-28-2004, 04:22 PM   #18 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: The Netherlands
Posts: 141
Send a message via ICQ to Rene
Default

I'm still going on the w3d part... I made a part on my way to work, it reads through a specified w3d file and creates the sub parts of an entry.

An compiled exe is here (save target as)
Source files are here (vc++ 7)

I didn't bother making an UI as you probably going to integrate it in something else so just run it in a dosbox. It takes one argument, the w3d file to read (including the extension). The subs are just written in the dosbox.

Currently supported chunks are:

Hierarchy
Animation
Compressed Animation
Mesh
Bounding Box
Hierarchal Level of Detail

By a quick look though the assets.dat file I don't see any other chunk showing up so this should be it.


I'll continue with the string entry part now and hopefully post that tomorrow.
Rene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-28-2004, 04:58 PM   #19 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: The Netherlands
Posts: 141
Send a message via ICQ to Rene
Default

Also Koen, the second and the third entry use the same unknown number. Is that correct? As it increases with every file.


On thing we can exclude though, the filesize doesn't seem to influence it:

Code:
Entry #10: 223_ad_01_r1.tga 01C4C95E4C7DF259
  Sub #0: 223_ad_01_r1.tga TEX 0 0
Entry #11: 226_ad_01.tga 01C4C95E4C8054AE
  Sub #0: 226_ad_01.tga TEX 0 0
Entry #12: 227_ad_01_r1.tga 01C4C95E4C82B703
  Sub #0: 227_ad_01_r1.tga TEX 0 0
All textures have different file sizes. For the unkown number though:
The difference between 10 and 11 is 26255 H
The difference between 11 and 12 is 26255 H

Now I though I found a nice system but other entries break the sequence (of two ):

Code:
Entry #2000: gbgendb.tga 01C4C95E5A8DF3B7
  Sub #0: gbgendb.tga TEX 0 0
Entry #2001: gbgenrubble.tga 01C4C95E5A90560C
  Sub #0: gbgenrubble.tga TEX 0 0
Entry #2002: gbgenrubble.w3d 01C4C95EA1CA016C
  Sub #0: H*GBGENRUBBLE HIER 0 392
  Sub #1: GBGENRUBBLE.GBGENRUBBLEB MESH 392 31868
  Sub #2: GBGENRUBBLE.GBGENRUBBLEA MESH 32260 3253
  Sub #3: GBGENRUBBLE HLOD 35513 168
The difference between 2000 and 2001 is 26255 H
The difference between 2002 and 2001 is 4739AB60 H

Now this last number is a multiply of 26255 H


A last one:

Code:
Entry #5019: mucavtroll_wlkd.w3d 01C4C95ED28F9645
  Sub #0: A*MUCAVTROLL_SKL.MUCAVTROLL_WLKD ANIM 0 17132
Entry #5020: mudeathcage.w3d 01C4C95ED2945AEF
  Sub #0: H*MUDEATHCAGE HIER 0 1148
  Sub #1: MUDEATHCAGE.MUDEATHCAGE2 MESH 1148 35988
  Sub #2: MUDEATHCAGE.MUDEATHCAGE1 MESH 37136 13464
  Sub #3: MUDEATHCAGE.MUCAGETREE3 MESH 50600 19624
  Sub #4: MUDEATHCAGE.MUDEATHCAGE MESH 70224 936
  Sub #5: MUDEATHCAGE.MUCAGETREE MESH 71160 16491
  Sub #6: MUDEATHCAGE HLOD 87651 300
the difference here is 4C4AA H

Again a multply of 26255 H



This made me think that entries with one sub used 26255 H as their number but this entry proved me wrong:

Code:
Entry #5022: mudrmtroll.tga 01C4C95E71EBAEC8
  Sub #0: mudrmtroll.tga TEX 0 0
Entry #5023: mudrmtroll_atka.w3d 01C4C95ED29DE443
  Sub #0: A*MUDRMTROLL_SKL.MUDRMTROLL_ATKA ANIM 0 37300
The difference here is 60B2357B H

Now that's a little bigger but still, a multiply of 26255 H.
Rene is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-28-2004, 05:34 PM   #20 (permalink)
Senior Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 206
Default

These differences are quite interesting... what would happen if we divide all those numbers by 25255H?

Quote:
Also Koen, the second and the third entry use the same unknown number. Is that correct? As it increases with every file.
I do not know exactly what you mean. Subentries of type MESH and HLOD (and perhaps others) can be matched with a stringentry. In the XML file, they have been put together as <entry> inside a subentry <node>. The current layout is rather confusing as it really is a tree with multiple levels.
Koen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merry Christmas Renegade Red Alert 2 & Yuri's Revenge Editing 5 12-25-2005 06:51 PM
Asset Builder Sy LOTR: Battle For Middle Earth I & II Editing 79 04-18-2005 04:43 PM
Are these items present in BFME? Hostile LOTR: Battle For Middle Earth I & II Editing 2 03-27-2005 01:51 AM
Merry Christmas Renegade Red Alert 2 & Yuri's Revenge Editing 7 12-25-2004 09:12 PM
Any way to reverse animations in Renx/3ds? Kuja Generals & Zero Hour Editing 4 06-17-2004 06:08 AM


All times are GMT -4. The time now is 03:26 AM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.