Chrono Compendium
Kajar Laboratories - Fan Works and Submissions => Chrono Cross Modification => Topic started by: FaustWolf on July 02, 2016, 02:21:04 pm
-
Figured we might as well make a centralized list of toolsets that can extract, process, and/or re-import Chrono Cross files. The two biggest tools that were available
way back in the day were the "R/Y Dumper" made by Yazoo and recompiled by Ramsus, and the Terminus Traductions suite. I have long since forgotten how these work exactly, and there are probably more advanced tools nowadays. But without further ado...
- Purple Cat Tools (https://www.chronocompendium.com/Forums/index.php?topic=10927.msg221536#msg221536)
- R/Y Dumper (Attached)
- Terminus Traductions Toolset (http://www.romhacking.net/utilities/840/)
- TIM2VRAM and EGFX2VRAM tools (https://www.chronocompendium.com/Forums/index.php?topic=10927.msg223661#msg223661)
- DRP and CPT file handlers (Weapon packs and DRP files) (https://www.chronocompendium.com/Forums/index.php?topic=10927.msg224113#msg224113)
Everyone, please feel free to list your own tools or tools you know of here. I'll pop back in from time to time to add those to the first post.[/list]
-
Purple Cat Tools, the Perl-based dumper-builder I wrote some years ago. I've attached two versions.
0.3 was the last real release. There is reasonably complete documentation in the README file.
- Features: break apart Cross CD images into their component files and rebuild them, or extract individual files and reinsert them.
- Known problems: never much tested on Windows, creation of EDC/ECC data for CD sectors is really slow (not an issue unless you're rebuilding an entire CD).
0.4_ALPHA contains most of what was supposed to be the next version.
- Features: In addition to just about everything the previous version can do, allows breaking down composite (drp and cpt) files into their component parts and rebuilding them, somewhat functional LZSS decompression and recompression. Faster at creating CD sectors than the previous version. Supports project settings files, so that you don't have to keep typing all those switches.
- Known problems: the README was only partly updated, filebuilder.pl was never actually written, relzss.pl never worked properly (it's okay for short files, IIRC, but I screwed up on "what you do when you hit the end of the buffer"), some scripts don't work properly on Windows even though they're okay on Linux. I have a set of corrections someone on Triple-Tech gave me that I never got around to incorporating.
-
I am currently working on an Assimp (http://www.assimp.org/) plugin for MDL/MESH file support. It's coming along pretty good. I'll have a preliminary version soon enough. Blender CC import addon's code gives me a good reference since I know both Python and C++
-
I added this note to the Chrono Cross page: "Magil has compilers and decompilers for fieldscript and battlescript, a de-~LZSS-er, a de-~DRP-er, and a texture remapper (remaps 2-textured battle models to use a single texture, for improved Doppelgang compatibility), all (I think) in C# .Net. Unfortunately, due to proxy- and cheap-~BB-software-related problems, I can't determine the download ~URLs. "
Would a fieldscript decompiler be what's needed to examine the developer's ending rooms and figure out if that Kid outfit change legend is total nonsense?
-
I added this note to the Chrono Cross page: "Magil has compilers and decompilers for fieldscript and battlescript, a de-~LZSS-er, a de-~DRP-er, and a texture remapper (remaps 2-textured battle models to use a single texture, for improved Doppelgang compatibility), all (I think) in C# .Net. Unfortunately, due to proxy- and cheap-~BB-software-related problems, I can't determine the download ~URLs. "
Would a fieldscript decompiler be what's needed to examine the developer's ending rooms and figure out if that Kid outfit change legend is total nonsense?
http://chronofan.com/Black/Other/utunnels_utils.zip
The tools mentioned above are already in this package, so you can delete that paragraph from the wiki.
The fieldscript decompiler was created by Yazoo's, and the decompiled scripts are in "CC Script Decompiler (by yaz0r).RAR".
As for Kid outfit change legend, I think people already checked the resource files of that room? If there's an alternate outfit, we should be able to find its textures. Can't find the topic about this legend though.
-
Ah, cool; I'll remove that paragraph. I'm going to update the site today.
I can't believe I didn't move it to the Great To-Do List...it's this topic: https://www.chronocompendium.com/Forums/index.php?topic=4187.0
I completely forget about that screenshot in the first post, though. So maybe there is some merit to this legend.
-
My guess is that it's just a legend, invented by some kid wanting to make himself look important, but if anyone wants to follow up, I can provide the extracted and broken down room files from CD2. Kid is an NPC in these rooms, I believe, so her texture(s) would be stored inside the relevant room blob.
-
Let's go ahead and do it, if you have time to extract them. This stupid thing is what has me concerned: https://www.chronocompendium.com/images/wiki/7/7d/Kidinorphanclothes.jpg
-
It isn't a problem--I just type a command and wait a few seconds. Question: in the interest of keeping the attachment size down, does anyone know whether this is the first or second room, or whether the screen capture is of the left, right, or center? Or do I need to dump all of 1718-1747 inclusive?
-
I can't believe I didn't move it to the Great To-Do List
It was already (https://www.chronocompendium.com/Forums/index.php?topic=8088.0) in the Do-To List as a topic. So which one should we use?
Or do I need to dump all of 1718-1747 inclusive?
Just the last one (far right of second area).
-
Okay, here we go. First attachment contains everything from the relevant room broken down as far as I can break it (some of the file extensions are missing--sorry about that). Second attachment is the three raw room files, in case someone wants to play with them in that format or it turns out my de-lzss'er screwed up.
-
Looks like the only Kid-NPC texture loaded is the orphanage outfit. Schala's white gown from the Time Devourer is nowhere to be found. Am I correct in saying that her normal thief outfit would be loaded independently of the room (since it's a PC texture)?
In any event, I think the absence of Schala's gown nails it. Per that old FAQ, equipping the Spectra Swallow apparently changes her to the orphanage outfit, but after that...nothing. Per that FAQ, after the Schala outfit, a combination of songs will make her pickpocket a non-item "Key", but given that there's no text string for this in the script, nor is there likely to be any actual event code for this, I think the "mystery" is put to rest. I wonder if there's any merit to this, though:
...In all likelihood, the psychedelic effects on the [Spectra Swallow] probably messed with her shadow shader and caused it to bug out.
It'd be nice of course to have some kind of TF-esque view of all the event code, haha, but the absence of the Schala gown is pretty damning.
-
It's been a while, but if I recall correctly, her regular outfit's texture would be stored with the room data too if it were used in that room, even though it would duplicate her data as a PC elsewhere on the disc. My guess is that the original development team thought loading speed was more important than storage space, and/or wanted a uniform interface for NPC handling, which they couldn't get if they had to sometimes bail out to fetch models and textures from the PC storage sections.
I think the absence of any other Kid-suitable texture is probably as close to proof that this legend is bogus as we're going to get, unless someone wants to work through the fieldscript. I don't know if the disc 2 scripts were included in the ones yaz0r decompiled or not.
-
Well Zeality, I've decompiled Temporal Flux to figure how its code works. I know C# so maybe I can take a look at that as well.
-
...
- Known problems: the README was only partly updated, filebuilder.pl was never actually written, relzss.pl never worked properly (it's okay for short files, IIRC, but I screwed up on "what you do when you hit the end of the buffer"), some scripts don't work properly on Windows even though they're okay on Linux. I have a set of corrections someone on Triple-Tech gave me that I never got around to incorporating.
One of the reasons this: the Windows version of Python in the output file adds extra bytes "0D" before each byte "0A"
-
Speaking of relzss, can the 4 bytes of unknown data be removed?
4. LZSS File Header
Chrono Cross presents LZSS files with a twelve-byte header, which can be divided into 4-byte sections.
The first four bytes are always 73 73 7A 6C—"sszl".
The next four bytes are the expected length in bytes of the decoded file, presented as a little-endian value. Experimentation suggests that this number may not be 100% accurate.
The purpose of the next four bytes is currently unknown.
-
I think the unknown 4 bytes may be a CRC32 sum
-
It doesn't match any checksum or crc generated by hexworkshop.
But if so it is a good thing because none of the known mods have encountered a problem, means the game ignores the number.
-
It doesn't match any checksum or crc generated by hexworkshop.
But if so it is a good thing because none of the known mods have encountered a problem, means the game ignores the number.
About lzss. For example this file after delzss - relzss stops working
-
About lzss. For example this file after delzss - relzss stops working
What if you add the original 4 bytes back?
-
What if you add the original 4 bytes back?
The header of both files are the same, but the new file is 4 bytes longer than the original.
-
Well if the length is changed, the cpt file and the cd need to be rebuild. A simple ppf may not work. Perhaps it is not just this file, when you edit a script, you can't grant it is smaller than original.
-
Well if the length is changed, the cpt file and the cd need to be rebuild. A simple ppf may not work. Perhaps it is not just this file, when you edit a script, you can't grant it is smaller than original.
I'm doing a full rebild iso, then prolblem in something else.
-
That is strange. What relzss tool did you use?
Terminus Traduction should have their version. Mine were based on some generic lzss code found on internet.
-
I saw tons of lzss variants and still have no idea how engine can unpack different lzss files even if they contain the same files inside. Sometimes it works, sometimes no, but seems to be okay with excuses for terrible design, lol.
-
...
- Known problems: the README was only partly updated, filebuilder.pl was never actually written, relzss.pl never worked properly (it's okay for short files, IIRC, but I screwed up on "what you do when you hit the end of the buffer"), some scripts don't work properly on Windows even though they're okay on Linux. I have a set of corrections someone on Triple-Tech gave me that I never got around to incorporating.
One of the reasons this: the Windows version of Python in the output file adds extra bytes "0D" before each byte "0A"
The problem here isn't the difference in line endings between *NIX and Windows (Perl redefines the bytewise representation of "\n", the end-of-line marker, according to the system it's running on)--it's file mode. Perl under Windows differentiates between opening files in "text mode" and opening them in "binary mode". Because I was working in Linux, I neglected to invoke the binmode (http://perldoc.perl.org/functions/binmode.html) command at any point.
-
That is strange. What relzss tool did you use?
Terminus Traduction should have their version. Mine were based on some generic lzss code found on internet.
If he's using the one in Purple Cat Tools, it's likely to result in larger-than-original files even if the source file was small enough not to invoke the broken part of the script. I think it had to do with the script failing to backtrack into parts of the buffer that hadn't been written to yet. The resulting compression is still valid, it's just that it outputs literals rather than buffer pointers in that one particular case, making for a slightly bigger file.
-
That is strange. What relzss tool did you use?
Terminus Traduction should have their version. Mine were based on some generic lzss code found on internet.
Mostly I'll use your utility lzss and 95% of the cases it works without problems, although after repacking the files are noticeably different. A few files I failed to Repack any of the listed programs
-
The header of both files are the same, but the new file is 4 bytes longer than the original.
You can test this if you like, which one of them works (if any)?
z1.sszl - result after I changed the compress code slightly
z12.sszl - remove last 4 bytes from z1.sszl
z13.sszl - remove last 4 bytes from old result
-
You can test this if you like, which one of them works (if any)?
z1.sszl - result after I changed the compress code slightly
z12.sszl - remove last 4 bytes from z1.sszl
z13.sszl - remove last 4 bytes from old result
z1.sszl - work
z12.sszl - work
z13.sszl - not work
-
OK, so it is not the size that matters.
This is the modified lzss tool (it has a cygwin dll because on current pc I don't have other compilers installed).
-
OK, so it is not the size that matters.
This is the modified lzss tool (it has a cygwin dll because on current pc I don't have other compilers installed).
This tool works perfect. Thank you.
-
What are the changes you made?
-
Some unnecessary check for ring buffer length while searching the longest matching pattern.
while(l<LZSS_CHAINE && pos+l<LZSS_BUFFER && p%LZSS_BUFFER<LZSS_BUFFER-2
&& buffer[(p+l)%LZSS_BUFFER]==buffer[(pos+l)%LZSS_BUFFER]) {
-
Just wrote a tool that imports tim files into vram so you can use a vram viewer (http://www.romhacking.net/utilities/442/) to check their positions.
This was originally designed to construct battle field textures, but in theory it can be used for any tim files.
How?
Select all tim files and drag-drop them on the exe. The output file is vram.bin
-
Similar tool but imports egfx file int vram. Useful when finding element textures (for example, starky's mecha)
-
utunnels If you have time, could you make a tool to pack/unpack drp? Your unpackdrp good, but it ignores unreadable characters. It would be nice if the name of the decompressed file looked like this: "01.000a.7A697A31.zip1" where:
01 - the number of the file
000a - file type
7A697A31 - file name byte(7A 69 7A 31 - for packing with the same name)
zip1 - file name
I'd love to do it myself, but I don't know any programming language :oops:
-
I'll see what I can do when I get home.
Maybe files and list.txt is a better solution, if not all characters can be used to name a file.
-
I'll see what I can do when I get home.
Maybe files and list.txt is a better solution, if not all characters can be used to name a file.
Maybe. I recently came across a file named "1" (31 00 00 00)
-
But "1" is legal file name.
-
https://drive.google.com/open?id=0B5GvuiubpnUZYi1DMUk2R0pNZkk
By the way, I had a unpackcpt.exe and a cpt.exe in this folder, which I used to test the weapon pack (.weap files).
Usage:
Drag and drop the .weap (or maybe other cpt file) on unpackcpt.exe to unpack it.
Drag and drop all output files onto cpt.exe to repack it (the file will be save to outut.cpt).
Note, on windows, it seems the file order is determined by the first file you dragged, so it is safe to select the first one of all files.
-
https://drive.google.com/open?id=0B5GvuiubpnUZYi1DMUk2R0pNZkk
By the way, I had a unpackcpt.exe and a cpt.exe in this folder, which I used to test the weapon pack (.weap files).
Usage:
Drag and drop the .weap (or maybe other cpt file) on unpackcpt.exe to unpack it.
Drag and drop all output files onto cpt.exe to repack it (the file will be save to outut.cpt).
Note, on windows, it seems the file order is determined by the first file you dragged, so it is safe to select the first one of all files.
Oh, thank you, I'm tired of counting everything in the hex editor
-
drp.exe has been added.
Usage is the same as cpt.exe
-
drp.exe has been added.
Usage is the same as cpt.exe
How to unpack? unpackdrp is not required?
-
It is needed.
-
I see, thank you very much. I'm trying to add animation in the room, but the animations in the DRP file. Later I will tell about the test result
-
is there any tools to replace the original music? I want to replace the original music with the "cross symphonic" by John Paul Hayward