Skip to content

Instantly share code, notes, and snippets.

@WhalesState
Last active September 26, 2023 13:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WhalesState/b9235efd25115e3f5b44bd3bf75ec15e to your computer and use it in GitHub Desktop.
Save WhalesState/b9235efd25115e3f5b44bd3bf75ec15e to your computer and use it in GitHub Desktop.
Welcome file

Introduction

After three years of working with Godot, I wanted to share my feedback and insights on this powerful game development engine. As a dedicated user of Godot, I have experienced both its strengths and areas where improvements could be made. Through this feedback, I hope to contribute to the ongoing development and growth of the Godot community. Let's dive into the details and explore the strengths and areas for improvement in Godot!

By default, Godot's core features and functionalities are bundled together in a single monolithic binary. This can make it challenging for developers to selectively include or exclude specific features based on their project requirements. This lack of modularity can result in larger binary sizes and potential overhead.


3D within 2D and 2D within 3D!

One of the touted strengths of Godot is its capability to seamlessly integrate 3D elements within a 2D environment and vice versa. While this feature is often highlighted as a major selling point, it is important to acknowledge its limitations and clarify any misconceptions that may arise.


The Role of the Dedicated 2D Engine in Godot and Modularity!

Most 2D games don't require the use of meshes or advanced 3D features. While Godot has a dedicated 2D engine, it doesn't provide a straightforward option to fully disable 3D functionality. This can be seen as a limitation, especially for developers who want to create purely 2D games without any overhead or unnecessary features.

It may seem counterintuitive to have a dedicated 2D engine within Godot without the ability to exclusively use the 2D engine. Godot is designed to be a flexible and versatile game engine that can support a wide range of game development needs. By including both 2D and 3D capabilities, Godot allows developers to seamlessly blend the two and create hybrid games that incorporate elements from both dimensions. This flexibility caters to developers who may want to experiment with mixed 2D and 3D gameplay or transition from 2D to 3D gradually.

When considering the default inclusion of certain nodes in Godot's dedicated 2D engine, it's important to acknowledge that while many games are made with Godot, only a few utilize nodes such as Tree Node, Graph Node, and TextEdit Node. Additionally, it is rare for 2D games to make use of 3D nodes. This raises the question of whether including these nodes by default is the best choice.

One suggestion is to have a stronger, more separated editor that is decoupled from the engine. This editor could ship with the ability to build export templates internally, allowing users to include or exclude specific features and nodes as desired. Furthermore, this editor should be easily installable and updatable without being sandboxed.

While the current inclusion of certain nodes by default in the Godot editor aims to provide consistency and ease of use, as well as a close integration between the editor and engine, the concerns raised highlight the need for a more streamlined and customizable editor experience. Such an editor would cater to the specific needs of developers, offering greater flexibility and efficiency in game development.

Conclusion

  1. Lack of an optimized, dedicated 2D engine: Godot's dedicated 2D engine lacks the ability to have a standalone 2D engine that is small in size and optimized specifically for 2D games by default. This can result in unnecessary overhead and features that are not needed for purely 2D game development.

  2. Unique shader language not optimized for 2D games: The shader language in Godot is not specifically optimized for 2D games as it combines both 2D and 3D shading languages. This can make it challenging to achieve optimal performance and efficiency for 2D graphics rendering.

  3. Full-featured engine by default: Godot's default configuration comes with a comprehensive set of features, which may not be necessary for all game projects. This can lead to larger file sizes and potential performance overhead for games that don't require all the included features. However, manually building the engine to disable specific functionalities can be a challenging and time-consuming process, especially when it comes to generating export templates for different platforms.

Solution

After discussing this with Aaron, he highlighted the engine profile system in Godot. This system allows us to automatically generate a list of classes used by the current project and exclude any unused ones during registration. By leveraging the linker, any dead code, including exposed but unused elements, is automatically removed. While this approach may not be as comprehensive as disabling code with compile flags, it still significantly reduces unnecessary engine code. Aaron has also submitted pull requests that focus on optimizing 2D performance.

For specific 3D disabling, you can check out the following pull requests:

Move 2D and 3D resources to their own folders

Disable registering 3D physics types when 3D is disabled

Move 3D scene import classes to their own folder

These pull requests aim to provide a better disable functionality for 3D features in both the Godot editor and engine.

By utilizing the engine profile system and exploring these pull requests, developers have more control over optimizing their projects and reducing unnecessary code.

In addition, I have a repository called Pixel Engine where I have removed most of the 3D functionality. Building the editor with the optimize=speed option from this repository showcases the significant speed improvements—twice as fast—particularly for pure 2D game development. This repository demonstrates the benefits of removing 3D features from the engine and editor. Feel free to check it out and see how it can enhance your 2D game development experience.

also we have some plans that we can work on:

  1. Provide an action template that can be copied alongside the custom build script generated within the Godot editor. This template should simplify the process of building all export templates at once, without requiring complex C++ setup or the need to download additional tools like Visual Studio or Android Studio. Additionally, a tutorial should be created to guide users on how to utilize these templates effectively.

  2. Focus on enhancing the disable functionality for 3D features in both the Godot editor and engine. The goal is to achieve a comprehensive disable, rather than a partial one, to avoid the need to make modifications to components such as Navigation, Astar, particles, and the OpenGL and Vulkan renderers. Ensuring a full disable of these elements is important, as they may rely on 3D code or scripts in their implementation.

By addressing these points, we can provide developers with a better experience when it comes to building export templates and disabling 3D features in Godot.

collaboration

We invite developers to join us in our efforts to enhance the 2D performance of Godot. Together, we can work towards optimizing the engine and making it even better for 2D game development. If you're passionate about improving the performance of Godot and want to contribute your skills and ideas, we welcome you to join our community. Let's collaborate and create a more efficient and powerful 2D game development experience with Godot. Here are our Discord usernames:

@aaronfranke @whalesstate

Feel free to join us on Discord to discuss and collaborate on improving the 2D performance of Godot. We look forward to connecting with you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment