Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Wangan Midnight [Need Help Reversing]

Post questions about game models here, or help out others!
User avatar
nfm
advanced
Posts: 45
Joined: Sat Dec 04, 2010 1:56 am
Location: Chicago
Has thanked: 11 times
Been thanked: 74 times

Re: Wangan Midnight [Need Help Reversing]

Post by nfm »

I think mariokart64n gave us all that we need to keep going and I'm sure he has his own projects.

Like he said the blocks/sub-blocks are nested and encapsulated in the model format making things harder to work on. If you read into the maxscript it is clear that the code is still work in progress so I wouldn't necessarily call most of these mishaps bugs but unimplemented features.

I will look at the garbled AREA_ZZ_02.GTF_tex_240.dds and try to debug what went wrong there during DDS texture dump. At the moment I'm learning Maxscript and looking into 3ds docs and what it takes to create/import full complete mesh.

@REDZOEU, yes, for files like AREA_C1_ROAD_MDL_000.GRID the object names match the name of dumped textures which is pretty nice.
mariokart64n
ultra-veteran
ultra-veteran
Posts: 586
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 36 times
Been thanked: 243 times

Re: Wangan Midnight [Need Help Reversing]

Post by mariokart64n »

Those textures are raw, 8888:32bit BUT they are swizzled :\

I don't know much about it, but luckily someone else here had already programmed a GFT tool :)

viewtopic.php?f=18&t=5164

new script includes another toggle "Convert to DDS", leave this off. then you will get GFT files
you can use the tool in that link to convert GFT to DDS properly
Wangan Midnight.zip
You do not have the required permissions to view the files attached to this post.
Maxscript and other finished work I've done can be found on my DeviantArt account
User avatar
REDZOEU
veteran
Posts: 151
Joined: Thu Mar 10, 2011 8:03 am
Location: Jakarta, Indonesia
Has thanked: 74 times
Been thanked: 50 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by REDZOEU »

Oh...
Sorry, the excitement got into me :\

If he's busy with his own projects, i guess i can't bother him too much. But mariokart64n's help so far has gotten us this far into importing maps and models with proper names. ALl that's left is material name and texture name.

Thanks for the help on exporting raw texture files via your newly updated maxscript though :)
I might ask chipicao to help about texture names and material names. If it can't be gelped, that means more hours will be necessary to do the conversion :D

@KarinFutoGT : oh, i thought 3DSimEd works with .GRID or .CAR models :D
@nfm : Sorry about that. And it's good that you're learning more :)
User avatar
nfm
advanced
Posts: 45
Joined: Sat Dec 04, 2010 1:56 am
Location: Chicago
Has thanked: 11 times
Been thanked: 74 times

Re: Wangan Midnight [Need Help Reversing]

Post by nfm »

@REDZOEU, no problem :D
@mariokart64n, thanks

I modified the latest script a bit, added comments where applicable, formatted syntax, and simplified some code, functionality remains same and feature wise nothing changed. I guess it would be nice to base future changes off of this, thanks.

https://github.com/fatalhalt/TXRExtract ... wmn/wmn.ms

I'm spending some time in hex editor and maxscript, just throwing this out, file like AREA_C1_ROAD_MDL_000.GRID seems to have rougly 31 materials and 55 textures, where 4 textures are headerless DSS aka GTF that get extracted. This probably means that other 51 textures are referenced from AREA_ZZ_*.GTF.XTD files? I can see what mariokart64n mentioned that textures don't have names but are locally indexed, the relationship between materials and textures seem to be indices. That concludes about 20 hours of time :/

I also don't quite understand what should be going on in getType07() function at this moment.
You do not have the required permissions to view the files attached to this post.
mariokart64n
ultra-veteran
ultra-veteran
Posts: 586
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 36 times
Been thanked: 243 times

Re: Wangan Midnight [Need Help Reversing]

Post by mariokart64n »

thanks for cleaning and adding comments.

as for the type7 i assumed it was material data, I'm not sure how it works though. it looks like it works like the main file, in that it gives a type then you get different data based on what the type is. which makes sense if some materials are textured, and some are shaded.
Maxscript and other finished work I've done can be found on my DeviantArt account
User avatar
nfm
advanced
Posts: 45
Joined: Sat Dec 04, 2010 1:56 am
Location: Chicago
Has thanked: 11 times
Been thanked: 74 times

Re: Wangan Midnight [Need Help Reversing]

Post by nfm »

mariokart64n wrote:thanks for cleaning and adding comments.

as for the type7 i assumed it was material data, I'm not sure how it works though. it looks like it works like the main file, in that it gives a type then you get different data based on what the type is. which makes sense if some materials are textured, and some are shaded.
I found out how geometry is linked to a material, and material to texture. I added handling of materials to the script. Still needs more work:

Image
User avatar
REDZOEU
veteran
Posts: 151
Joined: Thu Mar 10, 2011 8:03 am
Location: Jakarta, Indonesia
Has thanked: 74 times
Been thanked: 50 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by REDZOEU »

Heeeeeeeell! What a progress!
With that, map conversion will be easier than ever :D
Keep up the good work guys :)

That tollbooth is lookin' good already. :D
KarinFutoGT
advanced
Posts: 51
Joined: Fri Apr 06, 2012 6:04 pm
Location: SPAIN
Has thanked: 51 times
Been thanked: 6 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by KarinFutoGT »

Soo good :P
User avatar
nfm
advanced
Posts: 45
Joined: Sat Dec 04, 2010 1:56 am
Location: Chicago
Has thanked: 11 times
Been thanked: 74 times

Re: Wangan Midnight [Need Help Reversing]

Post by nfm »

Image

I attached updated script. It handles good majority of maps (diffuse, specular, reflection, and opacity) and hooks them up into a 3ds Max material. I learned many things along the way.
You do not have the required permissions to view the files attached to this post.
User avatar
nfm
advanced
Posts: 45
Joined: Sat Dec 04, 2010 1:56 am
Location: Chicago
Has thanked: 11 times
Been thanked: 74 times

Re: Wangan Midnight [Need Help Reversing]

Post by nfm »

@mariokart64n,

Off the top of my head, the things that I found out in case you were wondering, sorry it's very late here... For each geometry there seem to be a material, so in geometry sub block unk3 would denote index to material array (mat arr being the 0x07 type we hit in getStuff() during parsing) , then in material sub block -> sub material 0x08, there would be an index to texture array, the texture sub block would then have number corresponding to nth offset in TXD section telling where to find a texture, and there in turn if you got lucky there would be a GTF texture, or just 0x10 byte entry, but looking closer at those entries there are 2 shorts where first one goes from 0~2 denoting which AREA_ZZ_*.GTF would contain the texture and next short would tell you which e.g. 157.
User avatar
REDZOEU
veteran
Posts: 151
Joined: Thu Mar 10, 2011 8:03 am
Location: Jakarta, Indonesia
Has thanked: 74 times
Been thanked: 50 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by REDZOEU »

Mother of god!
Nice work nfm!
Hard work's finally paid off :D
Now i'm gonna test the newly made script on both cars and tracks. Let's hope there ain't no more problems with this newly made script, so everyone can rest easy :D

Oh btw, i started playing Import Tuner Challenge again. I have re-discovered the other parts of highway that are missing from Wangan Midnight. First, it's Shibuya (sharp turn at the end of the track which is on the city, not on the highway), and second, it's Shinjuku (with Train Station's U turn that connects with the city road and the highway). I haven't discovered other parts yet since i don't remember much and i'm still struggling to beat every single opponent there is (also Wanderers).
mariokart64n
ultra-veteran
ultra-veteran
Posts: 586
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 36 times
Been thanked: 243 times

Re: Wangan Midnight [Need Help Reversing]

Post by mariokart64n »

wow good work finding the material information, I found it hard to interpret the material / texture indices when I found out about the external files.
your hard work really paid off i'm glad you were able to solve the missing data
nfm wrote:@mariokart64n,

Off the top of my head, the things that I found out in case you were wondering, sorry it's very late here... For each geometry there seem to be a material, so in geometry sub block unk3 would denote index to material array (mat arr being the 0x07 type we hit in getStuff() during parsing) , then in material sub block -> sub material 0x08, there would be an index to texture array, the texture sub block would then have number corresponding to nth offset in TXD section telling where to find a texture, and there in turn if you got lucky there would be a GTF texture, or just 0x10 byte entry, but looking closer at those entries there are 2 shorts where first one goes from 0~2 denoting which AREA_ZZ_*.GTF would contain the texture and next short would tell you which e.g. 157.
Maxscript and other finished work I've done can be found on my DeviantArt account
User avatar
REDZOEU
veteran
Posts: 151
Joined: Thu Mar 10, 2011 8:03 am
Location: Jakarta, Indonesia
Has thanked: 74 times
Been thanked: 50 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by REDZOEU »

Track Conversion is an O-Kay :D

Image

I had to scale the track model down with ZModeler's Exact Transformation tool from 1.000 to 0.030 to make the track's size equal to an example car from GTA SA (which is the ZR-350)

Image

Also, sorry for disturbing again. There's another problem for vehicles. I'm trying to convert the large truck (QUON.CAR is the name of the file), but material names are half named (first few had their original name, the rest are wire_xxxxxxxxx. Also, the same old problem, only 3 textures are extracted (license plate, main_day, main_night).

Image

Looks like even the body part of the truck's head uses texture, since the wire doesn't look like it has the doorlines of the front door (see https://www.youtube.com/watch?v=zaW7i7k7Dvo and look closely on the door while comparing it to the wires of the truck model)

Sorry for the large images. Had to.
AMG
advanced
Posts: 61
Joined: Sun Aug 10, 2014 3:55 pm
Has thanked: 324 times
Been thanked: 13 times

Re: Wangan Midnight [Need Help Reversing]

Post by AMG »

I confirm what REDZOEU wrote. Some materials have no name, and are also mixed up
Spotted also some broken (unwelded) parts on the meshes. The Subaru Legacy Wagon for example has broken edges on the bumpers.
KarinFutoGT
advanced
Posts: 51
Joined: Fri Apr 06, 2012 6:04 pm
Location: SPAIN
Has thanked: 51 times
Been thanked: 6 times
Contact:

Re: Wangan Midnight [Need Help Reversing]

Post by KarinFutoGT »

I only try the S30 Akio and i can say that car is correct in everything, here a screenshot for my conversion to rFactor sim.

Image
Post Reply