Quantcast

Jump to content

» «
Photo

[REL] Renderware file converter

152 replies to this topic
The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#1

Posted 03 December 2014 - 04:28 PM Edited by The Hero, 04 October 2017 - 03:25 PM.

[link to older programs removed]
 
I've written lots of RW-related code over the years and programs that convert various file formats.
Here are some binaries: http://aap.papnet.eu/gta/rwconv.zip
and here is the source https://github.com/aap/librwhttps://github.com/aap/librwgta
 
I usually don't remember what I changed since the last versions, so just let it surprise you.
Also do note that I wrote these tools for my personal use, don't expect them to be perfect in every regard. They do what I needed them to.
 
convdff:
The version of the file written will be the same as the input by default (unless you set the version explicitly with the -v switch, see this for information on RW versions: http://www.gtamoddin...wiki/RenderWare).
Some terminology:
- Instancing means converting the platform independent geometry data into a platform specific format that can be saved to a dff file (these dff files are called pre-instanced because instancing no longer happens at runtime). This is done in the PS2 and mobile games starting with VC and all xbox games. d3d8 and d3d9 pre-instanced geometry is not used by the games by default but the game should be able to read such dffs.

- Uninstancing is something the original RenderWare engine cannot do, but which librw can: it means converting the platform specific geometry back into a platform independent format again.
The -u and -i switches tell convdff to uninstance or instance a dff (note that not everything has been tested an implemented yet, expect bugs or problems).

Even non-instanced can be platform-specific (the -o switch sets the output platform, d3d8 being the default). Most noticeably ADC optimized geometry on the PS2 (to improve tristripping) and custom vertex formats on the xbox.

Example: to convert a ps2 file into the platform independent format and write it as version 3.3.0.2 use it as
convdff.exe -u -v 33002 input.dff output.dff
To pre-instance a file into xbox format:
convdff.exe -i -o xbox intput.dff output.dff
I will implement more features in the future but the basic conversions should be working. I don't guarantee all conversions will work, i can't test everything. Please report bugs or unexpected behaviour.

Notes:
- files with multiple clumps are not supported (everything after the first clump is ignored).
- uninstancing Xbox night normals is not supported yet
- instancing and uninstancing of SA mobile dffs is not (completely?) implemented yet.
 
convtxd:
This thing converts, extracts and creates txds.
Check the usage for how to use it.

lcsconv, vcsconv:
These convert files from LCS and VCS respectively (dff, txd, mdl, chk, whatever, but no levels yet). VCS peds don't work yet because the hierarchy is f*cked and has to be reconstructed.
  • Ash_735, gamerzworld, Frank.s and 26 others like this

Tomasak
  • Tomasak

  • The Yardies
  • Joined: 04 Jan 2009
  • None
  • Worst Sheep 2017
    Spam Commando 2017
    Best Conversion 2016 [GTA: Underground] [Contribution]

#2

Posted 03 December 2014 - 04:42 PM

Count this as not mentioned bug?

Spoiler


Snoops27
  • Snoops27

    Hustler

  • Members
  • Joined: 10 Aug 2013
  • United-Kingdom

#3

Posted 03 December 2014 - 04:42 PM

We can talk about this stuff here? Well here I go again :D. Bugged sunglasses models on PC, think they're fine on the PS2.

 


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#4

Posted 03 December 2014 - 04:57 PM

The glasses bug cannot be fixed in the DFF or TXD I think. This has to do with the alpha test and draw order.

  • Snoops27 likes this

Jinx.
  • Jinx.

    👉 👌

  • Facade
  • Joined: 15 Dec 2010
  • Romania
  • Best WIP Mod 2014 [Grand Theft Auto 3D]

#5

Posted 03 December 2014 - 05:51 PM

Holy damn!

We need an Android GTA 3 Peds to be importable in 3ds aswell. Hope you will do it too! :)

  • Davve95 likes this

The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#6

Posted 03 December 2014 - 06:02 PM

You can convert mobile dffs already. Have you tried if peds work?


Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#7

Posted 03 December 2014 - 07:58 PM Edited by Blackbird88, 03 December 2014 - 07:58 PM.

I tried to convert mobile DFF, but no matter what I do it stays white and won't load its texture :(

How do I find out which texture it's looking for?


d3jan
  • d3jan

    Prime

  • Members
  • Joined: 01 Jun 2011
  • None

#8

Posted 03 December 2014 - 09:13 PM

Very helpful tools :D

 

Here's a batch code for txdex. It creates folders for every txd and then it puts all the textures extracted from each txd in those folders:

for %%i in (*.txd*) do txdex %%i & if /i not "%%~nxi"=="%~nx0" md "%%~ni" 2>nul & move "*.tga*" "%%~ni" >nul
  • Tomasak, Mr. Jago, Snoops27 and 1 other like this

Mr. Jago
  • Mr. Jago

  • Members
  • Joined: 10 May 2011
  • United-States

#9

Posted 04 December 2014 - 12:39 AM Edited by Mr. Jago, 04 December 2014 - 12:40 AM.

Count this as not mentioned bug?

Spoiler

not a bug, vice city on the ps2 lacks backface culling I believe so that model would look fine under normal circumstances

 

also I'm glad to see that these tools have finally gotten a big release, I've been using them for the past year and they're just awesome!  :^:


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#10

Posted 04 December 2014 - 05:42 AM

I tried to convert mobile DFF, but no matter what I do it stays white and won't load its texture :(

How do I find out which texture it's looking for?

 

You can use rwanalyze, I think it has an option for checking textures.


Gladion
  • Gladion

    A.K.A. Surya926

  • Members
  • Joined: 30 Apr 2011
  • Indonesia

#11

Posted 04 December 2014 - 05:53 AM Edited by Surya926, 04 December 2014 - 06:10 AM.

when i convert the hydra model, the window/glass is missing, i wonder why :/

 

EDIT: same goes for Rustler and Cropduster too

EDIT2: all three glass model are using the "vehicleenvmap128" reflection texture, maybe it's related?


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#12

Posted 04 December 2014 - 05:59 AM

That's weird...Is the geometry really missing? Have you checked in 3ds max or so?


Gladion
  • Gladion

    A.K.A. Surya926

  • Members
  • Joined: 30 Apr 2011
  • Indonesia

#13

Posted 04 December 2014 - 06:11 AM

no, in 3ds max the geometry is show up but in game isn't


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#14

Posted 04 December 2014 - 06:27 AM

I will take a look at it later.


Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#15

Posted 04 December 2014 - 08:33 AM

I tried to convert mobile DFF, but no matter what I do it stays white and won't load its texture :(
How do I find out which texture it's looking for?

 
You can use rwanalyze, I think it has an option for checking textures.


Yeah that shows the texture name, but not the name of the TXD file.
  • Bigbossbro08 likes this

The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#16

Posted 04 December 2014 - 09:56 AM

The DFF has no info which TXD should be used with it. What DFF are you talking about here?


Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#17

Posted 04 December 2014 - 02:04 PM

kmb_dumbbell_l.dff


Claude_Lib
  • Claude_Lib

    Talkative like never before

  • Members
  • Joined: 26 Jun 2009
  • Russia

#18

Posted 04 December 2014 - 02:53 PM

I guess, the dff either uses the txd associated with it in IDE file or generic txd file. You're gotta look for that "kmb_dumbbell_l" in PS2 IDE map files and see what txd is associated with it. That's how I remember, I may be wrong though.

  • Blackbird88, Tomasak and Mr. Jago like this

Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#19

Posted 04 December 2014 - 03:04 PM

Thank you so much. That was it!


El Dorado
  • El Dorado

    If it keeps on rainin' levee's goin' to break

  • Feroci
  • Joined: 07 Nov 2013
  • Brazil

#20

Posted 04 December 2014 - 04:22 PM

If possible:

 

- Mobile files support

- User interface


Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#21

Posted 04 December 2014 - 06:56 PM

- User interface


unix has no GUI
  • Androll likes this

The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#22

Posted 06 December 2014 - 11:22 AM Edited by The Hero, 06 December 2014 - 11:24 AM.

New version:

- All DFF chunks can be read and written now (although some of them are not parsed and just copied 1:1 into the output file)

- better command line argument handling, the flags now come *before* the files like they should

- other fixes and clean ups

 

Todo:

- find out why the hydra's glass doesn't appear (and fix it)

- fix peds

- rewrite the whole thing, it's gotten kinda ugly

  • Blackbird88, Tomasak, Mr. Jago and 3 others like this

The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#23

Posted 06 December 2014 - 03:31 PM Edited by The Hero, 06 December 2014 - 05:23 PM.

New version, added a feature:

dffconv got an -m switch that can be used to fix the specular and environment information according to the PS2 pipeline that's being used. This removes unwanted specular reflections (especially on wheels).

 

EDIT: Found out why the hydra's glass isn't showing. It's a problem with the alpha test again, this needs a fix in ps2refl. I will fix it and explain what happened in that other thread.

  • Mr. Jago and Snoops27 like this

Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#24

Posted 06 December 2014 - 09:01 PM Edited by Blackbird88, 06 December 2014 - 09:01 PM.

If you manage to implement converting of mobile cutscene characters with no issues then you're really The Hero

Spoiler

  • dkluin likes this

The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#25

Posted 06 December 2014 - 09:17 PM Edited by The Hero, 06 December 2014 - 09:17 PM.

Hm, should be easy (I hope!). I will work on this tomorrow.

  • Blackbird88 likes this

Gladion
  • Gladion

    A.K.A. Surya926

  • Members
  • Joined: 30 Apr 2011
  • Indonesia

#26

Posted 06 December 2014 - 11:20 PM

can RWConv convert the buildings properly now?


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#27

Posted 07 December 2014 - 11:12 AM

Could someone explain to me what the problem with peds is? Which file from which version did you convert? I don't want to find these problems myself.


BMWSauberF1.08
  • BMWSauberF1.08

    San Andreas Rewind Vehicle Artist

  • Feroci
  • Joined: 03 Sep 2013
  • Italy
  • Contribution Award [Mods]

#28

Posted 07 December 2014 - 11:17 AM Edited by Aztecas_5, 07 December 2014 - 11:17 AM.

bones aren't named correctly,for example LClavicle is named Dummy4,etc

 

though this can be easily fixed with rwanalyze by renaming correctly the frames


Snoops27
  • Snoops27

    Hustler

  • Members
  • Joined: 10 Aug 2013
  • United-Kingdom

#29

Posted 07 December 2014 - 11:23 AM Edited by snoops26, 07 December 2014 - 11:24 AM.

hopefully one day alpha sun glasses would be fixed :D


The Hero
  • The Hero

    Into TheGame!!!

  • Feroci
  • Joined: 25 Jan 2005
  • Germany
  • Most Helpful Modding 2016 [Honorable mention]
    Best Script or Plugin 2016 [SkyGfx]
    Contribution Award [Mods]

#30

Posted 07 December 2014 - 12:12 PM Edited by The Hero, 07 December 2014 - 05:51 PM.

I noticed there is still work to do on the OpenGL (used by the mobile games) and Xbox DFFs. Not sure when I'll get to this. I really hope the frame names can be fixed automatically, but I'm not quite sure. I want to be able to read the format first.

 

Oh, and I forgot I added support for multi clump DFFs a while ago. Aztecas_5, didn't you have problems with these?

  • Blackbird88, Tomasak, Mr. Jago and 1 other like this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users