Code Monkey home page Code Monkey logo

ed8pkg2glb's Introduction

ed8pkg2glb

Converts model data and texture data contained in ED8 .pkg files to GLTF binary format and/or PNG binary format.

Modding help and resources

See Trails Research Group for more resources to assist in modding the game.

Usage

First, download and extract the Win32 version.
Afterwards, drag and drop a single .pkg file onto the executable ed8pkg2glb.exe.
.glb or .png files will be output in the same directory as .pkg.

Output file information

The .glb file can be imported in Blender.
Compatibility with other applications is not guaranteed due to the output file not completely adhering to the GLTF specification.
Due to the fact that the game uses shaders for manipulating the pixel output, the output result may not look exactly as in the game.

The .png file is always output in compressed RGBA format. It is loadable in Blender without any conversion needed.

Compatibility

The following games are known to be compatible with this program:

  • 英雄伝説: 閃の軌跡 / Eiyuu Densetsu: Sen no Kiseki / The Legend of Heroes: Trails of Cold Steel (Vita, PS3, PC, PS4)
  • 英雄伝説: 閃の軌跡 II / Eiyuu Densetsu: Sen no Kiseki II / The Legend of Heroes: Trails of Cold Steel II (Vita, PS3, PC, PS4)
  • 英雄伝説: 閃の軌跡 III / Eiyuu Densetsu: Sen no Kiseki III / The Legend of Heroes: Trails of Cold Steel III (PC, PS4, Switch)
  • 英雄伝説: 閃の軌跡 IV / Eiyuu Densetsu: Sen no Kiseki IV / The Legend of Heroes: Trails of Cold Steel IV (PC, PS4, Switch)
  • 英雄伝説: 創の軌跡 / Eiyuu Densetsu: Hajimari no Kiseki (PC, PS4)
  • 東亰ザナドゥ / Tokyo Xanadu (Vita, PC, PS4)

Extracting a .pkg file from an outer archive

PSARC (PS3/PSVita/PS4)

For PS3 and PSVita, please visit the following page: https://www.psdevwiki.com/ps3/PlayStation_archive_(PSARC)
For PS4, you will need to use the orbis-psarc tool. This utility can be found easily using a search engine.

BRA (PC)

The following program can be used for this purpose: https://heroesoflegend.org/forums/viewtopic.php?t=356

PKA (PC/Switch)

The following program can be used for this purpose: https://github.com/uyjulian/unpackpka

NSP/XCI/ROMFS (Switch)

The following program can be used for this purpose: https://github.com/SciresM/hactool

PKG (PS3)

Use RPCS3 to install the game, then look in dev_hdd0/game/ for the decrypted contents.

PKG (PSVita)

The following programs can be used:
Unpacking the .pkg file: https://github.com/mmozeiko/pkg2zip
Decrypting the unpacked contents: https://github.com/motoharu-gosuto/psvpfstools

PKG (PS4)

You will need to use the orbis-pub-cmd tool. This utility can be found easily using a search engine.

Credits

The PS4, PS3, and Vita image untiling are adapted from here: https://github.com/xdanieldzd/Scarlet/blob/8c56632eb2968e64b6d6fad14af3758e606a127d/Scarlet/Drawing/ImageBinary.cs#L1256
The PS4 texture information are adapted from here: https://zenhax.com/viewtopic.php?f=7&t=7573
The LZ4 decompression is adapted from here: https://gist.github.com/weigon/43e217e69418875a55b31b1a5c89662d
The nislzss/LZ77 decompression is adapted from here: https://github.com/Sewer56/Sen-no-Kiseki-PKG-Sharp/blob/3a458e201aa946add705c6ed6aa1dd49dce00223/D/source/decompress.d#L50
The DXT1/DXT3/DXT5/BC5/BC7 decompression is adapted from here: https://github.com/python-pillow/Pillow/blob/78d258f24d1b6a605754af9f8ac57b665543e8b9/src/libImaging/BcnDecode.c
This project uses the python-zstandard library: https://github.com/indygreg/python-zstandard
Huge thanks to PMONickpop123 for assisting with debugging and feature completeness. He has created many VRChat worlds using a tool based on ed8pkg2glb.

License

The program is licensed under the MIT license. Please check LICENSE for more information.

ed8pkg2glb's People

Contributors

uyjulian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ed8pkg2glb's Issues

Asset containing `fc_chrXXXfYY_conv`

I appreciate that your great helpful information. Let me ask you a question.

I read this page How do I get the high resolution face textures for Sen3, Sen4, and Hajimari? then, I tried to extract the missing textures from the my purchased game data (ToCS IV + DCL), but I can't find any files like fc_chrXXXfYY_conv.

  1. I applied ed8pkg2glb to data/dlc/asset/D3D11/*pkg, but these did not output. I digged at the source code, probably that data/dlc/asset/D3D11/*pkg does not seem to contain that textures.

  2. I expected the highres texture is referenced from the main game's data/asset/D3D11, tried applying unpackpka and ed8pkg2glb to that assets, but could not find them. Similar data exists, but it is still different because the colors are wrong and the UVs do not match.

Could you tell me where I can extract high resolution face/hair textures like fc_chrXXXfYY_conv?

dds to png conversion issue for non-square textures

Example file: Trails into Reverie PC version, I_KISIN_MENU.pkg in assets.pka.

The right half of the resulting 1024x512 .png is blank. The left half consists of interleaved 4px stripes where half the stripes belong on the left and half should be on the right, with appropriate y offsets.

Without having looked at the code, I suspect the 4x4 pixel blocks are laid out in column-major order when they should be in row-major order (or perhaps the other way around).

Increase efficiency of cluster parsing

At the moment, array and pointer fixups are searched for in a loop which decreases the efficiency.
Implement premaps of array and pointer information to improve the efficiency.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.