Closed akien-mga closed 4 years ago
You can load PCK files by calling Globals.load_resource_pack(String pack_path)
. I think everything else depends of the game and what the user made content can handle, but I guess we could make an example implementation (of the many possible).
Thanks. Then there's the question of how to generate such additional PCK files efficiently. The only solution that comes to mind right now would be that it's require creating a new project with a new engine.cfg
so that it can be used to export a different PCK; but then I guess there might be conflicts between the two engine.cfg
files? Or does the editor have a facility to export a PCK of some files without the engine.cfg?
IINW, the new file overrides the old one. That's good for modding but a problem for files like engine.cfg
.
There is a field in Project Export Settings->Resources to exclude files from export, but I didn't try it with engine.cfg (I think it should work). There is also PCKPacker (requires a build with _TOOLSENABLED / tools=yes no longer required after https://github.com/godotengine/godot/pull/6677) which is exposed to GDScript:
var packer = PCKPacker.new()
packer.pck_start("save/path.pck", int alignment) # no idea what alignment is
packer.add_file("virtual/path/inside/pck", "real/path/to/source/file")
packer.flush(true) # true is verbose
Anyway, I don't think the developer should assume the PCK file has no dangerous files, so it would be better to load the PCK ignoring certain files. I don't know if it's possible right now.
Maybe @punto- can clarify it :)
There is a field in Project Export Settings->Resources to exclude files from export, but I didn't try it with engine.cfg (I think it should work).
I just tried to exclude engine.cfg
, engine.cfb
, *.cfg
, *.cfb
individually and none of them worked. It's still getting bundled with the other resources.
So far we've created the custom pcks using the PCKPacker API, there's no tool to do this. Ideally the editor would allow to group different parts of the project and make different apks with them I guess, and one of them is the "main" one?
On 30 July 2016 at 17:52, surashu notifications@github.com wrote:
There is a field in Project Export Settings->Resources to exclude files from export, but I didn't try it with engine.cfg (I think it should work).
I just tried to exclude engine.cfg, engine.cfb, .cfg, .cfb individually and none of them worked. It's still getting bundled with the other resources.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot-docs/issues/154#issuecomment-236389347, or mute the thread https://github.com/notifications/unsubscribe-auth/AGVmPf52nQIEDYPWAUNb8enRLCDQyMa9ks5qa7mKgaJpZM4ImRVm .
@punto- yes that would be ideal. I want to separate my games' assets between different PCK files to keep things organized
I tested achieving this a while back, if I recall correctly, I exported different pcks via the export menu in the gui and loaded them as described above. I remember that it worked, I just had to name them differently(main one being data.pck). The only trouble was selecting a lot of different resources, even if they were in different folders. So i created this issue to try and make folder selecting easier.
should also make a proper diff/patcher export too :|
On Tue, Oct 11, 2016 at 8:08 PM, KioriSun notifications@github.com wrote:
I tested achieving this a while back, if I recall correctly, I exported different pcks via the export menu in the gui and loaded them as described above. I remember that it worked, I just had to name them differently(main one being data.pck). The only trouble was selecting a lot of different resources, even if they were in different folders. So i created this issue https://github.com/godotengine/godot/issues/3646 to try and make folder selecting easier.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot-docs/issues/154#issuecomment-253073441, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z2xB-q6mC3c7hxmtvAZ4ItZXW2f1cks5qzBbhgaJpZM4ImRVm .
@KioriSun I tried that right now and it has quite some problems. One is with encrypted GDScripts. The debug console is showing it looking for *.gd
files whereas the exported file has an extension of *.gde
. I assume this will also be the case for compiled scripts which would be *.gdc
. Another problem is that now that *.tscn
is the default extension for scenes, when exported, it gets renamed to *.tscn.converted.scn
. The way that 2.1(?) handles it is by adding redirects via engine.cfb
where it basically says things that point to *.tscn
goes to *.tscn.converted.scn
on export.
This works for the originally exported executable with the primary data.pck
file (even the encrypted GDScripts too) but it falls apart on additional PCK files that are later generated separately because they don't get added to the engine.cfb
's redirect list. So yeah, it's pretty messy right now.
@surashu That's really sad to hear. I hope that with 3.0 we'll have a proper bundles system.
As a side-note, I tried doing what i mentioned and it still works as long as you use the binary scene format.(i did not test encrypting the scripts)
According to @akien-mga on godotengine/godot#7943:
There is actually support for exporting and loading multiple packs in the master branch now, which can typically be used for DLCs or mods.
See https://twitter.com/reduzio/status/833185781309177856 and https://twitter.com/reduzio/status/833439304571551744
@zicklag do you know if this can also be easily used to segregate game logic/assets into separate PCK files?
@surashu,
I don't actually know anything about it yet. I've been looking for a way to do this because I need a way for users to package mods. I'm going to try it out as soon as I can get the tools to build Godot from source.
@zicklag I was more thinking about separating the assets PCK from the game logic PCK so they can be updated separately and also so there isn't one big data.pck file that needs to be downloaded. I don't have the time to setup the environment to compile 3.0 at the moment, unfortunately.
@surashu If I can get it compiled and test it out, I'll post what I find. :smiley:
@surashu I was able to build Godot 3.0, but it is not in a stable state right now. I wasn't even able to successfully export a project because there isn't documentation yet on how to build the export templates for Godot 3 yet. The only thing of value that I was able to determine is this:
I think you should be able to do what you want to with this setup, but I don't think Godot 3 is really in a state to be used for development.
@zicklag thanks for checking it out, and yeah, I think waiting for the official alpha would yield better usability.
This is now documented in Exporting packs, patches, and mods, closing.
I remember @punto- mentioning that Godot supports using multiple PCK files to handle game extensions, DLCs, user-made content, etc. This is however not documented as far as I know, so it's something we should write about (hopefully with some pointers from @punto-).