MTA:Eir/functions/engineStreamingSetGCOnDemandEnabled

From Multi Theft Auto: Wiki
Revision as of 06:18, 11 December 2013 by The GTA (talk | contribs) (Created page with "__NOTOC__ This function is used to add a Streaming garbage collector run to the event that the engine runs out of freely available Stream...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 is 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 );