Skip to content

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 features or #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_label property. It contains a reference to the current RichTextLabel that 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 string would be better.
  • Added Glyph (C# Only!). The same as glyph_codepoint, but as a System.Text.Rune
  • Added font_size property. 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_relative property. When enabled, the value of pivot is interpreted as a fraction of the Control'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_info now returns improved data:
    • Added version field. This is a stringified Godot version following the display rules, i.e. "4.5"
    • Added commit field. This is the last 6 digits of the commit hash, as a string.
    • Added modules field. This is a string array of features, like "mono" and "double"

Geometry3D

  • Added Geometry3D::compute_convex_mesh_planes.
    • This is the exact opposite of the existing compute_convex_mesh_points method, and returns an array of Planes. Convex geometry collision can be tested by ensuring Plane::is_point_over returns false for every plane, when called with the desired test point. This can also be used to provide planes to other Geometry3D methods.

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 the float or double value is approximately equal to 1. Same behavior as IsZeroApprox, just for 1.
  • Added IsExactlyOne (C# Only!). Returns true if the float or double value is exactly equal to 1.0. Not super useful, and is a micro-optimization unlikely to have any benefits.

Mesh

  • Added static convex_decompose method. This allows performing a convex decomposition on arbitrary geometry without having to create a new Mesh resource, and thus it can be done from any thread. This API may be moved to a different class in a future version.

NodePath

  • Added Self static property (C# Only!). The same as new NodePath(".") but cached.
  • Added Parent static property (C# Only!). The same as new NodePath("..") but cached.

PhysicsServer3D

  • Added new BODY_PARAM_INVERSE_INERTIA_TENSOR enum for body_get_param.
  • Added body_get_shape_disabled method. Counterpart to the existing body_set_shape_disabled.
  • Added area_get_shape_disabled method. Counterpart to the existing area_set_shape_disabled.
  • Added is_shape method. Returns true if the provided RID corresponds to a shape's RID
  • Added is_space method. Returns true if the provided RID corresponds to a space's RID
  • Added is_area method. Returns true if the provided RID corresponds to an area's RID
  • Added is_body method. Returns true if the provided RID corresponds to a body's RID
  • Added is_soft_body method. Returns true if the provided RID corresponds to a soft body's RID
  • Added is_joint method. Returns true if the provided RID corresponds to a joint's RID

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 named bbcode
    The all lowercase bbcode is 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 parsing signal. 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, and Rect2I - Vector2I operators (C# Only!). This translates the Rect2 or Rect2I
  • Added Rect2 & Rect2 and Rect2I & Rect2I operators (C# Only!). Identical to .Intersect()

Shader

  • Added set_include_path. This can be used to override the search location for #include statements, particularly useful in shaders that aren't assigned a resource path.
  • Added get_include_path. Returns the current #include search directory (usually the Shader's resource location, unless overridden by the previous method).
  • #pragma features and #pragma exclusive_variants are now usable in Godot shaders. These allow static compilation of branches in shaders with configurable options in the inspector.
    • #pragma features A B C will add three checkboxes to the editor inspector for A, B, and C toggles respectively.
      • Features operate as flags, and can be mixed and matched.
      • To check a feature, use #ifdef FEATURENAME i.e. #ifdef A
    • #pragma exclusive_variants THING : OPTION1, OPTION2, OPTION3 will add a dropdown to the editor inspector labeled THING, with three options, OPTION1, OPTION2, and OPTION3.
      • Variants are exclusive, and only one value for each variant can be selected at a time.
      • To check a variant, use #ifdef i.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 #if block with #pragma features or #pragma exclusive_variants inside, if that #if is driven by other features/variants.
  • Added set_shader_feature method. Sets the state of a declared feature to a bool value.
  • Added set_shader_variant method. Sets the value of a declared variant to a StringName value (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 as ATTENUATION, without the influence of shadows.
    • SHADOW - The same as ATTENUATION, but this is only the influence of shadows.

Transform3D

  • Added Transform3D * Basis operator (C# Only!). This returns Transform3D and the right-hand (Basis) operand is interpreted as new Transform3D(Vector3.Zero, basis).

Vector2, Vector2I, Vector3, Vector3I, Vector4, and Vector4I

  • Implement IComparable in C#. Comparison sorts by length.
  • Added ManhattanLength(), ChebyshevLength(), ManhattanDistance(), and ChebyshevDistance() (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.