Questions about exports

Godot Version

4.3

Question

Hi,
I am making a tower defense game with a large number of levels and their own resources.
I noticed than, in my export, Godot exports by always creating only one .pck file. This one contains all the game elements. All the elements are then loaded a first time with the launch of the game. In my case this does not seem appropriate because it risks overloading the computer’s RAM.
After doing some research I discovered that it is possible to separate the export into several .pck files by making an export for each .pck. It is then possible to obtain the resources of the .pck files from the code.

My questions:
Did I understand correctly?
This method is a bit tedious because it requires making several exports each time one by one manually and placing them manually in my final export folder. Is there a more efficient way?
If I have a base_level class and all my levels inherit from it. If I export each level in a different .pck, will my base_level class be redefined in each .pck? If so, isn’t there a way to avoid this and put base_level only in the .pck linked to the .exe?

If you have one or more answers I’m interested
Thanks in advance

I don’t think Godot loads everything into memory. Have you tried running the app?

1 Like

Everything is in one pack so that it’s contents can be loaded by one file socket jumping where it’s needed, rather than opening a new socket for each resource. The whole file is not loaded into memory all at once, nor all the time.

Oh, well.
That helps me a lot.
How did you get this information?

Reading the source code

https://github.com/godotengine/godot/blob/master/core/io/file_access_pack.h

MD5 checksums of the path and the file’s offset are stored in memory, the rest of the file is loaded when asked for

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.