![]() |
Jade Empire modding (see first post for info summary)
Index - useful resource links:
JE Modding tools (so far):
Other Modding tools that work with JE:
Modding info, tutorial and how-to posts: Released JE Mods in this thread:
* * * Original post: Since I just got Jade Empire for PC I thought I'd try to update my RIM/ERF editor to handle the Jade Empire files to make modding it a little easier. The ERF and RIM file formats seems to be mostly the same, though the ResType <--> File extension lookup table seems to have changed, both changing the meaning of some existing ResTypes, and adding a bunch of new file types to it. I've been looking through various RIM and MOD files so far trying to figure out what the different files are. So far I've only been able to figure out this fairly short list. Do anyone know what other file type <--> ResType associations there are, or what the new files are used for? Edit: Found a list, so hopefully the table should be complete now. Still need to figure out the purpose of some of the files, and what format they are in though. (Some may be leftovers from Neverwinter Nights / Knights of the Old Republic and unused in Jade Empire.) Code:
ResType Type Comment/speculation |
Quote:
I've done few things like editing some 2da's and make some scripts. For that I have use 2DA Converter/Merger Tool, ERF/RIM Editor and KotorTool. Maybe you have a look into .tlk files? All I want is to set description for few items. :) |
Quote:
There is one data field in the TLK file I don't know the purpose of currently. It seems to be a 32 bit unsigned integer which is set to 0xFFFFFFFF (-1 I suppose) for the majority of the TLK entries, though a fair number of them (mostly dialog related strings) has some other value set here, and it seems each value (except 0xFFFFFFFF) used is unique and set for just that one entry. TalkEd just lets you set this number directly (using hexadecimal notation) for the time being until someone can figure out what the purpose of this data is. Edit: I suspect the unknown numeric value refers to names of the numbered BIP/sound files found in for example audio.bif, though I haven't been able to verify this yet. |
stoffe, have you tried poking around in the .key/.bif files to fill in the gaps for erf extensions? I found
this thread on Bioware's forums that references a tool that recognizes most of the key/bif extensions for Jade Empire. Just a thought. |
Quote:
That the data files seems to be an even more disorganized mess than KOTOR, with files or the same type or files belonging to the same area scattered all over the place, doesn't make it easier to find all the file types that are used and how they fit together :) |
It was my hope that the tool referenced above (in a broken url link, now fixed) would shed the light on some unknown extensions. A long shot I'm sure, but just a different angle to attack from.
|
Quote:
I've made a JE version of my ERF/RIM Editor that uses the above file extension/ResType table (minus the couple of unknowns in the list) so far. While the list isn't complete it's easier to spot which files aren't properly identified when it doesn't use the KOTOR file associations. :) If anyone is interested you can download it from the link in the first post in this thread. If you notice any file types that are listed starting with a # followed by a number those are of unknown types. Please let me know what file it it and where (in what file) you found them in those cases. :) |
That fiels is for sound ("0xFFFFFFFF" value = no sound). I test this by replacing values and it works. However the sound file must be loaded in that module or to be present in override because if I set a sound which is used in other module will do nothing. I haven't test append new entry but I'm sure is no problem with that. This tool is perfect for what I need to finish my mod.
Many thanks stoffe. Edit: I just found dialog tool and I should test-it tonight. I like how easy is to attach scripts for diferite events by editing ar_*.2da files. |
Quote:
Quote:
|
Another update...
While poking around in the RIM and MOD files I found some more file types I managed to figure out with reasonably certainty what they should be. I've updated the list in the first post and uploaded another version of ERF/RIM Edit with the recent changes, see the link in the first post in this thread to download.
Any other file types I've not managed to find yet? |
Thanks for all the effort stoffe! =)
Now I just need to get off my lazy behind and install the darn game (DDO is evil... just Evil!) ;) |
Kind of on topic here, but if someone could find a way to open the PC & NPC textures (they're in txb form) I would be ever so grateful. :D
(If this doesn't fit in here, please excuse me. ;)) |
@stoffe: many thanks again for all this tools.
I have no idea how to use a debug console or what is that Quote:
However, I belive to be possible to send mesajes to log or display by #include debug. @mjpb3: I also look for this and for a decomp. for mdl files |
Quote:
Don't know if I'm good enough at this kind of programming to be able to make a converter that converts TXB --> TGA directly, but I'll give it a try and see how it goes. :) Quote:
|
I built a TPC Perl mdoule based on eiz's tpc2tga source code. If you want any assistance let me know.
|
Quote:
Edit: Nevermind, I was just stupid. :) |
Whatever you can come up with would be excellent for me. That's the main thing I ever wanted to mod in Jade Empire--the textures. Thanks for anything you can accomplish. :D
|
Code:
sub reverse_bytes {This is so the $cpx variable in decode_dxt1 can be right shifted 2 bits at a time and disregarded as the new $px is calculated. The blended array is set up in such a way to make sense of the two bits see: Code:
for (my $y=0; $y<4; $y++) {I don't have the tpc2tga source in front of me at the moment so I'm just working off the tpc.pm, btw -- the Perl code was a direct (more or less) translation of the C++. Edit: crossed out the part about the 2 bits being reversed -- they aren't reversed -- their position within their bytes are unaltered but the bytes themselves are reordered. |
Quote:
The unpack() function takes a string and splits it by token into an array, like explode() in PHP? While pack() takes an array and spits out a token-separated string from it? What does your reverse_bytes() function receive as parameter, a token-separated string (using "V" as separator) containing the three values a texel-struct holds? If so you convert the string to an array, immediately explode the array into a string again (this time using "C4" as token separator instead), reverse-sort the string, turn it into an array again (wouldn't "C4" be "4C" when you reverse the string?), and immediately turns the array back into a string (this time separated with "V" again) which you return? Wouldn't that return an array of 3 values? Huh? I don't follow what this accomplishes. :) It obviously works, but I still don't understand what it does. :confused: (As you don't have the source: The C++ code takes a struct as function parameter containing two 16 bit unsigned ints and one 32 bit unsigned int value... does something with those three values which I have absolutely no idea what, and then spits out a single 32 bit unsigned integer as result.) * * * Another question ... this is called in a loop that loops up to the Y-size of the bitmap while writing the TGA (i is the incrementing value in the loop): fwrite(file->pixels+pitch*(ysz-i-1), 4, pitch, fp) file->pixels is an array of 32 bit unsigned integers (the RGBA data), pitch is the X-dimension of the image (in pixels), ysz is the Y-dimension of the image What exactly is it writing? file->pixels is an array, but it doesn't supply any array index in that function call... Does the file->pixels+pitch*(ysz-i-1) add pitch*(ysz-i-1) to the memory pointer of the pixels array and then write the four bytes found in that location? Why do this instead of using an array index? Weird lower-level languages I haven't used for years confuse me. Use of pointers always confuse me. :) |
Quote:
Quote:
Quote:
Code:
inline u32 reverse_bytes(u32 i, int2type<4>) {* * * |
Quote:
|
The fwrite function is writing row by row starting at the end of the array. Think of the array as the image mirrored vertically. (Left-right is maintained but top-bottom is reversed.) I'm sorry for confusing you by saying byte-by-byte earlier.
Here's the declaration for fwrite Code:
size_t fwrite(const void *ptr, size_t size, size_t nitems,HTH and sorry for not having the concentration earlier. :xp: |
Quote:
Great news about textures and I must thank you all for efforts. |
Quote:
But each iteration of the loop still only seems to back off pitch (=256) bytes. Now can it back up one row if it only backs up 25% of the data that is being read/written? Shouldn't it back up pitch*4 to get to the next line of data? Does the memory pointer voodoo deal with array elements and not byte positions in memory? I.e. it backs up pitch (=256) elements and not bytes? Edit again: Yes! :emodanc: That seems to have done the trick. Seems like the utility works to convert at least those TXB files to TGA I have tested it on. :) |
\o/ Yay for stoffe! Did you answer your own question then? The *4 part seems like it should be there to me too... but then again I'm not a C++ guru. I would've expected the use of brackets here to denote element iteration. (Don't like having to think at this level with my programming either, stoffe.) I remember this is the area I fumbled through with trial and error also until I got something recognizable. :D Good job.
|
Quote:
The quick converter utility seems to work reasonably well on the few TXB textures I've tried to convert with it. I've uploaded it for now in case someone else wants to help test it and determine how well it works: Txb2Tga. Use at your own risk. It seems to work OK, but I've only tested it on a handful of different TXB files. If you encounter any file it can't convert properly please let me know which file that was. * * * On more general notes it seems the NWNNSSCOMP for KOTOR (at least the variant tk102 did) works fine to compile scripts for Jade Empire if you use the nwscript.nss file found in the override folder and fix the couple of syntax errors it contains. :emodanc: Jade Empire also seems to use a mix of the traditional plaintext 2DA V2.0 format, and the same binary 2DA V2.b format used with KOTOR. So the binary files can be edited with KotorTool, or converted to text using tk102's excel plugin or my quick converter utility. |
Yes yes yes!!!! Thank you stoffe and tk102! It works! I was able to convert Scholar Ling's outfit and head texture. Just want I needed!
:bow: :bow: :bow: |
Thanks for all your hard work, nowhere else is even close to this far for texture editing yet. But how do you get these new textures into the game now? Do you need to change them back to txb's? If so, how?
|
I assume the .tga files are readable as-is in the override directory. Bioware has been pretty good about that in the past, just as they do with v2.b and v2.0 2da files.
|
Still can't get it to work. I converted Radiant Jen Zi's body and edited it, then saved it as TGA image named P_Li01 which is the same as the txb file. I also tried naming it P_Li01.txb which I knew wouldn't work and it didn't. I deleted the actual txb file thinking it might just be loading that one first, and that didn't work either. Her body came up black, so I replaced it. Any Ideas?
|
Quote:
I did a quick test and recolored the shirt of my character green, moved p_blossom01.txb out of the override folder and put p_blossom01.tga and p_blossom01.txi in the override folder, and she turned up with a green shirt in-game. (I.e. you shouldn't need to remove the TXB file from within the data files for the TGA to be used, just make sure one doesn't exist in the override folder.) Edit: I did a quick reskin of the character you mentioned as well, and it showed up fine in-game: http://img518.imageshack.us/img518/7...iantmb9.th.jpg |
Thanks, I got it working now. I don't know why it didn't work the last time I got rid of the TXB though. Thanks again.
|
GFF editing observations
Seems like Jade Empire has added yet another data type to the GFF format (still without changing the version number :roleyess:). Type 18 appears to be a StrRef type, similar to ExoLocString in use but only containing a dialog.tlk reference and not any localized substring data. Be warned that these fields may get messed up and stripped if using any GFF editors for NWN or KOTOR to edit Jade Empire's GFF files.
Aside from that it seems JE uses the Rotation and Vector field types added in KOTOR as well, which would cause trouble when using GFF editors made for NWN. |
So Field 16 and 17 exist-- that's good. Have you been able to tell if CResRef fields include up to 32 chars (like NWN2) or just 16 chars (like KotOR)? If it helps, I could modify either KGFF or NWN2GFF to include field 18. Send me a PM if you like. :)
|
Quote:
|
Is there any current information about decompiling and replacing models at this time?
|
Quote:
@Adelphus: I don't believe cchargin or Taina have devoted time to modifying their modeling tooling for Jade Empire at this point. |
Nice work on KGFF tk, and thanks for the info.
|
I've uploaded another minor update to the ERF/RIM Editor, adding some more file associations to the table. See the link in the first post in this thread to download it.
|
stoffe, just a couple questions/comments about your TXB2TGA converter...
Not that it doesn't work properly or anything--and I can use it just as it is--but, I was curious as to why I get so much dithering when converting the TXBs to TGAs. Also, is there any way for the converter to increase the output file size from 256x256 to the more commonly used 512x512? It just seems as if the smaller file size could be causing the dithering, but I could be completely wrong about that and the dithering is caused by something else entirely. Anyway, thank you so much for this converter! Whether or not you can do anything else with it, it still works fine just as it is and I am enjoying using it a lot! ;) |
| All times are GMT -4. The time now is 06:36 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.