MTA Eir/Functions/engineStreamingSetProperty

From Multi Theft Auto: Wiki
Revision as of 07:41, 28 May 2014 by TEDERIs (talk | contribs)
Jump to navigation Jump to search

Template:*Client function

Эта функция изменяет поведение системы стриминга GTA:SA. Это может увеличить производительность игры для ваших пользовательских серверов. Изменение этих свойств затрагивает качество игрового процесса на всем сервере.

Syntax

bool engineStreamingSetProperty ( string propertyName, var propValue )

Arguments

  • propertyName: the name of the streaming property you want to change
  • propValue: value to pass to the property

Valid Properties

MTA:Eir/functions/engineStreamingSetProperty/validProps ru

Useful Media

Returns

Returns true if valid arguments have been passed, false otherwise.

Examples

Click to collapse [-]
Client

This snippet ultimatively fixes the world flickering.

engineStreamingSetProperty( "strictNodeDistrib", false );
engineStreamingSetProperty( "infiniteStreaming", true );
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.

engineStreamingSetProperty( "gcOnDemand", true );
engineStreamingSetProperty( "infiniteStreaming", false );
engineStreamingSetProperty( "strictNodeDistrib", true );
Click to collapse [-]
Client

This snippet turns on fibered loading when the Streaming system is busy and leaves it that way for five seconds.

engineStreamingSetProperty( "isFibered", false );

local lastBusyTime = false;
local fiberedDuration = 5000;

addEventHandler( "onClientRender", root,
    function()
        local isBusy = engineGetStreamingInfo().isBusy;

        if ( isBusy ) then
            local now = getTickCount();

            if not ( lastBusyTime ) then
                lastBusyTime = now;

                engineStreamingSetProperty( "isFibered", true );
            end
        elseif ( lastBusyTime ) then
            if ( now - lastBusyTime > fiberedDuration ) then
                engineStreamingSetProperty( "isFibered", false );
            end
        end
    end
);
Click to collapse [-]
Client

This snippet makes the world load very slow. Lag spikes cannot occur due to Streaming loading anymore.

engineStreamingSetProperty( "isFibered", true );
engineStreamingSetProperty( "fiberedPerfMult", 0 );