reckfellENGINE

Engine

Provides access to engine properties.

On this page
class EngineReckfellSharp

Provides access to engine properties.

The Engine singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. It also stores information about the current build of Reckfell, such as the current version.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties8

MaxFpsProperty
# MaxFps
C#
public static int MaxFps { get; set; }

Live rendering frame-rate cap. Zero removes this cap, but does not disable V-Sync or guarantee achieved FPS. Changing this property does not rewrite application/run/max_fps; writing that setting with SetSetting does not change the live property either.

MaxPhysicsStepsPerFrameProperty
# MaxPhysicsStepsPerFrame
C#
public static int MaxPhysicsStepsPerFrame { get; set; }

The maximum number of physics steps that can be simulated each rendered frame. Note: The default value is tuned to prevent expensive physics simulations from triggering even more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than 1 / max_physics_steps_per_frame of Engine.PhysicsTicksPerSecond. This occurs even if delta is consistently used in physics calculations. To avoid this, increase Engine.MaxPhysicsStepsPerFrame if you have increased Engine.PhysicsTicksPerSecond significantly above its default value.

PhysicsJitterFixProperty
# PhysicsJitterFix
C#
public static double PhysicsJitterFix { get; set; }

How much physics ticks are synchronized with real time. If 0 or less, the ticks are fully synchronized. Higher values cause the in-game clock to deviate more from the real clock, but they smooth out framerate jitters. Note: The default value of 0.5 should be good enough for most cases; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. Note: When using a custom physics interpolation solution, or within a network game, it's recommended to disable the physics jitter fix by setting this property to 0.

PhysicsTicksPerSecondProperty
# PhysicsTicksPerSecond
C#
public static int PhysicsTicksPerSecond { get; set; }

Physics tick frequency. Ticks and rendered frames need not be one-to-one; increasing frequency needs CPU measurement and does not repair filters, geometry or arithmetic precision.

PrintErrorMessagesProperty
# PrintErrorMessages
C#
public static bool PrintErrorMessages { get; set; }

If false, stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the ProjectSettings.application/run/disable_stderr project setting. Note: This property does not impact the editor's Errors tab when running a project from the editor. Warning: If set to false anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a @tool script, this will also impact the editor itself. Do not report bugs before ensuring error messages are enabled (as they are by default).

PrintToStdOutProperty
# PrintToStdOut
C#
public static bool PrintToStdOut { get; set; }

If false, stops printing messages (for example using ReckfellApi.Print) to the console, log files, and editor Output log. This property is equivalent to the ProjectSettings.application/run/disable_stdout project setting. Note: This does not stop printing errors or warnings produced by scripts to the console or log files, for more details see Engine.PrintErrorMessages.

SingletonProperty
# Singleton
C#
public static EngineInstance Singleton { get; }
TimeScaleProperty
# TimeScale
C#
public static double TimeScale { get; set; }

Game-time scale. It neither measures actual FPS nor replaces pause/ProcessMode. Check time-dependent forces, timers and input for the intended scenario.

Methods41

CaptureScriptBacktracesReckfell.Collections.Array<ScriptBacktrace>
# CaptureScriptBacktraces
C#
public static Reckfell.Collections.Array<ScriptBacktrace> CaptureScriptBacktraces(bool includeVariables = false);

Captures and returns backtraces from all registered script languages. By default, the returned ScriptBacktrace will only contain stack frames in editor builds and debug builds. To enable them for release builds as well, you need to enable ProjectSettings.debug/settings/csharp/always_track_call_stacks. If include_variables is true, the backtrace will also include the names and values of any global variables (e.g. autoload singletons) at the point of the capture, as well as local variables and class member variables at each stack frame. This will however will only be respected when running the game with a debugger attached, like when running the game from the editor. To enable it for export builds as well, you need to enable ProjectSettings.debug/settings/csharp/always_track_local_variables. Warning: When include_variables is true, any captured variables can potentially (e.g. with C# backtraces) be their actual values, including any object references. This means that storing such a ScriptBacktrace will prevent those objects from being deallocated, so it's generally recommended not to do so.

Parameters
NameTypeDefault
includeVariablesboolfalse
Returns Reckfell.Collections.Array<ScriptBacktrace>
GetArchitectureNamestring
# GetArchitectureName
C#
public static string GetArchitectureName();

Returns the name of the CPU architecture the Reckfell binary was built for. Possible return values include "x86_64", "x86_32", "arm64", "arm32", "rv64", "ppc64", "loongarch64", "wasm64", and "wasm32". To detect whether the current build is 64-bit, or the type of architecture, don't use the architecture name. Instead, use OS.HasFeature to check for the "64" feature tag, or tags such as "x86" or "arm". See the Feature Tags documentation for more details. Note: This method does not return the name of the system's CPU architecture (like OS.GetProcessorName). For example, when running an x86_32 Reckfell binary on an x86_64 system, the returned value will still be "x86_32".

Returns string
GetAuthorInfoReckfell.Collections.Dictionary
# GetAuthorInfo
C#
public static Reckfell.Collections.Dictionary GetAuthorInfo();

Returns the engine author information as a Reckfell.Collections.Dictionary, where each entry is an Reckfell.Collections.Array of strings with the names of notable contributors to the Reckfell Engine: lead_developers, founders, project_managers, and developers.

Returns Reckfell.Collections.Dictionary
GetCopyrightInfoReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetCopyrightInfo
C#
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetCopyrightInfo();

Returns an Reckfell.Collections.Array of dictionaries with copyright information for every component of Reckfell's source code. Every Reckfell.Collections.Dictionary contains a name identifier, and a parts array of dictionaries. It describes the component in detail with the following entries:

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetDonorInfoReckfell.Collections.Dictionary
# GetDonorInfo
C#
public static Reckfell.Collections.Dictionary GetDonorInfo();

Returns a Reckfell.Collections.Dictionary of categorized donor names. Each entry is an Reckfell.Collections.Array of strings: {platinum_sponsors, gold_sponsors, silver_sponsors, bronze_sponsors, mini_sponsors, gold_donors, silver_donors, bronze_donors}

Returns Reckfell.Collections.Dictionary
GetFramesDrawnint
# GetFramesDrawn
C#
public static int GetFramesDrawn();

Returns the total number of frames drawn since the engine started. Note: On headless platforms, or if rendering is disabled with --disable-render-loop via command line, this method always returns 0. See also Engine.GetProcessFrames.

Returns int
GetFramesPerSeconddouble
# GetFramesPerSecond
C#
public static double GetFramesPerSecond();

Returns the average frames rendered every second (FPS), also known as the framerate.

Returns double
GetLicenseInfoReckfell.Collections.Dictionary
# GetLicenseInfo
C#
public static Reckfell.Collections.Dictionary GetLicenseInfo();

Returns a Reckfell.Collections.Dictionary of licenses used by Reckfell and included third party components. Each entry is a license name (such as "Expat(https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants)") and its associated text.

Returns Reckfell.Collections.Dictionary
GetLicenseTextstring
# GetLicenseText
C#
public static string GetLicenseText();

Returns the full Reckfell license text.

Returns string
GetMainLoopMainLoop
# GetMainLoop
C#
public static MainLoop GetMainLoop();

Returns the instance of the MainLoop. This is usually the main EntityTree and is the same as Entity.GetTree. Note: The type instantiated as the main loop can changed with ProjectSettings.application/run/main_loop_type.

Returns MainLoop
GetMaxFpsint
# GetMaxFps
C#
public static int GetMaxFps();
Returns int
GetMaxPhysicsStepsPerFrameint
# GetMaxPhysicsStepsPerFrame
C#
public static int GetMaxPhysicsStepsPerFrame();
Returns int
GetPhysicsFramesulong
# GetPhysicsFrames
C#
public static ulong GetPhysicsFrames();

Returns the total number of frames passed since the engine started. This number is increased every physics frame. See also Engine.GetProcessFrames. This method can be used to run expensive logic less often without relying on a Timer:

C#
public override void _PhysicsProcess(double delta)
{
    base._PhysicsProcess(delta);

    if (Engine.GetPhysicsFrames() % 2 == 0)
    {
        // Run expensive logic only once every 2 physics frames here.
    }
}
Returns ulong
GetPhysicsInterpolationFractiondouble
# GetPhysicsInterpolationFraction
C#
public static double GetPhysicsInterpolationFraction();

The between-tick fraction for an intermediate rendered pose. Used with retained previous/current state; it neither improves physics accuracy by itself nor measures input latency.

Returns double
GetPhysicsJitterFixdouble
# GetPhysicsJitterFix
C#
public static double GetPhysicsJitterFix();
Returns double
GetPhysicsTicksPerSecondint
# GetPhysicsTicksPerSecond
C#
public static int GetPhysicsTicksPerSecond();
Returns int
GetProcessFramesulong
# GetProcessFrames
C#
public static ulong GetProcessFrames();

Returns the total number of frames passed since the engine started. This number is increased every process frame, regardless of whether the render loop is enabled. See also Engine.GetFramesDrawn and Engine.GetPhysicsFrames. This method can be used to run expensive logic less often without relying on a Timer:

C#
public override void _Process(double delta)
{
    base._Process(delta);

    if (Engine.GetProcessFrames() % 5 == 0)
    {
        // Run expensive logic only once every 5 process (render) frames here.
    }
}
Returns ulong
GetScriptLanguageScriptLanguage
# GetScriptLanguage
C#
public static ScriptLanguage GetScriptLanguage(int index);

Returns an instance of a ScriptLanguage with the given index.

Parameters
NameTypeDefault
indexint—
Returns ScriptLanguage
GetScriptLanguageCountint
# GetScriptLanguageCount
C#
public static int GetScriptLanguageCount();

Returns the number of available script languages. Use with Engine.GetScriptLanguage.

Returns int
GetSingletonReckfellObject
# GetSingleton
C#
public static ReckfellObject GetSingleton(StringName name);

Returns the global singleton with the given name, or null if it does not exist. Often used for plugins. See also Engine.HasSingleton and Engine.GetSingletonList. Note: Global singletons are not the same as autoloaded nodes, which are configurable in the project settings.

Parameters
NameTypeDefault
nameStringName—
Returns ReckfellObject
GetSingletonListstring[]
# GetSingletonList
C#
public static string[] GetSingletonList();

Returns a list of names of all available global singletons. See also Engine.GetSingleton.

Returns string[]
GetTimeScaledouble
# GetTimeScale
C#
public static double GetTimeScale();
Returns double
GetVersionInfoReckfell.Collections.Dictionary
# GetVersionInfo
C#
public static Reckfell.Collections.Dictionary GetVersionInfo();

Returns the current engine version information as a Reckfell.Collections.Dictionary containing the following entries:

  • major - Major version number as an int;
  • minor - Minor version number as an int;
  • patch - Patch version number as an int;
  • hex - Full version encoded as a hexadecimal int with one byte (2 hex digits) per number (see example below);
  • status - Status (such as "beta", "rc1", "rc2", "stable", etc.) as a String;
  • build - Build name (e.g. "custom_build") as a String;
  • hash - Full Git commit hash as a String;
  • timestamp - Holds the Git commit date UNIX timestamp in seconds as an int, or 0 if unavailable;
  • version and string - The public major.minor.patch release version, including a zero patch. Build configuration and Git identity are separate diagnostic fields. The hex value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be 0x03010C. Note: The hex value is still an [int] internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for quick version comparisons from code:
C#
if ((int)Engine.GetVersionInfo()["hex"] >= 0x040100)
{
    // Do things specific to version 4.1 or later.
}
else
{
    // Do things specific to versions before 4.1.
}
Returns Reckfell.Collections.Dictionary
GetWriteMoviePathstring
# GetWriteMoviePath
C#
public static string GetWriteMoviePath();

Returns the path to the MovieWriter's output file, or an empty string if the engine wasn't started in Movie Maker mode. The default path can be changed in ProjectSettings.editor/movie_writer/movie_file.

Returns string
HasSingletonbool
# HasSingleton
C#
public static bool HasSingleton(StringName name);

Returns true if a singleton with the given name exists in the global scope. See also Engine.GetSingleton.

C#
ReckfellApi.Print(Engine.HasSingleton("OS"));          // Prints True
ReckfellApi.Print(Engine.HasSingleton("Engine"));      // Prints True
ReckfellApi.Print(Engine.HasSingleton("AudioServer")); // Prints True
ReckfellApi.Print(Engine.HasSingleton("Unknown"));     // Prints False

Note: Global singletons are not the same as autoloaded nodes, which are configurable in the project settings.

Parameters
NameTypeDefault
nameStringName—
Returns bool
IsEditorHintbool
# IsEditorHint
C#
public static bool IsEditorHint();

Returns true if the script is currently running inside the editor, otherwise returns false. This is useful for @tool scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor:

C#
if (Engine.IsEditorHint())
    DrawGizmos();
else
    SimulatePhysics();

See Running code in the editor in the documentation for more information. Note: To detect whether the script is running on an editor build (such as when pressing OS.HasFeature with the "editor" argument instead. OS.has_feature("editor") evaluate to true both when the script is running in the editor and when running the project from the editor, but returns false when run from an exported project.

Returns bool
IsEmbeddedInEditorbool
# IsEmbeddedInEditor
C#
public static bool IsEmbeddedInEditor();

Returns true if the engine is running embedded in the editor. This is useful to prevent attempting to update window mode or window flags that are not supported when running the project embedded in the editor.

Returns bool
IsInPhysicsFramebool
# IsInPhysicsFrame
C#
public static bool IsInPhysicsFrame();

Returns true if the engine is inside the fixed physics process step of the main loop.

Returns bool
IsPrintingErrorMessagesbool
# IsPrintingErrorMessages
C#
public static bool IsPrintingErrorMessages();
Returns bool
IsPrintingToStdOutbool
# IsPrintingToStdOut
C#
public static bool IsPrintingToStdOut();
Returns bool
RegisterScriptLanguageError
# RegisterScriptLanguage
C#
public static Error RegisterScriptLanguage(ScriptLanguage language);

Registers a ScriptLanguage instance to be available with ScriptServer. Returns:

  • OK on success;
  • ERR_UNAVAILABLE if ScriptServer has reached the limit and cannot register any new language;
  • ERR_ALREADY_EXISTS if ScriptServer already contains a language with similar extension/name/type.
Parameters
NameTypeDefault
languageScriptLanguage—
Returns Error
RegisterSingletonvoid
# RegisterSingleton
C#
public static void RegisterSingleton(StringName name, ReckfellObject instance);

Registers the given ReckfellObject instance as a singleton, available globally under name. Useful for plugins.

Parameters
NameTypeDefault
nameStringName—
instanceReckfellObject—
SetMaxFpsvoid
# SetMaxFps
C#
public static void SetMaxFps(int maxFps);
Parameters
NameTypeDefault
maxFpsint—
SetMaxPhysicsStepsPerFramevoid
# SetMaxPhysicsStepsPerFrame
C#
public static void SetMaxPhysicsStepsPerFrame(int maxPhysicsSteps);
Parameters
NameTypeDefault
maxPhysicsStepsint—
SetPhysicsJitterFixvoid
# SetPhysicsJitterFix
C#
public static void SetPhysicsJitterFix(double physicsJitterFix);
Parameters
NameTypeDefault
physicsJitterFixdouble—
SetPhysicsTicksPerSecondvoid
# SetPhysicsTicksPerSecond
C#
public static void SetPhysicsTicksPerSecond(int physicsTicksPerSecond);
Parameters
NameTypeDefault
physicsTicksPerSecondint—
SetPrintErrorMessagesvoid
# SetPrintErrorMessages
C#
public static void SetPrintErrorMessages(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetPrintToStdOutvoid
# SetPrintToStdOut
C#
public static void SetPrintToStdOut(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetTimeScalevoid
# SetTimeScale
C#
public static void SetTimeScale(double timeScale);
Parameters
NameTypeDefault
timeScaledouble—
UnregisterScriptLanguageError
# UnregisterScriptLanguage
C#
public static Error UnregisterScriptLanguage(ScriptLanguage language);

Unregisters the ScriptLanguage instance from ScriptServer. Returns:

  • OK on success;
  • ERR_DOES_NOT_EXIST if the language is not registered in ScriptServer.
Parameters
NameTypeDefault
languageScriptLanguage—
Returns Error
UnregisterSingletonvoid
# UnregisterSingleton
C#
public static void UnregisterSingleton(StringName name);

Removes the singleton registered under name. The singleton object is not freed. Only works with user-defined singletons registered with Engine.RegisterSingleton.

Parameters
NameTypeDefault
nameStringName—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.