MTA:Eir/functions/engineStreamingSetGCOnDemandEnabled

From Multi Theft Auto: Wiki

This function is used to add a Streaming garbage collector run to the event that the engine runs out of freely available Streaming GC nodes. The whole world is checked for off-screen or far-away entities. Every entity it finds loses its RenderWare data. When the model info of the specific entity model is not used anymore, it is freed. This way multiple Streaming GC nodes are made available for allocation. It is a safer way to free nodes from in-game entities than the Streaming node stealing implemented by Rockstar Games.

By default, Streaming GC on demand is disabled.

Syntax

bool engineStreamingSetGCOnDemandEnabled ( bool enabled )

Arguments

  • enabled: a boolean to decide whether to garbage collect on lacking free Streaming GC nodes

Returns

Returns true if enabled is passed as valid boolean, false otherwise.

Example

Click to collapse [-]
Client

This snippet sets the Streaming GC system to sparse mode. In this mode only the preallocated amount of Streaming GC nodes is allowed. Keeping a low amount of Streaming nodes is interesting for performance optimizations.

engineStreamingSetGCOnDemandEnabled( true );
engineSetInfiniteStreamingEnabled( false );
engineSetStrictNodeDistributionEnabled( true );