Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

DexX

[DOC]IV model formats - .wft, .wdr, .wdd

Recommended Posts

DexX

Released Exporters and Tools:

Experimental Zmodeler 2 .wft filter from Oleg

 

 

Old info from here down

 

Based on models uploaded in this topic and discussion from the last post there...

 

 

Ask GooD-NTS or Alexander Blade... I am only a person who is looking for progress, compare information from differen forums and post it here))

 

You want to keep everything in a secret like other information about GTAIV formats? Please, not...

 

Model format is hacking by CrashBandicoot and listener (I just only translated their speech to english)

 

CrashBandicoot:

 

Model file has symmetrical structure, and what he needed.

Here's what new research showed.

Usually, the files coords 3D data points are written in succession on 12 bytes. 1 point = 12 bytes (float x, float y, float z). Considering model with the bat (file rpg.wdr.rsc) proved that point is 36 bytes. The first 12 - are coordinates x, y, z. The next 12 bytes this point on the circle around bits (that is, is the "garbage" around bits). But next 12 bytes - is not clear at all that: The first 4 bytes - not the number (not exactly float), second and third quite similar to the number of type float.

 

1 point is this:

offset | description

-----------------

0 float coord_X

4 float coord_Y

8 float coord_Z

12 float unk_X

16 float unk_Y

20 float unk_Z

24 unk2

28 float unk3_1

32 float unk3_2

 

unk2 - the number does not seem to be some flags. For example, what it can be value: 9B 9B 9B FF, B3 B3 B3 FF, 96 96 96 FF, 9C 9C 9C FF, 93 93 93 FF, B5 B5 B5 FF, 94 94 94 FF, etc.

 

At the expense of unk3_1 and unk_3_2 - float values from 0 to 1. Perhaps texture coordinates.

 

 

listener:

 

In bat file, at 0x1000 begins GPU-segment. All that it is to be standart D3D structures.

 

Lhen it is possible to saw vertex and index array. (Fields filled 0xCD - not-inicialised data). Total size of the buffer index produced 480 triangles.

 

i'll re-iterate a bit. All my discussion is based on w_bat_wdr.rsc

 

rsc_info.txt

HeaderLength, offset into file where raw vertex data begins.

DataLength, total amount of data to read in, including any padding (0xCD) and face indices.

 

The vertex structure should be as follows:

0 float position x

4 float position y

8 float position z

12 float normal x

16 float normal y

20 float normal z

24 dword color (RGBA)

28 float texcoord u

32 float texcoord v

 

size of 1 vertex = 36 bytes

size of vertex array = 0x1ef0

0x1ef0 / 36 = 220 verts (vertex count isn't listed in file anywhere? i can't find it..)

 

dword unknown

dword unknown

dword unknown (material indices?)

padding (0xCDCDCDCD)

offset 0x3000, face indices?

face index array is 0x5A0 bytes long (also 16-bit face indices, see Directx dox)

padding until 0x3FFF

eof

 

Notes on vertex structures: Earlier in the file, 0xBC0 for the bat, there a list of shaders that will be used for the materials on the geometry. The vertices should have the data that the shaders expect, and different shaders will expect different data. Peds have boneweights, and some geometry has tangents, or multiple uv coordinates. Be sure to sure to cross check the shaders listed in the model, with common\shaders\db, and the vertex declarations in common\shaders\dcl.

 

Edit: The *.dcl files have been changed with R* patches (1.0.2.0 for sure, 1.0.1.0 is untested) and no longer contain full vertex declarations mad.gif

Anyone using that data needs to grab the files from a 1.0.0.0 install.

Edited by DexX

Share this post


Link to post
Share on other sites
oCain

Whoot! Really Fast! Nice one DexX! smile.gif

 

Here my results...

user posted image user posted image user posted image

...the AK seems to have two parts. (maybe?!)

 

I'm not really good in file description, so I just upload the test-max-scripts...

http://rapidshare.com/files/172480557/IV_M...t_Test.rar.html

...really raw(noobish) and "static", 'cause I also couldn't found any vertex-count or something like that.

 

But what I can say is that the shooting-weapons (AK&RPG) have some more floats(?).

0 float position x

4 float position y

8 float position z

12 float normal x

16 float normal y

20 float normal z

24 dword color (RGBA)

28 float texcoord u

32 float texcoord v

36 unkFloat?

40 unkFloat?

44 unkFloat?

48 unkFloat?

 

That's it...for now.

 

Greetz!

 

//Edit-->

user posted image

Normals, VertexColors & UV-Mapping...

Edited by oCain

Share this post


Link to post
Share on other sites
DexX

 

36 unkFloat?

40 unkFloat?

44 unkFloat?

48 unkFloat?

Tangents, used for setting up the normal map correctly in the shader (since R* almost certainly used tangent-space normal maps).

36 tangent x

40 tangent y

44 tangent z

48 tangent w

 

 

...the AK seems to have two parts. (maybe?!)

There's vertex data @ 0x2000, and 0x22000 (with corresponding face data @ 0x2e4400). So yea, 2 sets of geometry data.

 

Edit, aha, there's another piece at 0x21D70 - this has the default vertex structure i listed in my first post - no tangents.

 

 

Normals, VertexColors & UV-Mapping...

You beat me to it, bastard tounge.gif

 

The geometry structure seems to be basically this:

initial vertex data/geometry offset

--begin of vertex data (based on vertex declaration)

--read until 0xCDCDCDCD

--begin face index for these verts

--read until 0xCDCDCDCD

-next set of vertex data, loop

repeat until EOF

 

Other notes:

There are *.sps files mentioned in the section before the geometry data is stored. The sps files seem to contain references to which shader will be used. For example gta_alpha.sps, references gta_default, and there is no gta_alpha shader. There are 131 .sps files, and only 90 shaders.

Edited by DexX

Share this post


Link to post
Share on other sites
Gforce

...the AK seems to have two parts. (maybe?!)

 

possibly because gun weapons use a seperate muzzle flash model, they did in SA wink.gif

 

great work so far gentlemen smile.gif

Share this post


Link to post
Share on other sites
EvilRaptor

Weapons use two different models because when the player reloads, the magazine's pulled off and replaced by one on the player's person... like the rocket launcher, only you're replacing more than one ammo at a time tounge.gif

The rocket's still in another model file, just like before, and just like that, the other weapons have adopted this sort-of system of having a sub-model, the minigun in SA had two model parts, for example... and now the AK has another model for it's clip... simple.

Share this post


Link to post
Share on other sites
Gforce

ah yes, i forgot to look at the pic's, i thought he meant the model file he was looking at had 2 parts blush.gif

 

Edit: max scripts re-uploaded due to RS hit a 10 DL limit confused.gif

 

http://www.savefile.com/files/1926534

Edited by Gforce

Share this post


Link to post
Share on other sites
lpgunit

Nice... Don't know much about cracking file formats, but it is quite epic; any more and we'll end up with custom vehicles for IV... cookie.gifcookie.gif

Share this post


Link to post
Share on other sites
_CP_

Wow! It's epic! Now we can make mods with models of cars!

Share this post


Link to post
Share on other sites
mr.Dageron

News from gtamaps.net:

user posted image

Share this post


Link to post
Share on other sites
aru

Here's a little template I wrote for 010 Editor (its a hex editor) that parsed out most of the outer non-model data from the decompressed xbox360 xdr model files. Non-model data meaning things like... headers, # of geometry parts, vertex count, indice count, etc. I think the only sections I hadn't written structures for was the ones linking the shaders. The windows wdr might be a little different... but this might help in either case:

 

http://aru.nd4spdworld.com/pic/iv-xdru.bt

 

Some really good work here though! Keep it up.

Share this post


Link to post
Share on other sites
xadet3

Nice work. First time I've ever played around with GTA related files, so I quickly whipped this up today out of pure boredom tounge.gif.

 

user posted image

 

Do most of the file formats usually get reversed and released publicly? Or should I attempt them myself?

Share this post


Link to post
Share on other sites
mr.Dageron

Our:

user posted image

Share this post


Link to post
Share on other sites
oCain

Nice Pictures! (Progress wink.gif)

 

I've just found a tiny thing...

 

offset: 96 [0x60] = Object Count

(Weapons only...maybe other objects too?!)

 

--

 

user posted image

...nothing special, but you can see the different parts of the AK.

 

Keep at up!

 

//Edit-->

 

You beat me to it, bastard  tounge2.gif

HeHe...Sorry Dude, but there was nothing on TV. wink.gif

 

//Edit²-->

VertexBlockOffsetTheory:

 

If we could read the whole Header(+Texture/ShaderInfo Stuff)and got the the size.

Then the vertexBlock starts at the next PowerOfTwo value.

Let's say the Header++ beats the 2048, so the VertexBlock starts at 4096 and if it beats the 4096,

the VertexBlock starts at 8192.

 

strange Idea + poor english = bad mixture...I know. blush.gif

Edited by oCain

Share this post


Link to post
Share on other sites
mr.Dageron

 

oCain, your work is great! icon14.gif Can you try to open some car files?

Share this post


Link to post
Share on other sites
LiveLife

Sorry for the following OT, but my content is realy important for us.

 

Hey oCain,

I'm writing this as my personal last request to you. Please read what I have to say and think about it. I'll write this text to make some things absolutly clear and to show that we, the members of the GTA United modification, want you back. You are a very talented GTA modder and you were it back months ago aswell. Over a half year ago you simply disaapeard one day, from the one day to the next. Let me define something clean. If some of us said some inappropriate thing or in any way bad thing to you: we doesn't meant it that way. We talked to each other, if someone knows why you simply disaapered; but nobody noticed something. If it should be like this way, we want to apologize us. Like I wrote earlier on YouTube, if the reason should be personal things/school/other thing we would really understand that, if someone doesn't want to do anything more with GTA, we respect that. The only thing we really would like to see is, if you could at least tell us, what you're gonna do. I personally thought back then that you are a cool and talented guy, really, but seeing now as you ignored us for months and appeard now again with that real bomb you showed in this thread is a bit sad for us. In the name of AMD, Aschratt, myself and all others, I can only hope that you tell us what you're reasons were & are! We do not know that we have done something wrong, if we have done it. We still want you back oCain, please keep that in mind.

 

Greetz,

CD

Share this post


Link to post
Share on other sites
GamerShotgun

Did you know that GTAForums has a Private Messaging system, which you can use for these kind of messages? sarcasm.gif

Share this post


Link to post
Share on other sites
DexX

Dageron, do you guys extract the models differently? The sample files you uploaded have the extra text files, that contain the offset/size data. REspawn just released his img extractor, and the models (.wft) files are slightly different - larger.

Fixed in REspawns last update.

Share this post


Link to post
Share on other sites
mr.Dageron

Maybe extractor is a bit different. Our ones were extracted with OpenIV.

 

Textures:

user posted image

Share this post


Link to post
Share on other sites
ChrisBenoit!
Did you know that GTAForums has a Private Messaging system, which you can use for these kind of messages? sarcasm.gif

We know this but he don´t send an answer... T_T

Share this post


Link to post
Share on other sites
DexX

i've been looking into the *.sps files in common\shaders\db, and there seems to be an attribute that many of them share;

 

__rage_drawbucket {int 1}

 

The 'int' value can be 1-5, or in some cases, 29 or 30. I gave it limited testing in "gta_vehicle_vehglass.sps", trying it at 1, 3, and 5 (what seemed to be the most popular uses, based on my research).

 

at 1: http://img101.imageshack.us/my.php?image=drawbucket1rm4.jpg

Alpha is normal.

 

at 3: http://img211.imageshack.us/my.php?image=drawbucket3dr7.jpg

Alpha is opaque.

 

at 5: http://img126.imageshack.us/my.php?image=drawbucket5oy0.jpg

Alpha is gone.

 

29 was seen in gta_vehicle_nosplash.sps

30 was seen in gta_vehicle_nowater.sps

 

For some of the other sps files, there are other attributes that can be edited. For example:

 

SpecularColor {float 0.150000}Specular {float 180}

 

...from "gta_vehicle_vehglass.sps", controls the spec amount for the glass materials. Although the parameters here seem to be matched with variables in the shader file (in this case, gta_vehicle_vehglass.fxc), it seems only certain vars can be changed with this method.

 

Dec 18

Not related to the above stuff - The models are in more than one format;

.wft

.wdr

.wdd

 

Component peds use both .wdd and wft model types. Regarding peds the .wdd files seem to contain the texture and material lists, object names, and other data. The wft file seems to have bone and matrix info. Both contain mesh data, although the mesh data from the wft files is extremely small in many cases, compared to the mesh data from the wdd file, which appears to be the bulk of the model.

 

Vehicles only seem to use wft files, so the above does not apply to them (vehicle wft files have all the necessary info). Weapons (mainly .wdr) and ped props (mainly .wdd) have no wft's. wdr and wdd formats seem to be very similar.

 

A cursory examination of the Map imgs, reveals that they use primarily wdr files, with a few wdd files here and there. Very few wft files, probably those are animated, or otherwise special map objects.

Edited by DexX

Share this post


Link to post
Share on other sites
DexX

Pinned to feed my ego. Hot damn. Actually, if anyone ever wants to see new car and ped models ingame, this stuff needs to be cracked. Having it fall behind the other topics won't help a bit.

 

Oh yea, been documenting the system data (*.sys, if using SparkIV / Resoursaur).

It's slightly out of date (thank you aru), but it's a start:

www.3dhole.com/iv/system_notes.txt

Share this post


Link to post
Share on other sites
listener

DexX, I thinking, your approach is... ineffective. RSC is not a sequence of chunks, like a RenderWare stream, but dumped out block of memory.

So, if we will read RSC contents and relocate all pointers, we got nice linked object structure.

 

My info on wdr, wdd and and wtd structures: http://public.sannybuilder.com/GTA4/rsc_en.txt

Share this post


Link to post
Share on other sites
DexX

Effective enough to import the segments in max, and build a simple hierarchy though. But this topic exists for this exact reason - for discussion, and thats some quality work you posted icon14.gif

Share this post


Link to post
Share on other sites
aru

 

DexX, I thinking, your approach is... ineffective. RSC is not a sequence of chunks, like a RenderWare stream, but dumped out block of memory.

So, if we will read RSC contents and relocate all pointers, we got nice linked object structure.

 

My info on wdr, wdd and and wtd structures: http://public.sannybuilder.com/GTA4/rsc_en.txt

Updated a bit:

 

struct rage::grmGeometry : public rage::datBase {  // size = 0x4C 	DWORD	_f4;  // +4 	DWORD  	_f8; 	rage::grcVertexBufferD3D * m_vertexBuffers[4];  // +0xC 	rage::grcIndexBufferD3D  * m_indexBuffers[4];  // +0x1C 	DWORD  	m_dwIndexCount; 	DWORD  	m_dwFaceCount; 	WORD  	m_wVertexCount; 	WORD  	m_wIndicesPerFace; 	void *  _f38;    	WORD  	m_wVertexStride;   // Essentially size of each vertex 	WORD  	_f3E; 	DWORD  	_f40; 	void *	_f44; 	DWORD  	_f48;};

 

 

New struct (I suck at this, so excuse the mistakes tounge.gif)....

 

 

struct rage::grmShaderGroup : public rage::datBase { // size = ??  DWORD _f4;  CPtrCollection<SomeShaderStruct> m_shaders;  DWORD _f10[12];   // Type might be wrong (might not even be an array).. needs checking  CSimpleCollection<DWORD> m_unknown1;  CSimpleCollection<DWORD> m_unknown2;};

 

 

SomeShaderStruct has ptrs to shader name and sps file name.

 

 

@listener... does the game use all 4 of those defined Vertex/Index buffers? Or just the first one?

Edited by aru

Share this post


Link to post
Share on other sites
mr.Dageron

WDR Viewer+3ds max import plugin by CrashBandicoot (gtamaps.net&OpenIV team)

 

DOWNLOAD

 

1) Extract models from IMG in *.wdr format.

2) If you need textures, extract them in JPEG format.

3) Open WDR in programm.

4) Export model file.

5) Open it with importer in 3ds max.

smile.gif

Edited by mr.Dageron

Share this post


Link to post
Share on other sites
JostVice

Holy crap. works great, another great tool by the red army. Can't wait for the wfts though smile.gif

Share this post


Link to post
Share on other sites
listener
@listener... does the game use all 4 of those defined Vertex/Index buffers? Or just the first one?

thanks, aru

 

game code initializes all 4 buffers, but create vertex declaration only for the first vertex buffer.

I shall make resource scanner, for finding some unusual data (volume/cube textures, geometries with more than one vertex/index buffer, etc.)

 

File updated (more info on grmShaderGroup)

Share this post


Link to post
Share on other sites
Picolini

Glad to see people working on all this technical stuff, keep it up guys icon14.gif

I wouldn't know where to start.

 

You're the core of proper modding!

Share this post


Link to post
Share on other sites
simkas
WDR Viewer+3ds max import plugin by CrashBandicoot (gtamaps.net&OpenIV team)

 

DOWNLOAD

 

1) Extract models from IMG in *.wdr format.

2) If you need textures, extract them in JPEG format.

3) Open WDR in programm.

4) Export model file.

5) Open it with importer in 3ds max.

smile.gif

Awesome, but how do I get the textures to show up correctly in 3dmax?

Share this post


Link to post
Share on other sites
mr.Dageron

 

Awesome, but how do I get the textures to show up correctly in 3dmax?

Impossible yet confused.gif

Edited by mr.Dageron

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.