OpenAssetTools icon indicating copy to clipboard operation
OpenAssetTools copied to clipboard

Separate linking from compilation

Open Laupetin opened this issue 9 months ago • 0 comments

Currently OAT does compile assets and link them in the same step. For usability this is not a big problem since it reduces compilation to a single step. However this prevents implementing linking of assets without having code for decompiling them to their source forms like for materials or models.

Since the materials can be quite complex and there's no guarantee for 100% accurate output and i assume this will be the same for other assets as well. Therefore it will be useful to have a compiled form for these assets which can then be fed into a decompiler optionally or be linked again without decompilation.

Another advantage is that compiling won't have to happen on every linking since the compiled form of the assets can be cached to be reused in case the source did not change.

In the future instead of having two main tools: Linker/Unlinker, there will be four main tools:

  • Linker: Links compiled assets into fastfiles/other respective formats
  • Unlinker: Unlinks compiled assets from fastfiles/other respective formats
  • Compiler: Takes in compiled assets and tries to recreate their original source format (best effort)
  • Decompiler: Takes in assets in source form and compiles them

For example in terms of materials this will mean:

  • Source form is material properties in GDT + Material compilation pipeline
  • Compiled form is binary (basically unmodifiable) blob in materials/<name> raw folder

Laupetin avatar Sep 24 '23 14:09 Laupetin