Skip to content

Add optional native resource pack export - #78

Merged
eduardodoria merged 1 commit into
doriaxengine:mainfrom
e1e5en-gd:add-native-resource-pack
Sep 3, 2026
Merged

Add optional native resource pack export#78
eduardodoria merged 1 commit into
doriaxengine:mainfrom
e1e5en-gd:add-native-resource-pack

Conversation

@e1e5en-gd

@e1e5en-gd e1e5en-gd commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixed #77

Project Settings → Build → Pack native resources (experimental)

The setting is stored in the project file:

packNativeResources: true

How it works:

  • exported assets/ and lua/ files are collected into game.pak;
  • each entry stores its logical path, offset, size, XOR key and byte shift;
  • file bytes are lightly obfuscated with byte shift + XOR;
  • Data::open() first tries ResourcePack;
  • if the file exists in game.pak, restored bytes are returned from memory;
  • otherwise normal filesystem loading is used.

Export behavior:

  • Desktop export writes game.pak next to the executable;
  • Android source export writes project/assets/game.pak, so Gradle includes it in APK assets;
  • unpacked exported assets/ and lua/ folders are removed after packing;
  • Web export is unchanged because it already uses Emscripten .data resource bundling.

This is not strong encryption. It only hides resources from direct folder browsing.

image image

@e1e5en-gd
e1e5en-gd force-pushed the add-native-resource-pack branch from 5bd556c to d91e2e3 Compare September 2, 2026 19:30
@mokalux

mokalux commented Sep 2, 2026

Copy link
Copy Markdown

this is a great PR, I keep using the framework I am using because it has encryption, both code and assets!

I am keeping an eye on this really promising engine 🙋‍♂️.

Good job devs 🎇!

@eduardodoria

Copy link
Copy Markdown
Contributor

That is a good job. There are something to improve, but I can help with this.

@eduardodoria
eduardodoria merged commit 53112d0 into doriaxengine:main Sep 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional native resource packing for native exports

3 participants