sotn-decomp/tools/splat_ext
Luciano Ciccariello de46f99e2e
New asset manager (#1343)
This aims to deprecate all the Splat tools in `tools/splat_ext` in
favour of a more centralised asset manager. This brings the following
advantages:

* Much faster extraction
* Faster build
* Automatically define `static` symbols or unique names whenever
`static` is not possible
* Allow to embed assets into the output binary
* Drastically simplify `Makefile` by removing all the asset build rules
* Avoid situations where it is not possible to extract and build assets
that is not 4-byte aligned

This is achieved by having the splat YAML targeting a normal C file as
data and have an external tool to take care of the following:

1. Extract asset files straight from the overlay binary file into human
readable file in `assets/st/STAGE_NAME`
2. Build assets as header files that go into `src/st/STAGE_NAME` to just
include them from any C file

This requires each stage header to have the following new format: please
see `src/st/nz0/header.c`

Built assets in `src/st` are ignored by Git.

As for now, for simplicity sake, the steps `make extract_assets` and
`make build_assets` are just executed within `make extract` exclusively
for the US version.

I plan to auto-generate files such as `src/st/nz0/tile_data.c`.

For a first iteration I am aiming to handle the following:

* [X] Extract rooms: `assets/st/*/rooms.json`
* [X] Extract room layers: `assets/st/*/entity_layouts.json`
* [X] Extract tilemap data: `assets/st/*/tilemap_*.bin`
* [X] Extract tilemap definitions: `assets/st/*/tiledef_*.json`
* [X] Extract sprites: `assets/st/*/sprites.json`
* [x] Extract entity layouts
* [X] Build rooms: `src/st/*/rooms.h`
* [X] Build room layers: `src/st/*/layers.h`
* [X] Build tilemap data: `src/st/*/tilemap_*.h`
* [X] Build tilemap definitions: `src/st/*/tiledef_*.h`
* [x] Build sprites (aka `g_SpriteBanks`)
* [x] Build entity layouts
* [x] Allow the tool to suggest how to adjust the Splat config for each
overlay

I want the tool to cover the following stages:
* [x] CEN
* [x] DRE
* ~MAD~ I do not think this can be done, it is way too different from
the other overlays
* [x] NO3
* [x] NP3
* [X] NZ0
* [x] ST0
* [X] WRP
* [x] RWRP
* ~WRP (PSP)~ Maybe in a follow-up PR

For a later iteration I plan on extracting and build:

* Entity GFX thingie
* The CLUT thingie in the header
* Uncompressed GFX data
* Cutscene data
* Blueprints
* The `src/config_us.h` thingie

---------

Co-authored-by: Josh Lory <josh.lory@outlook.com>
2024-07-02 21:38:36 +01:00
..
__init__.py WRP split some data and add new split tools (#109) 2023-03-09 13:32:00 +00:00
accessory_config.json Synchronise asset config with the latest headers (#849) 2023-12-15 13:58:26 -08:00
animset.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
assets.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
ci4.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
cmp.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
enemydefs_config.json Extract g_EnemyDefs with new system (#666) 2023-10-09 09:59:57 +01:00
equipment_config.json Synchronise asset config with the latest headers (#849) 2023-12-15 13:58:26 -08:00
factory_blueprint_config.json Split out data table for func_8011AC3C (#710) 2023-11-07 16:54:59 +00:00
grey4.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
i4.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
music_xa_config.json Extract XA music configs (#778) 2023-11-17 11:43:40 -08:00
palette.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
raw.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
rgba16.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
sfx_config.json Extract SFX data (#783) 2023-11-17 23:40:56 -08:00
spritesheet.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00
subweapondefs_config.json Extract subweapon definitions (#790) 2023-11-19 00:32:27 +00:00
utils.py Update splat to 0.24.4 (#1112) 2024-06-12 18:50:32 +01:00