Godot is an [[MIT License]] licensed 3D/2D game engine written in [[C++]]. - [Website](https://godotengine.org/) - [GitHub](https://github.com/godotengine/godot) - [Documentation](https://docs.godotengine.org/en/stable/) > The Godot Engine is a free, all-in-one, cross-platform game engine that makes it easy for you to create 2D and 3D games. # Notability I tried out Godot in 2023 and continued to use it into 2024, 2025. # Philosophy ## Developers I had a positive back and forth with the devs on a weird bug I encountered. Far better than my interactions with [[Open 3D Engine|O3DE]] and other engines. ## Usability Similar to [[Blender#Philosophy]], Godot is missing a lot of usability features. But Godot has not been around for nearly as long and the dev team is significantly more amenable to discussion in my experience. - No alt-drag gizmo duplication - Some third-party tools do support similar features # Platform Support ## Editor - Linux - Mac - Windows - Android (editor support is experimental) - Web - iOS via Xogot - https://xogot.com/ - https://bsky.app/profile/migueldeicaza.bsky.social/post/3lojavnbtos2m ## Export Supports all OSes that the editor does as well as: - iOS - [Consoles](https://docs.godotengine.org/en/stable/tutorials/platform/consoles.html#doc-consoles) (kinda) ## Architectures Supports x86 32-bit, AMD x86-64, and ARM architectures. ## Programming Language Integrations ### Scripting Supports Godot's own [[GDScript]] and using the [[DotNet]] build of Godot gives access to [[C Sharp]]. The [[C Sharp]] build was sponsored by [[Microsoft]]. ### Custom Modules [Custom modules](https://docs.godotengine.org/en/4.2/contributing/development/core_and_modules/custom_modules_in_cpp.html) in Godot refer to actually loading additional source during the engine build process and recompiling Godot itself with that additional code. The language that Godot is written in is [[C++]] and so modules are naturally in that language as well, but anything that could be integrated with [[C++]] could in theory be integrated in one way or another. This gives you full access to the entire engine, but changes require a full rebuild, and may have other downsides. ### GDExtension The [GDExtension system](https://docs.godotengine.org/en/4.2/tutorials/scripting/gdextension/what_is_gdextension.html) allows compiled code to be loaded at runtime and without recompiling the entire engine. Several programming languages are supported. - [[C++]] (first party support) - [[3. Reference/Software/Programming Languages/C|C]] (first part support, but weird) - Not mentioned in the list of languages - Is explicitly mentioned in the body text - See also [[#GDExtensions in C]] - [[D]] - [[Go]] - [[Haxe]] - [[Rust]] - [[Swift]] - [[V]] - https://github.com/jcweaver997/vgdextension - Orchestrator (a custom [[Visual Programming Language]] for Godot) - https://github.com/Vahera/godot-orchestrator ### Third party Scripting By modifying the engine itself, other languages can be added in directly. Requires a custom build of the engine, but provides tight integration with it as a result. - [[Lua]] - https://github.com/perbone/luascript # Tips ## Building On Linux ```sh scons platform=linuxbsd udev=yes lto=full ``` - `platform=linuxbsd` for the target OS - `lto=full` for link-time optimization, which reduces duplicate code and makes more efficient binaries, used in official builds - `udev=yes` for support for `libudev` which improves the performance and detection of hardware such as controllers (should be enabled by default now?) - https://docs.godotengine.org/en/stable/contributing/development/compiling/optimizing_for_size.html - https://docs.godotengine.org/en/stable/tutorials/inputs/controllers_gamepads_joysticks.html ## Editor Edge Cases with Weird Filenames I [compiled](https://docs.godotengine.org/en/latest/contributing/development/compiling/compiling_for_linuxbsd.html) Godot from source in order to try to solve the issue of Godot's editor silently exiting but so far I haven't gotten it to work. I had a back and forth with a dev on Github as well. Turns out the issue is due to a backslash in the file name, which will cause the editor to crash. [Issue](https://github.com/godotengine/godot/issues/80387) on Github. ## Screenshots in Godot ```python func screenshot(): var date = Time.get_date_string_from_system().replace(".","-") var time = Time.get_time_string_from_system().replace(":","") var screenshot_path = "user://" + "screenshot_" + date + "_" + time + ".png" var image = get_viewport().get_texture().get_image() # player view image.save_png(screenshot_path) print("took screenshot:", screenshot_path) ``` ### Screenshot Location Actually the default user game data locations: - Linux : `~/.local/share/godot/app_userdata/GAME_NAME` - Windows : `%HOME%\AppData\Roaming\Godot\app_userdata\GAME_NAME` ### Screenshots Beyond the Viewport - https://gamedev.stackexchange.com/questions/208215/how-to-take-a-screenshot-beyond-the-viewport ## Exiting Godot Programmatically To tell Godot to exit from [[GDScript]], all it takes is `get_tree().quit()`. - https://docs.godotengine.org/en/stable/tutorials/inputs/handling_quit_requests.html - https://stackoverflow.com/questions/43507875/how-do-i-setup-the-esc-key-to-exit-godot-application ```python func _input(event): if Input.is_action_pressed("ui_cancel"): get_tree().quit() ``` ## Exporting CSG CSG is apparently far less efficient than static meshes, even though with v4.4 Godot integrated a new (much more efficient) CSG library. > Adding too many csg nodes can bog down the performance of your game which is why it's really only good for quickly prototyping levels. You will eventually have to replace the map with a more optimized mesh you create in a separate 3d modeling program. \- Garbaj [comment](https://www.youtube.com/watch?v=BUjCtwLO0S8) > The CSG nodes in Godot are mainly intended for prototyping. There is no built-in support for UV mapping or editing 3D polygons \- official docs Luckily, CSG creations can be exported. - https://github.com/henriquelalves/GodotCSGExporter - https://github.com/xtremezero/CSGExport-Godot ## Resetting Godot During Scene Changes ```python func _ready(): var world = get_node("../WorldEnvironment") as WorldEnvironment var env = world.environment world.environment = null await RenderingServer.frame_post_draw world.environment = env ``` This is code which will not run out of the box because it relies on code not publicly released by the game developer, but may be used as a starting point for fixing SDFGI (Signed Distance Field Global Illumination) issues: ```python # Transition to a new scene await Fade.fade_out().finished var packed_scene: PackedScene = load(to_scene) var new_scene = packed_scene.instantiate() var tree = get_tree() tree.root.remove_child(tree.current_scene) tree.root.add_child(new_scene) tree.current_scene = new_scene # Disable rendering stuff. # `Lookup` is a static helper class I wrote that finds nodes of a certain type. var lights = \ Lookup.children_where(tree.root, func(a): return a is OmniLight3D) for light in lights: light.visible = false var world_env: WorldEnvironment = \ Lookup.child_where(tree.root, func(a): return a is WorldEnvironment) var sdfgi if is_instance_valid(world_env): sdfgi = world_env.environment.sdfgi_enabled world_env.environment.sdfgi_enabled = false # Wait for rendering data to be reset await new_scene.get_tree().process_frame # Re-enable rendering stuff for light in lights: light.visible = true if is_instance_valid(world_env): world_env.environment.sdfgi_enabled = sdfgi Fade.fade_in() ``` - https://cohost.org/fullmoon/post/4788747-empty - https://github.com/godotengine/godot/issues/85642#issuecomment-1838177612 ## GDExtensions in C As far as I can tell, there is no explanation for how to use [[3. Reference/Software/Programming Languages/C|C]] distinct from [[C++]] with Godot 4.x's GDExtensions. > Both files can be generated by the Godot binary directly, which helps ensure that there's a correct sync between the extension API and the Godot binary that will use it. \- [comment](https://github.com/godotengine/godot-headers/pull/107#pullrequestreview-1722331457) on the (apparently unecessary?) `godot-headers` repo ```sh godot --dump-extension-api extension_api.json cp core/extension/gdextension_interface.h godot/ ``` ## VR - https://www.snopekgames.com/tutorial/2023/how-make-vr-game-webxr-godot-4 ## Fix Error Messages After Godot updates, some things may being reporting errors. Removing the `.godot` folder will remove the cache and likely fix the issues. But it will reset a lot of your editor settings as well. - https://www.reddit.com/r/godot/comments/18d0ezj/loads_of_error_messages_when_opening_create_new/ ## Load External Resources at Runtime For user-defined images, audio, video, and 3D models: - https://docs.godotengine.org/en/stable/tutorials/io/runtime_file_loading_and_saving.html ## Place on Surface In Godot 4.4 they added a feature that allows object placement/movement to snap to physics colliders. This doesn't change the orientation of the object, but does allow you to reliably place objects on top of each other. (how to use it?) ```cardlink url: https://github.com/godotengine/godot/pull/96740 title: "Use collision detection ray to reposition an object already in the scene by ryevdokimov · Pull Request #96740 · godotengine/godot" description: "Closes: godotengine/godot-proposals#755Related: #88511Currently only works with one object at a time. Multiple objects would probably be a future PR if desired.Currently does not have a key bind..." host: github.com favicon: https://github.githubassets.com/favicons/favicon.svg image: https://opengraph.githubassets.com/b0da5208de868e0d977d7f287cf99b36964040cb532adb17f84238c9a7f273fa/godotengine/godot/pull/96740 ``` ## Node or Node3D for grouping other nodes? Simple `Node`s are more efficient, but have no concept of "visibility", so it is not easy to hide everything under them. # Resources - [[Godot Add-ons]] - [[Godot Tutorials]] - Themes - https://github.com/passivestar/godot-minimal-theme # Features - Scripting - Script editor - Support for external script editors like Visual Studio Code - GDScript debugger - Live script reloading - Performance - Visual profiler for the rendering pipeline - Performance monitoring tools - Customer performance monitors - Scene Editor - Live scene editing - Plugins - Asset library tools - [3D Tools](https://godotengine.org/asset-library/asset?filter=&category=2&godot_version=&cost=&sort=updated) - [2D Tools](https://godotengine.org/asset-library/asset?filter=&category=1&godot_version=&cost=&sort=updated) - etc - Custom tools built with GDScript - 2D Graphics - Sprites - Parallax - 2D lighting with normal and specular maps - Font rendering with bitmap or rasterized using FreeType - GPU particles with support for custom particle shaders - CPU particles - TileMaps - 2D camera - Path2D to represent paths in 2D space - 2D physics and bodies - 3D Graphics - HDR - Perspective, orthographic, and frustum-offset cameras - Physically-based rendering - Several diffuse shading modes - Several specular shading modes - "ORM" texture support - Real-time lighting - Shadow mapping - Global illumination (baked, voxel, SDF, SSIL, etc) - Reflections - Decals - Sky and shaders - Fog - Volumetric Fog Many more: https://docs.godotengine.org/en/stable/about/list_of_features.html ## Text Styling Uses a variant of [[BBCode]] to add colors and effects to text. - https://github.com/godotengine/godot-demo-projects/tree/master/gui/rich_text_bbcode # Resources - [[Godot Add-ons]] # References ```cardlink url: https://youtu.be/1VUDMFBpdZQ title: "Choosing Your Godot Programming Language: C#, C++, GDScript,..." description: "▶︎ *FREE APP \"Learn GDScript From Zero\"* : https://www.gdquest.com🎓 *GODOT 4 COURSES* : https://school.gdquest.com/godot-4-early-access🎮 *FREE INTERACTIVE ..." host: youtu.be favicon: https://www.youtube.com/s/desktop/accca349/img/favicon_32x32.png image: https://i.ytimg.com/vi/1VUDMFBpdZQ/maxresdefault.jpg ``` - https://github.com/Vivraan/godot-lang-support (mostly for 3.x) - https://godotshaders.com/ (shaders!!)