Godot Engine: Conservatory Edition
The Conservatory runs on a custom version of the Godot game engine (specifically a fork of 4.5.1) with modifications ranging from "generally helpful" to "required for proper function". This page outlines the features that have been added or changed.
To view the original contributors and creators, please visit https://godotengine.org/license.
Issues
You should report issues to my repository rather than the official repository. Note that most engine bugs are not likely to be fixed as this a "for me" project.
Current Known Issues
- Editing a shader which has variants (via
#pragma featuresor#pragma exclusive_variants) can very easily cause the Godot editor to crash.
Changes By Type
ConservatoryDebugBridge
New class. This class is largely internal. It allows debug versions of the engine to hook into The Conservatory itself, permitting the C# debugger to also debug the engine's C++ code using its associated debug files.
NoiseExt
New class. This class is a virtual implementation of Noise and allows user-defined implementations. Vitally, this allows it to be used in NoiseTexture2D and NoiseTexture3D, providing alternatives to FastNoiseLite.
RayCast3DDirect and ShapeCast3DDirect
New classes. These two classes supplement PhysicsServer3D.intersect_ray and PhysicsServer3D.intersect_shape respectively. Unlike these methods, and the original Node-based counterparts RayCast3D and ShapeCast3D, these "direct" variations are not nodes, and do not require access to the scene tree. They are designed for primarily static use, but can be instanced, and can often be much more convenient to work with in advanced multithreaded environments like that of The Conservatory.
The reason using these instances (or using them statically) is a better choice over PhysicsServer3D.intersect_ray and PhysicsServer3D.intersect_shape is because these do not return a Dictionary to store their results; they give a result instance directly.
RayCastResult and ShapeCastResult
New classes. The result containers for the aforementioned RayCast3DDirect and ShapeCast3DDirect classes.
SimulationDomain
New class. This is a Viewport (* by technicality), but rather than rendering to the screen, it contains both a 2D and 3D world so that it can perform rendering and physics simulation. This is basically an isolated box that contains an entire world, and is used to have multiple worlds loaded simultaneously. SimulationDomains can be made Active to cause them to override the "primary world" of the game, which is what is displayed on screen.
n.b. This extends Viewport, but only so that nodes which search for a Viewport will be given the SimulationDomain and thus when they query for the viewport's World2D or World3D, they get the ones for the isolated environment rather than the game itself.
CharFXTransform
- Added
text_labelproperty. It contains a reference to the currentRichTextLabelthat the effect is rendering for. - Added
glyph_codepoint. It returns the first unicode codepoint of the rendered character.- This is primarily useful in English, but some languages may mishandle this and so it is considered unsafe. A better implementation providing a
stringwould be better.
- This is primarily useful in English, but some languages may mishandle this and so it is considered unsafe. A better implementation providing a
- Added
Glyph(C# Only!). The same asglyph_codepoint, but as aSystem.Text.Rune - Added
font_sizeproperty. represents the size of the font as of the currently rendered character, respective of text styling. - Properties which were previously writable but which did not do anything when written to have been made read-only.
Control
- Added
pivot_is_relativeproperty. When enabled, the value ofpivotis interpreted as a fraction of theControl's size.
n.b. this is different than the Godot 4.6 feature and is not a backport. It is not compatible with new code.
Engine
Engine::get_version_infonow returns improved data:- Added
versionfield. This is a stringified Godot version following the display rules, i.e."4.5" - Added
commitfield. This is the last 6 digits of the commit hash, as a string. - Added
modulesfield. This is a string array of features, like"mono"and"double"
- Added
Geometry3D
- Added
Geometry3D::compute_convex_mesh_planes.- This is the exact opposite of the existing
compute_convex_mesh_pointsmethod, and returns an array ofPlanes. Convex geometry collision can be tested by ensuringPlane::is_point_overreturnsfalsefor every plane, when called with the desired test point. This can also be used to provide planes to otherGeometry3Dmethods.
- This is the exact opposite of the existing
MaterialStorage
- Modified
global_shader_parameter_get. It will no longer raise an error and return the default value, now instead returning the real value of the global uniform.
n.b. the method has not been improved! All of its drawbacks that led to it being locked away are still very real. The Conservatory simply uses this method to initialize its own shader globals class, which can be safely read from and written to in real time.
Mathf
- Added
IsOneApprox(C# Only!). Returns true if thefloatordoublevalue is approximately equal to1. Same behavior asIsZeroApprox, just for1. - Added
IsExactlyOne(C# Only!). Returns true if thefloatordoublevalue is exactly equal to1.0. Not super useful, and is a micro-optimization unlikely to have any benefits.
Mesh
- Added static
convex_decomposemethod. This allows performing a convex decomposition on arbitrary geometry without having to create a newMeshresource, and thus it can be done from any thread. This API may be moved to a different class in a future version.
NodePath
- Added
Selfstatic property (C# Only!). The same asnew NodePath(".")but cached. - Added
Parentstatic property (C# Only!). The same asnew NodePath("..")but cached.
PhysicsServer3D
- Added new
BODY_PARAM_INVERSE_INERTIA_TENSORenum forbody_get_param. - Added
body_get_shape_disabledmethod. Counterpart to the existingbody_set_shape_disabled. - Added
area_get_shape_disabledmethod. Counterpart to the existingarea_set_shape_disabled. - Added
is_shapemethod. Returnstrueif the providedRIDcorresponds to a shape'sRID - Added
is_spacemethod. Returnstrueif the providedRIDcorresponds to a space'sRID - Added
is_areamethod. Returnstrueif the providedRIDcorresponds to an area'sRID - Added
is_bodymethod. Returnstrueif the providedRIDcorresponds to a body'sRID - Added
is_soft_bodymethod. Returnstrueif the providedRIDcorresponds to a soft body'sRID - Added
is_jointmethod. Returnstrueif the providedRIDcorresponds to a joint'sRID
PhysicsTestMotionResult3D
- Exposed
get_collider_angular_velocity()to gdscript and C#. Purpose is self-explanatory, returning the angular velocity of the collider that was hit, if it had any.
RichTextLabel
- Added
virtual string BBCode { get; }(C# Only!). This is a replacement to the unclear requirement of a Godot property namedbbcode
The all lowercasebbcodeis still supported. - Added
RichTextLabel.InstallEffect<T>()(C# Only!). Utility method that instantiates a new instance of the effect for use in the label. - Added
RichTextLabel.PushCustomfx<T>()(C# Only!). Utility method that pushes a custom effect of the given type to the effect stack. - Added
parsingsignal. This fires both before and after the bbcode in the text is parsed.
StringName
- Added
StringName.Empty(C# Only!). GDScript can continue to use&"", which is already optimized in gdscript.
StyleBox
- Added
_should_draw()method which can be used to disable drawing.
Rect2 and Rect2I
- Added static method
FromSize(C# Only!) which creates a new instance at[0, 0]with the specified size. - Added
Rect2 + Vector2,Rect2I + Vector2I,Rect2 - Vector2, andRect2I - Vector2Ioperators (C# Only!). This translates theRect2orRect2I - Added
Rect2 & Rect2andRect2I & Rect2Ioperators (C# Only!). Identical to.Intersect()
Shader
- Added
set_include_path. This can be used to override the search location for#includestatements, particularly useful in shaders that aren't assigned a resource path. - Added
get_include_path. Returns the current#includesearch directory (usually theShader's resource location, unless overridden by the previous method). #pragma featuresand#pragma exclusive_variantsare now usable in Godot shaders. These allow static compilation of branches in shaders with configurable options in the inspector.#pragma features A B Cwill add three checkboxes to the editor inspector forA,B, andCtoggles respectively.- Features operate as flags, and can be mixed and matched.
- To check a feature, use
#ifdef FEATURENAMEi.e.#ifdef A
#pragma exclusive_variants THING : OPTION1, OPTION2, OPTION3will add a dropdown to the editor inspector labeledTHING, with three options,OPTION1,OPTION2, andOPTION3.- Variants are exclusive, and only one value for each variant can be selected at a time.
- To check a variant, use
#ifdefi.e.#ifdef THING_OPTION1
- Features and variants should never be locked behind static branches controlled by other features/variants. This is currently erroneously possible and will cause a crash. That is, don't have an
#ifblock with#pragma featuresor#pragma exclusive_variantsinside, if that#ifis driven by other features/variants.
- Added
set_shader_featuremethod. Sets the state of a declared feature to aboolvalue. - Added
set_shader_variantmethod. Sets the value of a declared variant to aStringNamevalue (which must correspond to one of the defined possible values, and will raise an exception otherwise). - Spatial
light()function in shaders now exposes more internal data, including:LIGHT_POSITION- The position of the light, in view space.LIGHT_VERTEX_POSITION- The position of the geometry that the light is shining on, in view space.PHYSICAL_ATTENUATION- The same asATTENUATION, without the influence of shadows.SHADOW- The same asATTENUATION, but this is only the influence of shadows.
Transform3D
- Added
Transform3D * Basisoperator (C# Only!). This returnsTransform3Dand the right-hand (Basis) operand is interpreted asnew Transform3D(Vector3.Zero, basis).
Vector2, Vector2I, Vector3, Vector3I, Vector4, and Vector4I
- Implement
IComparablein C#. Comparison sorts by length. - Added
ManhattanLength(),ChebyshevLength(),ManhattanDistance(), andChebyshevDistance()(C# Only!). These methods measure the length or distance of the vector in Manhattan Distance and Chebyshev Distance respectively. - Added
IsExactlyZero(C# Only!). This is an optimized bitwise check.