Skip to content

Add documentation pages on Orphan Resource Explorer and Engine Compilation Config Editor #9751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions tutorials/editor/engine_compilation_config_editor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.. _doc_engine_compilation_config_editor:

Engine Compilation Configuration Editor
=======================================

The "Engine Compilation Configuration Editor" in Godot is a tool that allows developers
to configure and customize the compilation settings for the Godot game engine
while exporting your project as executable.
This includes options for enabling or disabling specific features, text rendering
options, and nodes and classes.

By using this editor, developers can tailor the engine's compilation to suit their
specific project requirements, optimize for size, and manage the inclusion or
exclusion of various engine features.

Usage
=====

To access the tool, navigate to `Project > Tools > Engine Compilation Configuration Editor...`.
You will see the following window:

.. image:: img/engine_compilation_config_editor.webp

Under "Configure Engine Compilation Profile", you will see a comprehensive set of
options that you can enable or disable, grouped under "General Features", "Text
Rendering and Font Options", and "Nodes and Classes".
By default, all features, font rendering options
(except the :ref:`Text Fallback Server <class_TextServerFallback>`),
and classes will be active.
You can click on the items to read their descriptions below.

The settings affect the final size of the exported project; therefore, you may consider
disabling the items that you will not need in your project.
For example, if you develop only 2D games and will never use a 3D-related node in your
project, you may consider disabling `3D Engine` and `3D Physics` from the
`General Feature` section.

In this window, you can create profiles to load later for different projects.
Type a name under `Profile` and save it. This will create a new `.build` file.

If you want to revert your changes back to the original values, you can use
"Reset to Defaults."

You can also use the "Detect From Project" button if you want to quickly select only
the nodes and classes that your project is using, and disable others automatically.

If you still want to have some nodes and resources selected even though you do not
use them, you can force their selection by typing them under "Forced Classes on Detect."
Separate multiple node and class names by a comma (,). For example, writing
``Bone2D, Line2D`` and pressing on "Detect from Project" will keep these two nodes
selected even if the Godot does not detect them in the project's files.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions tutorials/editor/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ in other sections where appropriate. For example, the :ref:`animation editor
project_manager
inspector_dock
project_settings
orphan_resource_explorer
engine_compilation_config_editor
default_key_mapping
customizing_editor

Expand Down
64 changes: 64 additions & 0 deletions tutorials/editor/orphan_resource_explorer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. _doc_orphan_resource_explorer:

Orphan Resource Explorer
========================

The Orphan Resource Explorer is a tool designed to help optimize the size of your project
by identifying resources that lack explicit ownership or are not being used.

Explicit ownership refers to a resource being utilized as a sub-resource or node within
the project. For instance, a script file is not considered orphaned if it is attached
to a node. Similarly, if a :ref:`Sprite2D <class_Sprite2D>` node uses an image
from the project files as a texture, the image will have explicit ownership.
On the other hand, if a script is created using the FileSystem dock's context
menu but not attached to a node, it will be classified as an orphan resource.

.. warning:: This tool will only search for ownerships set through the interface,
not through the code.

Usage
-----

To access the tool, navigate to `Project > Tools > Orphan Resource Explorer...`.
Depending on the project resources and their usage, the tool will display a window
similar to the one shown below:

.. image:: img/orphan_resource_explorer.webp

The "Resource" column presents the tree structure of your project, listing only
the orphaned files. The "Owns" column indicates the number of files that
a resource uses. If this number is greater than zero, you can click on the
eye icon to view its dependencies.

.. note:: The tool will only search the files using their saved states
on the disk, ignoring any unsaved changes.

You can select and delete resources by marking them via checkbox and using the
"Delete Selected..." button.

It's important to note that deleting a resource that owns items may render those
files orphaned if they are not used elsewhere.
If you delete a file using the FileSystem dock that is dependent on another resource,
a warning will be displayed, showing the list of resources using this file.

If you open the dependencies window, you will see a list of files that the selected
resource uses, including their relative paths.
If you have broken dependencies, these will be listed in red.

.. image:: img/orphan_resource_explorer_dep.webp

Normally, renaming or changing the folders of resources is detected automatically
by the Godot, and the dependencies are updated accordingly.
However, if you made the changes outside of Godot while it is closed, the Godot will
not be able to find them.
In this case, the "Fix Broken" button can help you automatically locate them if you
just changed the folder structure.


Alternatively, in this window, you can click on the folder icon of any item to
replace a file with another.
Note that if the scene is currently open in the workspace, the changes will
take effect only after you close and reopen it.

.. tip:: If you would like to view the owners or dependencies of a file in the project,
you can also right-click on a file in the FileSystem dock and choose "View Dependencies" or "View Owners".