• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Game Modifications › Custom Texture Projects v
1 2 3 4 5 ... 12 Next »

Custom Texture Tool PS v50.1
View New Posts | View Today's Posts

Pages (117): « Previous 1 ... 57 58 59 60 61 ... 117 Next »
Jump to page 
Thread Rating:
  • 8 Vote(s) - 4.88 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Custom Texture Tool PS v50.1
10-30-2018, 02:08 AM
#581
Bighead Offline
Oversized Cranium
*******
Posts: 1,985
Threads: 15
Joined: Aug 2011
Sorry I've been way too busy to fix this, and I don't know when I'm going to get a chance to. I briefly looked at the problem and couldn't figure it out quickly. If you need to use waifu2x above "2x", for now just use v33.0 which can be found in my archive or any other option that may exist.

Ivan89el if you are still around (or anyone can test this really), is the problem you have with waifu2x simply not being able to upscale past 2x? I noticed when I use 3x or above, the image either comes out as 2x anyway, it comes out wrong, or it just doesn't come out at all. Whatever the problem is, I will have it fixed before my next release.
Donate - Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD
Website Find
Reply
11-01-2018, 05:16 AM
#582
Ivan89el Offline
Junior Member
**
Posts: 49
Threads: 6
Joined: Oct 2018
Good. In version 36.2, waifu2x caffe does not work at all (textures are not created), only waifu2x converter works.
Find
Reply
11-05-2018, 09:28 PM
#583
Psycho Away
Member
***
Posts: 90
Threads: 5
Joined: Jun 2015
Same, it used to work but not anymore
Find
Reply
11-07-2018, 03:25 AM (This post was last modified: 11-07-2018, 03:33 AM by Bighead.)
#584
Bighead Offline
Oversized Cranium
*******
Posts: 1,985
Threads: 15
Joined: Aug 2011
Can you try this version and see if it's fixed?
http://www.mediafire.com/file/kn4b4is74dsfkkl/Custom_Texture_Tool_PS_v36.3.zip
Donate - Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD
Website Find
Reply
11-07-2018, 11:55 AM (This post was last modified: 04-20-2022, 04:20 PM by Bighead.)
#585
Bighead Offline
Oversized Cranium
*******
Posts: 1,985
Threads: 15
Joined: Aug 2011

The Legend of Heroes: Trails of Cold Steel - Modding PKG Files, PKA Files, and Phyre Textures

This post will explain how to work with PKA, PKG, and phyre files found within the The Legend of Heroes: Trails of Cold Steel series of games. Some time ago now I created and released texture packs for the first two games, and I have modified my texture tool to work with it's proprietary archives and texture formats. Throughout this post, I wil refer to the four games as "CS*" to save a bunch of space.

First and foremost know that there is limitations to what can be done. In CS1 and CS2, most UI textures have been patched by Durante so they scale correctly when replaced with HD versions. In CS3 and CS4, this was never patched so attempting to replace the UI textures with higher resolution textures will cause scaling issues. I have taken screenshots of what those issues look like before they were patched by Durante. The short sad story is, this method can not be used to create an HD UI pack for CS3 and CS4, but it should be possible to replace skins, environments, costumes, etc. with higher resolution textures. Also, it MIGHT be possible to mod CS3 and CS4 with HD textures using something like Special K, but even that had some issues with CS1 and CS2 (textures with buttons crashed the game when modded). So with all that said, if you really want to attempt to mess around with the files in CS3 and CS4, read on...

While I don't think anyone on this forum will find any use for this post (unless you are interested in modding CS games), I do need a place to link to this guide. And since Phyre Mode is part of my tool, and this is the only thread it exists on, I have reserved this single post on how to mod these games. If you have any questions or bug reports about Phyre Mode, I will accept short questions and posts here. But since this is the Dolphin emulator forums, I would prefer to take extended conversation elsewhere (email, steam, discord, etc).


Setup: Required Programs: (Show Spoiler)
To get started, you will obviously need Custom Texture Tool PS, and I always suggest using the latest version as I am still finding and fixing bugs to this day. You will also need a couple of other tools that work in conjunction with CTT-PS. The simplest way to set everything up is to follow the easy installation method, as I provide a compiled pack of all the required programs. If you wish to manually download and install everything, instructions are included for that too. But do know that the programs pack now allows selecting which tools you want to install, so you don't have to install any programs you may never need.

Easy Installation Method: (Show Spoiler)
Trails of Cold Steel I and II:

• Windows 7 users must update PowerShell - Link
• Download the CTT-PS Programs pack - Link - Mirror 01 - Mirror 02
• Install ctt-ps_programs_installer.exe included in the above package
• At minimum you will want ImageMagick, Kiseki PKG Tool, TexConv, and Compressonator.
• Install dotnet-runtime-2.2.8-win-x64.exe included in the above package (this is for the Kiseki PKG Tool)
• Run the script Custom Texture Tool PS vXX.X.ps1 by right clicking it and selecting Run with PowerShell
• Click the Options button which defaults to the Tool Paths tab
• Check the checkbox under Tools Master Paths - Image
• All tool paths should be automatically filled in if installed to the *CTT-PS Data folder or C:\CTT-PS Programs
• If installed somewhere else, locate the CTT-PS Programs folder
• Under CTT-PS Options (main window), set the mode to Phyre Mode

Trails of Cold Steel III and IV:

• Perform all of the steps above for ToCS I and ToCS II.
• Install python-3.9.4-amd64.exe included in the above package

* The CTT-PS Data folder is the global folder that CTT-PS uses to store settings, create temporary files, etc. The default location is at ..\User\AppData\Local\CTT-PS Data or optionally ..\User\Documents\CTT-PS Data. The folder can be set to anywhere but this is not suggested as it will have to be manually specified in cases where the script can not find it.
Manual Installation Method: (Show Spoiler)
Trails of Cold Steel I and II:

• Windows 7 users must update PowerShell - Link
• Download and install ImageMagick which is required - Link
• Download and install dotnet-runtime-2.2.8-win-x64.exe - Link
• Download Sewer56's Kiseki PKG Tool and extract it somewhere - Link
• Run the script Custom Texture Tool PS vXX.X.ps1 by right clicking it and selecting Run with PowerShell
• Optional: Download TexConv if you wish to use the image viewer - Link
• Optional: Download Compressonator (4.2.5185+) for higher quality DDS textures - Link
• Click the Options button which defaults to the Tool Paths tab
• Find the PKG Tool path and link the PKG Tool file PKGToolCmd.dll
• Optional: Also link TexConv and Compressonator paths to the script.
• Under CTT-PS Options (main window), set the mode to Phyre Mode

Trails of Cold Steel III and IV:

• Perform all of the steps above for ToCS I and ToCS II.
• The optional steps to download TexConv and Compressonator is no longer optional, so download and install them.
• Download and install Python v3.x - Link
If all the steps were correctly followed, the tool should be 100% ready to work with Trails of Cold Steel files.
Information: PKG & PKA Files: (Show Spoiler)
PKG files are proprietary compressed archives that contain much of the game's graphical assets. Think of them as Falcom's special kind of ZIP file.
PKA files were introduced in CS3 and CS4 and act as an "archive of PKG files", and contain the majority of the game's PKG files in a single, nearly 20GB file.
To my knowledge, the compression format used in PKG files in CS1 and CS2 is LZ77, while the compression format used for PKG and PKA files in CS3 and CS4 is LZ4.

[Image: 20DNjWh.png]

A decompressor, usually in the form of a "PKG Tool" is required to extract the contents. There are two public tools in existence for CS1 and CS2, but the only one we need here is the one by Sewer56. For CS3 and CS4, we have some Python scripts that were created by CeruleanSky that can decompress PKG and PKA files. These Python scripts are now built into CTT-PS but they do require Python v3 to be installed. Unfortunately at this time, there does not exist a compressor for LZ4, but CS3 and CS4 do work with LZ77 at the cost of significantly increased file size, especially since there is currently no way to recreate the "assets.pka" files.

The PKG files that contain textures can be found in:

Trails of Cold Steel:
..\Trails of Cold Steel\data\asset\D3D11
..\Trails of Cold Steel\data\asset\D3D11_us

Trails of Cold Steel II:
..\Trails of Cold Steel II\data\asset\D3D11
..\Trails of Cold Steel II\data\asset\D3D11_us

Trails of Cold Steel III:
..\Trails of Cold Steel III\data\asset\D3D11 - Must be extracted from "assets.pka".
..\Trails of Cold Steel III\data\asset\D3D11_us

Trails of Cold Steel IV:
..\Trails of Cold Steel IV\data\asset\D3D11 - Must be extracted from "assets.pka".
..\Trails of Cold Steel IV\data\asset\D3D11_jp

Each PKG file that contains textures has a prefix which can somewhat identify what it contains. While working on the Trails of CS1 and CS2 texture packs, I created a reference list of most of the prefixes and what their corresponding PKG files contain. I have not personally verified if CS3 and CS4 have kept this naming scheme (but from a quick glance, it appears so).

PKG File Prefixes and Sub-Prefixes: (Show Spoiler)
C_ : These contain a diverse set of textures.
  • EQU: Objects and props
  • MON: Enemy skins
  • NPC: NPC skins
  • PLY: Characters skins + face textures
  • DLC: Various DLC content
E_ : Contains effects for events, S-Crafts, various
  • EFO: Effects textures
FC_ : Contains all facial textures. Eyes, mouths, etc..
  • NPC: NPC face textures
  • PLY: Character face textures
I_: Interface textures
  • 3D: The CALENDAR/CAMP textures contain the camp menu gear. The rest are orbment covers
  • ARROW: Unique, contains alternate notebook/arrow textures. These are used in-game
  • AVF: Small portraits, used in voice
  • BTLCB: Rush portraits
  • BTLCE: Link portraits
  • BTLN: Character names show on battle victory screen
  • BTLS: Turn order portraits
  • BTN: Button textures by Durante
  • CHR: Camp menu portraits
  • EFTEX: Effects textures, S-Break portraits
  • JMP: Town maps
  • MG: Mini-game textures (swimming, fishing, etc.)
  • MSTQRT: Master quartz textures
  • NOTE: Notebook textures (portraits, icons, help menus, etc.)
  • PVIS: Area text textures
  • REPORT: Chapter report textures
  • SVIS: Various cutscene screenshots and images
  • SYSTEM: Contains various important UI textures
  • TITLE: Title screen stuff.
  • TVIS: Miscellaneous pop-up text
  • VIS: Various cutscene screenshots and images
M_: Environment textures, main ones like grass, dirt, cliffs, tree bark, etc..

O_: Environment textures, objects such as benches, chairs, props, etc..
You may notice that both prefixes C_ and FC_ contain sub-prefixes NPC and PLY, and in the case of C_ which also contains DLC sub-prefix. Any duplicate textures found across these prefixes must be replaced. For example, if wanting to replace Rean's eye textures, all instances can be found in and must be replaced in all 3 categories: C_PLY, FC_PLY, and C_DLC. This was most likely a bad programming choice since the game is not programmed to use the same eye textures at all times. Instead, it picks a specific set of eyes from a specific location to use at different times, even though the textures are identical.

Using Special-K texture replacement method works around this, so it may be the preferable method if wanting to replace environments or character textures. Since all the textures are the same across the different instances of their existence in PKG files, the texture hash will always be the same when read/computed, so only a single custom texture is required to replace all instances. It requires far more dedication to seek out every instance of a texture since it can be found in many PKG files. This is just something you may want to keep in mind when deciding on what kind of texture pack you want to make for this game.
Information: Phyre Images: (Show Spoiler)
When extracting PKA or PKG files, they will contain a few different file types. But most importantly, they contain the texture files. All PKG files also contain a XML file named asset_D3D11.xml that lists the contents of the PKG file. If the files are changed, this list needs to be updated. When creating phyre textures with this script, this file will be updated automatically (if enabled).

Phyre images have two file extensions. The first is your typical PNG or DDS image extension (rarely BMP also exists), and the second is the phyre extension. The phyre format has it's own unique header that differs from traditional PNG/DDS/BMP images so there aren't any programs that can view them outside of the Basic Image Viewer in this script. Not much needs to be known about them to do texture replacement except that they need to be converted to a standard format (like PNG), edited, then converted back to (.phyre) so the game can use them.

[Image: KONFGli.png]

When it comes down to the actual image data within phyre images, DDS images are basically identical to their "standard" counterparts and offer a variety of compression formats. PNG and BMP images on the other hand are actually raw uncompressed image data. In reality, there is absolutely no difference in using uncompressed RGBA PNG or uncompressed RGBA DDS when creating a phyre image. So it does beg the question of why .png.phyre and .bmp.phyre exist at all. And while DDS can be created as RGBA8, typically this game expects it as ARGB8, while in reality both can be used and have identical requirements and output.

There is one big difference when it comes to phyre images: all of the textures pixel data is swizzled. To visualize what it means to swizzle the texture data, imagine rotating the image 180 degrees, then flipping it horizontally. I'm almost 95% positive that all phyre images are read in little endian, as are all standard DDS files. Swizzling the texture can be done in several ways such as manually swizzling the data, or using an image editor to manipulate its orientation before writing it to a phyre image. This script uses the latter method.

Phyre images can be found and/or created as any of the formats below:
  • RGBA8
  • ARGB8
  • BC1 (DXT1)
  • BC2 (DXT3)
  • BC3 (DXT5)
  • BC7 (CS3 and CS4)
  • L8 (very rare)
  • A8 (nonexistent?)
  • LA8 (very rare)
PNG images will only ever be found as RGBA8, while all other formats can be found in DDS images. This is not a limitation of the format but rather a choice made by the developers as other combinations can work. The DDS BC7 format has been added to the engine starting with CS3, and makes up the majority of the game's textures. Do not try to create BC7 textures for CS1 and CS2, the script will prevent this and instead create DXT5 textures.

There are specific instances where the image format can NOT be changed or the game will crash. I have never been able to figure out why, my only guess is some textures MUST be a certain format because the game's code is reading the texture from the GPU. And when it gets something like DXT1 when it expected ARGB8, the game will crash. Or maybe it's something else, such as a change in resolution and it's getting the wrong coordinates. Who knows, just realize that if some textures crash, it may be because you changed the format that it was originally created with.
Operation: Extract Cold Steel PKA Files: (Show Spoiler)
This operation can extract the PGK file folders from the PKA files found in The Legend of Heroes: Trails of Cold Steel III and IV.
  • Extract Files: Can be set to extract all files, or extract a specific file from CS3 or CS4. The PKG file lists are built into the script, so no external files are required other than Python v3.
When extracting a specific file from a specific game, do make sure the Input Path points to a folder that contains the correct "assets.pka" file that matches the game or you may get an incorrect result. Both games share many PKG file names with the potential the contents may have changed from game to game. Before getting too excited, do note that there are quite a few caveats and things to be aware of.

- Extracting all files at once will require about 65-70GB per game! So, about 130-140GB to extract the "assets.pka" from both games!
- This operation is currently not reversible! PKG files can be extracted from PKA, but there is currently no way to recreate a PKA file.
- While it is possible to replace the "assets.pka" with PKG files, there is currently no way to repack them with LZ4 (used in CS3 and CS4), only LZ77 (used in CS1 and CS2).
- It will require significantly more space to use PKG files over the PKA file. CS3 for example requires 37.6 GB for PKG files compressed with LZ77 (compared to 18.3 GB assets.pka).

The PKG file folders will be sent to the OutputPath to a folder named PKA_Extracted.

[Image: Sce8Kmw.png]
Operation: Extract Cold Steel PKG Files: (Show Spoiler)
This operation allows extracting the contents of PKG files. It will search the path set in Input Path for PKG files, and extract the contents to the Output Path to a folder named PKG_Extracted. Each PKG file will be extracted into its own folder. Extracting CS1 and CS2 PKG files requires the Kiseki-PKG-Sharp tool by Sewer56. Extracting CS3 and CS4 PKG files requires Python v3.x to be installed, and uses a set of scripts by CeruleanSky which are built into CTT-PS.

[Image: mqU8Uec.png]
Operation: Convert Phyre Textures to PNG Textures: (Show Spoiler)
This operation can convert the extracted phyre images to PNG. During the conversion process, this script rips the header from the phyre image into a separate file using the (.header) extension. It is important to keep this file, as it is required to convert the PNG image back into a phyre image. I never learned enough about the header to create one from scratch, so the header will be reused and modified when creating a new phyre texture. There are a few options available.
  • Unswizzle Textures: Textures are swizzled, which flips the image. This option flips it to the proper orientation.
  • Store Phyre Header: Saves the header of the phyre image. This is required to convert the image back to a phyre format.
  • Extract DDS Mipmaps: If this image has mipmaps, also extract those. I do not suggest using this option when converting many textures.
  • Use Extracted PKG Path: Instead of searching the Input Path, instead search the PKG_Extracted folder.
  • Only Scan Phyre Files: Instead of converting the textures to PNG, it will scan and print information about the phyre images.
Textures are created in the OutputPath to a folder named ConvertedPhyre, and will preserve the folder structure created from extracting the PKG files.

[Image: wf331h5.png]
Operation: Create Phyre Textures From PNG/Phyre: (Show Spoiler)
This is the operation that converts your custom PNG textures into phyre textures. Do not try to use DDS BC7 format in CS1/CS2 as it will not work because the engine does not support them! Replace the PNG's from the previous operation with your texture, and use this option to convert them to phyre images. PNG images must have the .header file created by the previous option in order to convert them back into a phyre format. There are a few options at your disposal.
  • File Extension: Allows forcing PNG, DDS, or BMP texture. Use "Source" to use the texture's original extension.
  • Image Format: Allows forcing the image format. Use "Source" to use the texture's original format.
  • Swizzle Textures: Reswizzles the images if they were unswizzled with the previous option.
  • Update Asset XML File: Automatically updates the list if the texture's file extension has changed. This option should never be unchecked.
  • Use Converted Phyre Path: Instead of searching the Input Path, instead search the ConvertedPhyre folder.
  • Only Scan Header Files: Instead of converting the textures to phyre, it will scan and print information about the images current headers.
This operation is also affected by DDS Options and Mipmap Options.
  • DDS Tool: Chooses which tool to use to create textures. If creating compressed formats (DXT1/DXT5), Compressonator beats out everyone else when it comes to overall quality.
  • Disable Mipmap Generation: Does exactly what it says and prevents mipmaps from being created for the texture.
  • Force New Mipmaps: This is not a very useful option while in Phyre Mode. If you provide your own custom mipmaps, this option forces to ignore them.
  • Max Mipmap Levels: Force the number of mipmap levels for all textures generated if it is created with mipmaps.
  • Force Create Mipmaps: Forces creating mipmaps for the texture even if it didn't have mipmaps to begin with.
There are a few things to note about how this script works with mipmaps:
  • If a phyre texture had mipmaps (it will be stored in the header), then the script will always generate new mipmaps for the texture unless disabled.
  • If custom mipmaps are provided, the script will use them. Create a mipmap chain by naming images: texture.png, texture_mip1.png, texture_mip2.png, etc..
Textures are created in the OutputPath to a folder named CreatedPhyre.

[Image: DBjEUxO.png]
Operation: Repack Folders/Textures Into PKG Files: (Show Spoiler)
Another straight forward option, this repacks the folders containing textures into PKG files using Kiseki-PKG-Sharp by Sewer56. Currently only CS1/CS2 compression (LZ77) is supported, but PKG files with this compression work fine with CS3/CS4. A folder must contain the asset_D3D11.xml file in order to be repacked.
  • Use Created Phyre Path: Instead of searching the Input Path, instead search the CreatedPhyre folder.
PKG files are created in the OutputPath to a folder named PKG_Repacked.

[Image: JqrKcRO.png]
Operation: Basic Image Viewer: (Show Spoiler)
This can be used to view just about any image format. You can drag and drop png.phyre, dds.phyre, or even full PKG files to view the images. The images need to be decoded, so large images or a PKG full of many images can take some time to display.

[Image: ceOOZ7A.png]
Development: Phyre Headers: (Show Spoiler)

THE PHYRE IMAGE HEADER

Maybe you are interested in writing your own program or script to modify phyre images. Understanding where the important bytes are and what they do is probably 95% of the battle. There was little documentation to be found on the internet, so it took quite awhile to figure much of this out. I'm probably the farthest thing from a reverse engineering expert as you can be. With that said, this is my attempt at explaining everything that I learned about the phyre image format by studying dozens of Cold Steel images in a hex editor. My goal from the beginning when creating the texture packs, was to be able to automate a process that can rewrite the headers with new data for images and supply new pixel data to create a new image. Because I think my explanation is awful and I don't know how to speak with the proper terminology, I have included many screenshots so it's obvious where the values that I'm explaining can be found.

In the end, I was not able to gain a clear enough understanding to write a header from scratch. But I did figure out that it is possible to update an existing header to change the image format, width, height, mipmaps, pitch, and various other important bytes. The header can be modified to the point that a PNG image can be fully replaced with a DDS image (and vice versa). The texture format can be altered and the Phyre Engine usually won't care that the image has changed, except in a few rare cases where the game seems to expect a certain format and ends up crashing.

NOTICE: If nothing here seems to make any sense, open a few different phyre images in a hex editor and try to follow along!


STATIC HEADER DATA:

This data can always be found at the exact locations specified.

--------------------------------------------------------------------------------------------------------
0x34 - This is some flag that seems to be exclusive to phyre headers. It is tied to the image format, and is consistent for the image formats below:

[Image: AwCJrDS.png]

Code:
L8/A8      : 14 (0E hex)
LA8/BC7    : 15 (0F hex)
DXT1/3/5   : 16 (10 hex)
RGBA/ARGB  : 17 (11 hex)

--------------------------------------------------------------------------------------------------------
0x38 - CS1/CS2 Only - The value here is equal to the length of data that starts at the image path (0x99B), and extends until:

[Image: pqY5YOm.png]

Spoiler: (Show Spoiler)
[Image: TmsDU6V.png]
ARGB/RGBA : the byte after the first known value of 88 (58 hex). I don't know why an extra byte is calculated in this case.
DXT1/3/5 : the second known value of 88 (58 hex) is found. The first value of 88 (58 hex) represents the X in "DXT*" so it is skipped.

--------------------------------------------------------------------------------------------------------
0x38 - CS3/CS4 Only - This value seems to have changed since CS1/CS2 and is significantly smaller. The only thing I can tell it lines up with is four bytes before the path, extending until PTexture2D is hit.

[Image: E0KGVY5.png]

Spoiler: (Show Spoiler)
[Image: hERye32.png]
--------------------------------------------------------------------------------------------------------
0x50 - The texture pitch, which is 4 bytes long (extends to 0x53). Unlike standard DDS formats, the computation is the same for compressed and uncompressed images. The difference is that uncompressed textures use the compressed formula (as defined by Microsoft), and are padded to 64 bytes per block, although they don't technically use compression blocks. Although not technically correct either, can be looked at as "bytes per pixel", except for DXT1 images where it is technically more correct to say that each pixel is 0.5 bytes, but not exactly correct since size depends on blocks. I guess all you can do is trust that the values below are correct. (I have personally confirmed all are correct except "A8", but it makes sense).

[Image: HIxFDUB.png]

Block Size List:
Code:
DXT1  :  8
DXT3  :  16
DXT5  :  16
BC7   :  16
ARGB8 :  64
RGBA8 :  64
L8    :  16
A8    :  16
LA8   :  32

To calculate the pitch, use the formula below:
Code:
Pitch = Max(1,(Width / 4)) * Max(1,(Height / 4)) * BlockSize

--------------------------------------------------------------------------------------------------------
0x957 - CS1 = 112 (70 hex), CS2 = 116 (74 hex), CS3/CS4 = 22 (16 hex).
0x95B - CS1 = 112 (70 hex), CS2 = 116 (74 hex), CS3/CS4 = 22 (16 hex).

I imagine this is the length of data from (some location) to (some location).

[Image: lmMfONe.png]

--------------------------------------------------------------------------------------------------------
0x99B - The relative image path. This will always be padded/aligned by up to 4 bytes, and the length determines the offset of the rest of the bytes.

[Image: 5x7ngle.png]


DYNAMIC HEADER DATA:

Because the image path has a variable length, the rest of the data is at an arbitrary position. The easiest way for me was to assign a specific byte as a Start Location to find the other positions. The byte that I chose is where the phrase PTexture2D starts (hex sequence: 50 54 65 78 74 75 72 65 32 44), so in this case, the byte that contains 50 in hex (80 decimal) is the "Start Location". From here, the rest of the data can be found at static locations by subtracting a fixed amount from the start location.

[Image: lAHjCEs.png]

So now that you may have a basic idea of how this works, allow me to further complicate it. It's been established the length of the path is variable, but so is the length of the texture format. This means that the starting point now also needs to account for the length of the path to find data beyond this point. To make this much easier, I'll try to create a scheme that is easy to understand where this data resides.

Start location will be referred to as "$".
Texture format length added to start location will be referred to as "#".
Using "+" and "-" will refer in which direction to go from the start location.

Example 1:
$-0x004 means if the starting byte $ is 0xA2B (byte 2603), the data's position can be found at 0xA27 (byte 2599) by subtracting 4 bytes.

Example 2:
$#+0x004 means if the starting byte $ is 0xA2B (byte 2603), and if format # is "ARGB8" (5 digits = 5 bytes), the data's position can be found at 0xA34 (byte 2612) by adding 5 format bytes and 4 offset bytes.


Trails of Cold Steel I, II, III, and IV

The information in this section pertains to all phyre images in all four games.

--------------------------------------------------------------------------------------------------------
$+0x11 - The texture format, following "PTexture2D." yes that is a period. Each digit of the format is represented with 1 byte, so the length in bytes is equal to the number of digits. Several byte locations in my searching scheme require adding the offset to the length of this format. It will always be encapsulated by "00" on both sides, so this could also be useful for coming up with a way to determine the offsets of data.

[Image: R9m1AmJ.png]

Image can be any of the following formats:
Code:
DXT1  - # = 4 bytes - (44 58 54 31)
DXT3  - # = 4 bytes - (44 58 54 33)
DXT5  - # = 4 bytes - (44 58 54 35)
ARGB8 - # = 5 bytes - (41 52 47 42 38)
RGBA8 - # = 5 bytes - (52 47 42 41 38)
L8    - # = 2 bytes - (4C 38)
A8    - # = 2 bytes - (41 38)
LA8   - # = 3 bytes - (4C 41 38)
BC7   - # = 3 bytes - (42 43 37)

--------------------------------------------------------------------------------------------------------
$#+0x1D - This flag should be located 18 bytes after the last byte of where the texture format ends. Like the flag found at 0x034, it is exclusive to phyre headers, and it is tied to the image format.

[Image: gjDrrWg.png]

It is consistent for the image formats:
Code:
L8/A8      : 03
LA8/BC7    : 04
DXT1/3/5   : 05
RGBA/ARGB  : 06


Trails of Cold Steel I

All values can be found by subtracting from the start location.

--------------------------------------------------------------------------------------------------------
$-0x64 - The literal number of mipmaps (top level is not counted) if its a DDS texture; requires the number of mipmaps in both this field and the one below. Always "00" for PNG.

[Image: 2dXpbQb.png]

--------------------------------------------------------------------------------------------------------
$-0x60 - The literal number of mipmaps (top level is not counted) for both PNG and DDS. Unlike standard DDS images, only lower mipmaps are counted and not the base level.

[Image: 2Ym1PPZ.png]

--------------------------------------------------------------------------------------------------------
$-0x5C - Special flag for PNG textures which is always the value "02". For DDS images, this is always "00".

[Image: A9zYfyc.png]

--------------------------------------------------------------------------------------------------------
$-0x54 - The width of the texture, four bytes in length. Little endian.

[Image: B0V8DyV.png]

--------------------------------------------------------------------------------------------------------
$-0x50 - The height of the texture, four bytes in length. Little endian.

[Image: ZIenpLr.png]


Trails of Cold Steel II

All values are the same as CS1, except there is an additional 4 byte offset.

--------------------------------------------------------------------------------------------------------
$-0x68 - The literal number of mipmaps (top level is not counted) if its a DDS texture; requires the number of mipmaps in both this field and the one below. Always "00" for PNG.

[Image: GVPURSX.png]

--------------------------------------------------------------------------------------------------------
$-0x64 - The literal number of mipmaps (top level is not counted) for both PNG and DDS. Unlike standard DDS images, only lower mipmaps are counted and not the base level.

[Image: F6uJq02.png]

--------------------------------------------------------------------------------------------------------
$-0x60 - Special flag for PNG textures which is always the value "02". For DDS images, this is always "00".

[Image: PyS9KtR.png]

--------------------------------------------------------------------------------------------------------
$-0x58 - The width of the texture, four bytes in length. Little endian.

[Image: c6IAAOi.png]

--------------------------------------------------------------------------------------------------------
$-0x54 - The height of the texture, four bytes in length. Little endian.

[Image: uRlsb3E.png]


Trails of Cold Steel III/IV

A lot of redundancy seems to have been removed from this version of phyre images. I have not yet seen any textures in CS3 or CS4 that are not BC7 (I didn't look too hard (yet(someday))), so it is possible that I am missing a bunch of information here.

--------------------------------------------------------------------------------------------------------
$-0x10 - The literal number of mipmaps (top level is not counted). Unlike standard DDS images, only lower mipmaps are counted and not the base level.

[Image: mJDDaGm.png]

--------------------------------------------------------------------------------------------------------
$-0x08 - The width of the texture, four bytes in length. Little endian.

[Image: Axv5hr2.png]

--------------------------------------------------------------------------------------------------------
$-0x04 - The height of the texture, four bytes in length. Little endian.

[Image: OS8vQj6.png]

Donate - Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD
Website Find
Reply
11-07-2018, 11:28 PM
#586
Psycho Away
Member
***
Posts: 90
Threads: 5
Joined: Jun 2015
I think it was my fault for not putting it on Expert Mode before. I can't recall, but I think I did. Anyways, clearly works for v36.3 so you're good. Thank you!
Find
Reply
11-07-2018, 11:50 PM
#587
Bighead Offline
Oversized Cranium
*******
Posts: 1,985
Threads: 15
Joined: Aug 2011
Awesome. Either way, there was definitely problems with the waifu2x code that needed to be fixed. It was only possible to get a 2x upscale with no options. In order to run it in a separate thread, the arguments must be established before sending it off to a new thread. I was trying to create the arguments list in that new thread, and by that point, all the parameters were already lost, so it wasn't taking any options like the scaling factor, the model, etc.
Donate - Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD
Website Find
Reply
11-08-2018, 12:05 AM (This post was last modified: 11-08-2018, 12:18 AM by Admentus.)
#588
Admentus Offline
Nothing but perfection for gaming
*******
Posts: 1,977
Threads: 25
Joined: May 2015
Perhaps a bit off-topic, but I really have to mention it!

Thank you Bighead for making these texture packs for both Cold Steel games. Both games are among my highest ranking titles, and you just made them better even more. Sure, both your texture packs have been around for a while, but your persistence on having a 100% HD retexturing certainly paid off as the recent patches showed. Well... I suppose, you are working on them for the time being.

I purchased both games from gog.com (I prefer purchasing all my titles from there since everything is DRM-free over there, it is one my stand-points, nothing but perfection for gaming). But your texture packs work regardless of the marketplace platform.

Now I just want Falcom and XSeed to collaborate once more and localize Cold Steel III and IV into English.



Hmm, I always wanted to try if I can contribute to Dolphin and work with Visual Studio. But that's a topic for another thread and time. Ok, back to the topic on hand. Except... I having nothing to add for now... Except that your Custom Texture Tool still works as flawless as usual. I should get to working on stuff soon...
Super Mario 64 - Super Smash Bros. 64 - Mario Kart 64 - Zelda 64 - Star Fox 64 - Patreon - Discord
Find
Reply
11-08-2018, 01:50 AM
#589
Bighead Offline
Oversized Cranium
*******
Posts: 1,985
Threads: 15
Joined: Aug 2011
It won't hurt to go off topic for a bit. There isn't much more that can be added to this thread, it's been pretty slow for awhile now. And the tool is stable as far as I can tell, and I doubt I'll be adding many more features to it.

With that said, you're very welcome for the packs. I doubt I'll ever reach a 100% retexture of the game, but I do want to 100% the UI and battle effects. I would eventually like to create some environment textures, but I've already dumped so much time into this pack as it is. The past few weeks have been crazy, I spent pretty much every free moment trying to finish as many textures as possible before the patch release date. I feel bad for Hypatia, her latest Wind Waker pack is just about ready to be released, and I've been holding it up because there are a few things I want to fix before it goes out. Her latest work is incredible, one of the best and most complete texture packs I've ever seen. When it does get released, I will be making a thread here on her behalf so the Dolphin community has a place to find the latest downloads and comment on it, so expect that in the near future.

The Legend of Heroes series is definitely one of my favorites, and Cold Steel I & II are no exception. Trails in the Sky 1-3 are some of my favorite games. I remember playing the Trails of Cold Steel games on PS3 hoping to someday make a texture pack for them (rpcs3 someday in the future?), then the PC ports came from out of nowhere and made my dream a reality. But really it was Durante who deserves all the credit. If not for him, a lot of what is possible now would not be. He worked with me to get many textures working correctly in-game which would not work with Special K (the mod that was previously required to get the textures loaded). Then even made it so ALL textures from my pack scale correctly in-game. Sewer56 was also very helpful, if not for him I wouldn't have compressed PKG files, and the pack would be 3-4x bigger than it is now.

And yes! I really hope CS3 and CS4 get a localization, at this point they have to! I also look forward to the Geofront's translation of Trails From Zero, as I am still missing the Crossbell story (outside of a few subtle references I've stumbled across over time). I tried playing the machine translation and it was barely passable. I believe AO already has a fairly decent translation, but since it's the second game in that series, I'll wait for the first to be finished.
Donate - Custom Texture Tool - Xenoblade Chronicles HD - New Super Mario Bros. Wii HD - Paper Mario: TTYD HD (Contributor) - Skies of Arcadia HD
Website Find
Reply
11-08-2018, 04:34 AM (This post was last modified: 11-08-2018, 05:50 PM by Admentus.)
#590
Admentus Offline
Nothing but perfection for gaming
*******
Posts: 1,977
Threads: 25
Joined: May 2015
(11-08-2018, 01:50 AM)Bighead Wrote: With that said, you're very welcome for the packs. I doubt I'll ever reach a 100% retexture of the game, but I do want to 100% the UI and battle effects. I would eventually like to create some environment textures, but I've already dumped so much time into this pack as it is. The past few weeks have been crazy, I spent pretty much every free moment trying to finish as many textures as possible before the patch release date. I feel bad for Hypatia, her latest Wind Waker pack is just about ready to be released, and I've been holding it up because there are a few things I want to fix before it goes out. Her latest work is incredible, one of the best and most complete texture packs I've ever seen. When it does get released, I will be making a thread here on her behalf so the Dolphin community has a place to find the latest downloads and comment on it, so expect that in the near future.

Bighead, really, don't overwork yourself! Smile

(11-08-2018, 01:50 AM)Bighead Wrote: The Legend of Heroes series is definitely one of my favorites, and Cold Steel I & II are no exception. Trails in the Sky 1-3 are some of my favorite games. I remember playing the Trails of Cold Steel games on PS3 hoping to someday make a texture pack for them (rpcs3 someday in the future?), then the PC ports came from out of nowhere and made my dream a reality. But really it was Durante who deserves all the credit. If not for him, a lot of what is possible now would not be. He worked with me to get many textures working correctly in-game which would not work with Special K (the mod that was previously required to get the textures loaded). Then even made it so ALL textures from my pack scale correctly in-game. Sewer56 was also very helpful, if not for him I wouldn't have compressed PKG files, and the pack would be 3-4x bigger than it is now.

And yes! I really hope CS3 and CS4 get a localization, at this point they have to! I also look forward to the Geofront's translation of Trails From Zero, as I am still missing the Crossbell story (outside of a few subtle references I've stumbled across over time). I tried playing the machine translation and it was barely passable. I believe AO already has a fairly decent translation, but since it's the second game in that series, I'll wait for the first to be finished.

I promise, my last off-topic post here.

Trails in the Sky SC has to be my favorite JRPG of all time. I really would like to play the Crossbell duology too, but I rather would want it to experience if done right. I have been following the Geofront translation for a while recently, but if it is done right that could be interesting indeed. It might get XSeed interested in doing an official translation.

Honestly I don't think that XSeed does not want to do the Crossbell duology localization, it think it is just that Falcom wants Cold Steel III and IV to be a priority for XSEED. That makes sense through, Cold Steel is way more popular, sold better, is more modern and recent and already is halfway ongoing.

It has become my personal mission to support, play and experience every Trails and Ys title made my Falcom being available on PC. I think I first discovered Falcom after I noticed Trails in the Sky SC on gog.com a few years ago. Sooo... I was quite wondering what the hype was all about and the first Trails in the Sky had a discount. Soo... Yeah, you can do the math from there. I was immediately addicted to the Trails series and went straight for Trails in the Sky SC too. Trails in the sky the Third I think was a year later for me? And I couldn't contain my hype any longer with both Cold Steel games. Luckily I found out that Falcom had been making more than just the Trails series. So I investigated into the Ys series too. Perhaps not a favorite of everyone, but Ys VI: The Ark of Napishtim was quite amazing. I think I got into the Ys series when Ys SEVEN was released for PC.

One part that Falcom always absolutely nails is the soundtrack. Every. Single. Game. Every. Time. I never had seen a developer being so consistent in delivering top-notch soundtracks. Ohh yeah, since I got really interested in Falcom I couldn't pass the opportunity to not support Tokyo Xanadu, which is actually just a real-time combat varient of Cold Steel 1 set in the modern real-world of Tokyo.

Of course the Cold Steel games wouldn't be as they were without the help of Durante, XSeed, you of course and every developer. I never had seen a Japanse title being so well polished ever before, and still not. It is even more polished than your average Bethesda and Blizzard game. The fact that both games are still updated with these recent features and additions is proof enough. I love the fact I can use my second monitor for following an online guide while the main game still displays but remains inactive. Even the in-game timer pauses which is quite important for me in RPGs... I just like to know how I need to beat one, over 80 hours with both Cold Steel titles. I even love the fact I can suspend my computer into energy-saving mode and the game still perfectly continues where it left after wakening my PC... Seriously, how many games can do that (*hint* not a lot *hint*). That is some serious eye for detail optimization.

I can't really specify what makes the series so captivating. It's the human-like relationships, the intriguing unrest and conflict between nations, the relaxing moments such having a carnival, making friendships, confronting your foes, perhaps a game of blade during your travels, the epic soundtracks during bosses and raids, Ouroboros of course, the well-balanced bosses (Trails in the Sky SC has to have to best final boss ever made in a JRPG, pure epic), never breaking it's consistency in gameplay and story. There is just so much to like about the series. World-building that not even Bethesda or Rockstar can approximate. No entry feels unnecessary to because the story has to continue in a sequel. No entry wastes your time by padding out your playtime with stupid fetch quests and repetitive and generic kill quests. Each quest literately has a purpose to the gameplay and story. I never thought that in today's world there would be a developer that really understand what makes a game really tick... except for Nintendo of course. Smile

Through I can agree that Cold Steel II didn't have the best momentum at all times. The pacing was a bit off sometimes, but it was never boring nor did I felt my time was being waste. A feeling quite unique in today's standards of gaming.

I don't have a PlayStation right now. I am just your average Nintendo and PC fan. So yeah, I am grateful for Falcom wanting to have there games being published on PC as well which gave me a perfect opportunity to experience them as well.

Seriously, all I need in 2019 is a Nintendo Switch and Cold Steel III and IV.

Ok, I should be done. I hope. Tongue
Super Mario 64 - Super Smash Bros. 64 - Mario Kart 64 - Zelda 64 - Star Fox 64 - Patreon - Discord
Find
Reply
« Next Oldest | Next Newest »
Pages (117): « Previous 1 ... 57 58 59 60 61 ... 117 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 2 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode