Skip to content

Conversation

@WhalesState
Copy link
Contributor

@WhalesState WhalesState commented Apr 20, 2025

Allows building the editor using disable_navigation_3d=yes, disable_physics_3d=yes or disable_3d=yes.

I just have submitted my answers for Godot Community poll, noticing that the majority of Godot users focus on 2D games and GUI applications, but yet only 6% are recompiling the engine so I do agree that the cost is more the benefits, but it worth to be updated for those who needs it and until many users be familiar with building 2D templates.

Size Comparison: https://github.com/mounirtohami/godot/actions/runs/16565434882
image

@WhalesState WhalesState force-pushed the editor-2d branch 2 times, most recently from 9b0dbd5 to 3f600da Compare April 20, 2025 05:57
@Chaosus Chaosus added this to the 4.x milestone Apr 20, 2025
@syntaxerror247
Copy link
Member

I’m not sure I see the need for this. Why would you want to build the editor with 3D disabled? It doesn’t offer any real advantage for final projects, since those can already be built without 3D. This change just adds unnecessary checks in the editor code without a clear benefit.

I’d recommend creating a proposal to clearly explain the motivation and potential benefits before moving forward with this PR.

@WhalesState
Copy link
Contributor Author

I’m not sure I see the need for this. Why would you want to build the editor with 3D disabled? It doesn’t offer any real advantage for final projects, since those can already be built without 3D. This change just adds unnecessary checks in the editor code without a clear benefit.

I’d recommend creating a proposal to clearly explain the motivation and potential benefits before moving forward with this PR.

  • Faster builds and smaller binaries: This enables indie developers and contributors targeting 2D-only projects to build the editor faster and generate smaller binaries, reducing complexity. It’s especially valuable for Android editor builds and other constrained environments. It also helps ensure that internal documentation and class listings reflect only the available 2D features, giving users a clearer view of what they can actually use when 3D is disabled.

  • Cleaner and more focused UX for 2D developers: Currently, 3D features are only hidden via the feature profiler, they're still loaded, which adds overhead. With proper 3D disabling at the build level, developers can launch the editor into a truly 2D-focused mode. This improves usability, reduces distraction, and speeds up iteration. It's also a step toward fully disabling 3D drawing methods in the RenderingServer, which will further optimize the workflow for 2D game development.

  • Reduced memory and resource usage: From past experience working on this, I’ve seen firsthand how disabling 3D can significantly lower memory consumption, making the editor more viable on low-spec machines or mobile setups. This can position Godot more favorably when compared to other lightweight 2D engines.

  • Improved modularity and maintainability: This direction aligns well with Godot’s modular architecture. Adding clean, optional 3D support at the editor level increases the engine’s flexibility and opens the door to more specialized editor builds in the future.

This is not just about removing 3D, it’s about giving developers more control over their tools, improving performance, and reducing unnecessary overhead when it’s not needed.

@WhalesState WhalesState changed the title Allow Building Editor with Navigation 3D disabled. Allow building the editor without 3D Physics/Navigation. Apr 20, 2025
@syntaxerror247
Copy link
Member

@WhalesState this is a significant change, it needs a proper proposal.

@WhalesState
Copy link
Contributor Author

WhalesState commented Apr 20, 2025

@WhalesState this is a significant change, it needs a proper proposal.

I understand your concerns, and I'd like to link the PR when it's finished to the proposal if no one ever proposed it.
If you are worry about the conflicts that it may cause then don't worry, using #ifndef rarely causes conflicts.

And it's not significant yet, just one more commit to allow building with disable_3d=yes and I'm done with it then will open a proposal :).

@scgm0
Copy link
Contributor

scgm0 commented Apr 20, 2025

I’m not sure I see the need for this. Why would you want to build the editor with 3D disabled? It doesn’t offer any real advantage for final projects, since those can already be built without 3D. This change just adds unnecessary checks in the editor code without a clear benefit.

I’d recommend creating a proposal to clearly explain the motivation and potential benefits before moving forward with this PR.

For projects using C# but not 3D, it offers some advantages: the C# bindings are generated by the editor, which cannot disable 3D. This means C# will inevitably generate bindings related to 3D, leading to certain issues after export. For example, GetViewport() cannot be used because the C# Viewport has bindings for the World3D property, but the export template lacks both the World3D property and the World3D class, triggering a C# exception.

@AThousandShips
Copy link
Member

The C# side is something that should probably be fixed by other means rather than tweaking the editor, especially since you might want to build different versions of the bindings for different exports etc., and there's various other things you can't disable for the editor and that likely won't ever be possible to disable for the editor (like advanced UI)

@WhalesState
Copy link
Contributor Author

The C# side is something that should probably be fixed by other means rather than tweaking the editor, especially since you might want to build different versions of the bindings for different exports etc., and there's various other things you can't disable for the editor and that likely won't ever be possible to disable for the editor (like advanced UI)

I can find a workaround for the advanced gui but it's not related to this change, we have a real issue that you just said it should be fixed, and soon it will :)

@Delsin-Yu
Copy link
Contributor

Delsin-Yu commented Apr 20, 2025

See #103315
See also https://chat.godotengine.org/channel/dotnet?msg=CtWM33pz3qMNJx2qb

@WhalesState

I agreed that this PR adds too much complexity and maintenance cost if the reason is just for C# bindings generation. The editor feature profile can already cover the need to disable certain editor features, and the pursuit of the minimum export template size doesn't need the editor stripped anyway.

If anyone wishes to fix the C# bind-gen issue, I would recommend implementing such functionality directly in bindings_generator.cpp rather than stripping the whole editor (this also gives more flexibility).

@AThousandShips
Copy link
Member

AThousandShips commented Apr 20, 2025

You shouldn't have to build the editor with all the different configurations you want for any specific export template, that's not really fixing any issue, so I think it's best to not focus on the C# bindings side and instead focus on the need and demand for this specific editor build (it's enough work to keep a few different export templates around for each platform + configuration)

@syntaxerror247
Copy link
Member

This PR is starting to attract some discussion and it's the exact reason, I wanted it to have a proposal attached. So, it can be discussed properly.

@WhalesState
Copy link
Contributor Author

This PR is starting to attract some discussion and it's the exact reason, I wanted it to have a proposal attached. So, it can be discussed properly.

Please do, I'm the less experienced one here and I'm just adding some #ifndef lines to the editor so I'd like to hear from more users who works on 2D games, and more users who are affected by the C# issue, if it fixes a single bug that no one tries to fix then it worth to be discussed, It's also shouldn't be called complex changes because it's just some #ifndef lines that will harm no one, yes it will cause conflicts but they can be easily fixed, just let me finish it and we see how it goes, I'm sure many users will like this change, and especially those who uses the godot editor on android and those who uses Godot for 2D games only, they really deserve a lighter and faster editor.

@Delsin-Yu
Copy link
Contributor

Please do...

You can then open the proposal in https://github.com/godotengine/godot-proposals and link it to this PR.

@scgm0
Copy link
Contributor

scgm0 commented Apr 20, 2025

Someone asked what benefits this PR would bring. I listed the C# example, but you guys said C# should use a better solution and not expect this PR. Hmm, alright, after all, I might be the only one here who's been troubled by that issue for months.
A better solution has already been implemented in the godot-dotnet repository, but it's unrelated to the current godot-sharp. I also desire a superior approach, but it seems unlikely to be realized in the short term. Therefore, I can only pin my hopes on this PR's temporary fix—after all, a stopgap measure is better than no solution at all.

@WhalesState

This comment was marked as outdated.

@MewPurPur
Copy link
Contributor

MewPurPur commented Apr 20, 2025

What's the benefit of this compared to disabling the 3D-specific editor features, which even seem to have a "2D Profile" ready to go? (unless I added the 2D profile and forgot)

image

@AThousandShips
Copy link
Member

Let's wait with any further discussion until we have a proposal to not bog this down in off topic

@WhalesState WhalesState changed the title Allow building the editor without 3D Physics/Navigation. Allow building the editor with 3D disabled, or without 3D Physics/Navigation. Apr 20, 2025
@WhalesState WhalesState marked this pull request as ready for review April 20, 2025 14:52
@WhalesState WhalesState requested review from a team as code owners April 20, 2025 14:52
@WhalesState WhalesState force-pushed the editor-2d branch 4 times, most recently from fec9128 to 304fb60 Compare August 13, 2025 14:50
@WhalesState WhalesState force-pushed the editor-2d branch 6 times, most recently from 9ee197d to 236afa4 Compare August 20, 2025 17:27
@WhalesState WhalesState force-pushed the editor-2d branch 5 times, most recently from 61dbbb2 to 2f785cf Compare August 29, 2025 03:26
@WhalesState WhalesState force-pushed the editor-2d branch 2 times, most recently from 185bf9c to be1d49e Compare September 5, 2025 02:30
@WhalesState WhalesState force-pushed the editor-2d branch 2 times, most recently from 2b685e0 to 740b841 Compare September 14, 2025 19:13
@WhalesState WhalesState force-pushed the editor-2d branch 7 times, most recently from c0cebb3 to 6022ee7 Compare October 4, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants