Add A Command Line Option Equivalent To Export All

by ADMIN 53 views

Project Overview

We are currently working on a game project of significant size, comprising hundreds of files, with the goal of reaching thousands. As part of our build pipeline setup, we are thinking about our project structure and how to automate the build process of our cpk files. Our aim is to make modding and patching/updates easier in the future.

Problem Statement

Currently, a developer can trigger builds based on a certain preset by passing arguments to the editor. This includes using --export-debug or --export-release together with --headless to build the game without opening the editor UI. However, this workflow is limited to a single preset. If a developer wants to build from multiple presets, they must run the command multiple times, which can be time-consuming depending on the project size and number of presets.

The "Export All" Button Limitation

Godot provides a way to deal with this issue in the editor through the "Export all" button in the export window. However, this feature is not available from the command line, which is a significant limitation for developers who want to automate their build process.

Proposed Solution

To overcome this limitation, we propose adding two new command line arguments: --export-debug-all and --export-release-all. These options would allow users to build all their presets from the command line, saving time and effort. This feature would operate under the same logic as the "Export all" button, printing the list of preset names in the output to help users pinpoint the source of any warnings or errors generated by a preset.

Implementation Details

The two new options would take no arguments and operate under the same limitations as the "Export all" button. We have implemented this feature in our project, and it works as expected. However, further testing is required to ensure that it handles edge cases correctly.

Workaround

While it is possible to work around this limitation by calling the engine repeatedly with the right arguments, this approach would come at a significant time cost for big projects. Therefore, incorporating this feature into the core of Godot would be beneficial for developers who want to automate their build process.

Why Core and Not an Add-on?

Providing command line arguments to Godot needs to be done in the core, as it is a fundamental aspect of the engine's functionality. Adding this feature as an add-on in the asset library would not provide the same level of integration and convenience that a core feature would offer.

Code Implementation

Our implementation proposal can be found here. We have tested this feature in our project, and it works as expected. However, further testing is required to ensure that it handles edge cases correctly.

Benefits

The proposed feature would provide several benefits to developers, including:

  • Time-saving: Building all presets from the command line would save time and effort, especially for large projects.
  • Convenience: This feature would provide a convenient way to automate the build process, reducing the need for manual intervention.
  • Improved productivity: By reducing the time and effort required to build all presets, developers can focus on other aspects of their project, improving overall productivity.

Q: What is the current limitation with building presets in Godot?

A: Currently, a developer can trigger builds based on a certain preset by passing arguments to the editor. However, this workflow is limited to a single preset. If a developer wants to build from multiple presets, they must run the command multiple times, which can be time-consuming depending on the project size and number of presets.

Q: Why is the "Export all" button not available from the command line?

A: The "Export all" button is a feature provided by Godot in the editor, but it is not available from the command line. This limitation makes it difficult for developers to automate their build process.

Q: How would the proposed feature work?

A: The proposed feature would add two new command line arguments: --export-debug-all and --export-release-all. These options would allow users to build all their presets from the command line, saving time and effort. This feature would operate under the same logic as the "Export all" button, printing the list of preset names in the output to help users pinpoint the source of any warnings or errors generated by a preset.

Q: Can this feature be worked around with a few lines of script?

A: While it is possible to work around this limitation by calling the engine repeatedly with the right arguments, this approach would come at a significant time cost for big projects. Therefore, incorporating this feature into the core of Godot would be beneficial for developers who want to automate their build process.

Q: Why should this feature be core and not an add-on in the asset library?

A: Providing command line arguments to Godot needs to be done in the core, as it is a fundamental aspect of the engine's functionality. Adding this feature as an add-on in the asset library would not provide the same level of integration and convenience that a core feature would offer.

Q: What are the benefits of this proposed feature?

A: The proposed feature would provide several benefits to developers, including:

  • Time-saving: Building all presets from the command line would save time and effort, especially for large projects.
  • Convenience: This feature would provide a convenient way to automate the build process, reducing the need for manual intervention.
  • Improved productivity: By reducing the time and effort required to build all presets, developers can focus on other aspects of their project, improving overall productivity.

Q: How can I provide feedback or contribute to this feature?

A: We welcome feedback and contributions from the community. You can provide feedback or contribute to this feature by:

  • Filing an issue: Report any issues or concerns you have with the proposed feature on the Godot issue tracker.
  • Contributing code: If you have a solution or patch for this feature, you can contribute it to the Godot repository.
  • Participating in discussions: Join the Godot community forums or Discord channel to discuss this feature and provide feedback.

Q: What is the next step for this feature?

A: We are currently working on implementing this feature and testing it in our project. Once we have a stable implementation, we will submit a pull request to the Godot repository for review and inclusion in the core engine.