Skip to main content

Tools for reading files from the Decima game engine.

Project description

PyDecima

This package contains a reader utility for .core files used by the Decima game engine, intended for use in exporting assets and datamining. Using PyDecima, resources from one or multiple Decima .cores can be deserialized into Python objects and loaded into a dictionary to enable lookup by their identifier UUID, as well as simple following of cross-file references.

Examples

Initialization

The primary use of this package is through the reader module, which can be used in a script like so:

import pydecima

output_dict = {}
pydecima.reader.set_globals(_game_root=r'C:\HZD_extracted_files', _decima_version='HZDPC')
pydecima.reader.read_objects(r'C:\HZD_extracted_files\localized\sentences\aigenerated\aloy\sentences.core', output_dict)

The above script will populate the output_dict variable with all the resources contained inside the specified .core. _decima_version accepts values of "HZDPC" (default), "HZDPS4", or "DSPC", although currently there is very little support for Death Stranding resource formats. _game_root should be set to the root of your extracted Decima files, and is necessary to enable reference following. An alternative parameter, _game_root_file, can be used, which expects a plaintext file containing only the path that would normally be passed into _game_root. This can be convenient for scripts, since the root path can be stored in a persistent file instead of being entered by the user at runtime.

Parsing resources

With the output_dict variable populated, we can easily iterate through the resources in a .core and read some data.

from pydecima.resources import SentenceResource
from pydecima.enums import ETextLanguages

for resource in output_dict.values():
    if isinstance(resource, SentenceResource):
        localized_text = resource.text.follow(output_dict)
        if localized_text is not None:
            print(f'{resource.name}: {localized_text.language[ETextLanguages.English]}')

The above script will produce a printout of every subtitled line in a dialogue file, prefaced by its internal name.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydecima-1.0.1.tar.gz (142.5 kB view details)

Uploaded Source

Built Distribution

pydecima-1.0.1-py3-none-any.whl (167.6 kB view details)

Uploaded Python 3

File details

Details for the file pydecima-1.0.1.tar.gz.

File metadata

  • Download URL: pydecima-1.0.1.tar.gz
  • Upload date:
  • Size: 142.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pydecima-1.0.1.tar.gz
Algorithm Hash digest
SHA256 503a000ff3dc5681f8b2802c7d684eaff6b86c83c14116f0908729a7b9a49171
MD5 5566a75e0bafc702d4109262d2873458
BLAKE2b-256 67948eb674bb71a88f463a2db590bb851bb095882afa0b43476fda9b9e7f82f4

See more details on using hashes here.

File details

Details for the file pydecima-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pydecima-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 167.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pydecima-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ba693e75e2de053e68d7ac1593ad63cc46d23f0e47660c8e33fc211ee874e8f
MD5 e50201cc7f449d83ed787e99e270dfba
BLAKE2b-256 920596b24611f95ef262553f181414132eb53a3d8ef31761538cb54891eb455c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page