MTA:Eir/functions/engineGetGamePoolLimits: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ This function returns a table of game resource allocation limits. In GTA:SA resources are allocated on statically-sized pools. Pool information returned may look like ...")
 
(Renamed template)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{MTA:Eir/Client_function}}
__NOTOC__  
__NOTOC__  
This function returns a table of game resource allocation limits. In GTA:SA resources are allocated on statically-sized pools. Pool information returned may look like this:
This function returns a table of game resource allocation limits. In GTA:SA resources are allocated on statically-sized pools. Pool information returned may look like this:
Line 5: Line 6:
     { name = "Buildings", usedCount = 1132, maxCount = 13000 },
     { name = "Buildings", usedCount = 1132, maxCount = 13000 },
     { name = "Peds", usedCount = 2, maxCount = 110 },
     { name = "Peds", usedCount = 2, maxCount = 110 },
     { name = "Objects", usedCount = 44, maxCount = 130 },
     { name = "Objects", usedCount = 44, maxCount = 800 },
     { name = "Dummies", usedCount = 2199, maxCount = 8000 },
     { name = "Dummies", usedCount = 2199, maxCount = 8000 },
     { name = "Vehicles", usedCount = 2, maxCount = 110 },
     { name = "Vehicles", usedCount = 2, maxCount = 110 },
     { name = "Collisions", usedCount = 2268, maxCount = 20000 },
     { name = "ColModels", usedCount = 2268, maxCount = 20000 },
     { name = "Tasks", usedCount = 7, maxCount = 9000 },
     { name = "Tasks", usedCount = 7, maxCount = 9000 },
     { name = "Events", usedCount = 0, maxCount = 5000 },
     { name = "Events", usedCount = 0, maxCount = 5000 },
     { name = "Task Allocators", usedCount = 2, maxCount = 800 },
     { name = "TaskAllocators", usedCount = 2, maxCount = 800 },
     { name = "Ped Intelligence", usedCount = 2, maxCount = 110 },
     { name = "PedIntelligence", usedCount = 2, maxCount = 110 },
     { name = "Ped Attractors", usedCount = 0, maxCount = 400 },
     { name = "PedAttractors", usedCount = 0, maxCount = 400 },
     { name = "Entry Info", usedCount = 104, maxCount = 10000 },
     { name = "EntryInfoNodes", usedCount = 104, maxCount = 10000 },
     { name = "Node Routes", usedCount = 181, maxCount = 8000 },
     { name = "NodeRoutes", usedCount = 181, maxCount = 8000 },
     { name = "Patrol Routes", usedCount = 23, maxCount = 6000 },
     { name = "PatrolRoutes", usedCount = 23, maxCount = 6000 },
     { name = "Point Routes", usedCount = 273, maxCount = 7000 },
     { name = "PointRoutes", usedCount = 273, maxCount = 7000 },
     { name = "PtrNode Double Links", usedCount = 48, maxCount = 20000 },
     { name = "PointerNodeDoubleLinks", usedCount = 48, maxCount = 20000 },
     { name = "PtrNode Single Links", usedCount = 3379, maxCount = 20000 },
     { name = "PointerNodeSingleLinks", usedCount = 3379, maxCount = 20000 },
     { name = "Environment Map Materials", usedCount = 61, maxCount = 5000 },
     { name = "EnvMapMaterials", usedCount = 61, maxCount = 5000 },
     { name = "Environment Map Atomics", usedCount = 98, maxCount = 5000 },
     { name = "EnvMapAtomics", usedCount = 98, maxCount = 5000 },
     { name = "Specular Map Materials", usedCount = 56, maxCount = 5000 },
     { name = "SpecMapMaterials", usedCount = 56, maxCount = 5000 },
     { name = "COL Sectors", usedCount = 81, maxCount = 256 },
     { name = "COLSectors", usedCount = 81, maxCount = 256 },
     { name = "IPL Sectors", usedCount = 76, maxCount = 255 }
     { name = "IPLSectors", usedCount = 76, maxCount = 255 }
}
}
</syntaxhighlight>
</syntaxhighlight>
When certain limits (such as the "PtrNode Single Links") are reached within the engine, the game will crash. Hence retrieving pool information during testing is important.
When certain limits (such as the "PointerNodeSingleLinks") are reached within the engine, the game will crash. Hence retrieving pool information during testing is important.


==Syntax==  
==Syntax==  
Line 35: Line 36:


===Returns===
===Returns===
Returns a '''table''' internal engine pool limit info.
Returns a '''table''' holding internal engine pool limit info.
 
===Useful Media===
* https://dl.dropboxusercontent.com/u/55896914/eir_resources/game_pools.zip - resource to draw engine pool limits onto the screen


==Example==  
==Example==  
Line 48: Line 52:


         for m,n in ipairs( poolInfo ) do
         for m,n in ipairs( poolInfo ) do
             outputConsole( m .. ": " .. n.usedCount .. " / " .. n.maxCount );
             outputConsole( n.name .. ": " .. n.usedCount .. " / " .. n.maxCount );
         end
         end
     end
     end

Latest revision as of 08:11, 28 September 2023

This function returns a table of game resource allocation limits. In GTA:SA resources are allocated on statically-sized pools. Pool information returned may look like this:

{
    { name = "Buildings", usedCount = 1132, maxCount = 13000 },
    { name = "Peds", usedCount = 2, maxCount = 110 },
    { name = "Objects", usedCount = 44, maxCount = 800 },
    { name = "Dummies", usedCount = 2199, maxCount = 8000 },
    { name = "Vehicles", usedCount = 2, maxCount = 110 },
    { name = "ColModels", usedCount = 2268, maxCount = 20000 },
    { name = "Tasks", usedCount = 7, maxCount = 9000 },
    { name = "Events", usedCount = 0, maxCount = 5000 },
    { name = "TaskAllocators", usedCount = 2, maxCount = 800 },
    { name = "PedIntelligence", usedCount = 2, maxCount = 110 },
    { name = "PedAttractors", usedCount = 0, maxCount = 400 },
    { name = "EntryInfoNodes", usedCount = 104, maxCount = 10000 },
    { name = "NodeRoutes", usedCount = 181, maxCount = 8000 },
    { name = "PatrolRoutes", usedCount = 23, maxCount = 6000 },
    { name = "PointRoutes", usedCount = 273, maxCount = 7000 },
    { name = "PointerNodeDoubleLinks", usedCount = 48, maxCount = 20000 },
    { name = "PointerNodeSingleLinks", usedCount = 3379, maxCount = 20000 },
    { name = "EnvMapMaterials", usedCount = 61, maxCount = 5000 },
    { name = "EnvMapAtomics", usedCount = 98, maxCount = 5000 },
    { name = "SpecMapMaterials", usedCount = 56, maxCount = 5000 },
    { name = "COLSectors", usedCount = 81, maxCount = 256 },
    { name = "IPLSectors", usedCount = 76, maxCount = 255 }
}

When certain limits (such as the "PointerNodeSingleLinks") are reached within the engine, the game will crash. Hence retrieving pool information during testing is important.

Syntax

table engineGetGamePoolLimits ()

Returns

Returns a table holding internal engine pool limit info.

Useful Media

Example

Click to collapse [-]
Client

This snippet prints out the engine pool information to the client console.

addCommandHandler( "debug_pools",
    function()
        local poolInfo = engineGetGamePoolLimits();

        outputConsole( "-- GAME POOL INFO --" );

        for m,n in ipairs( poolInfo ) do
            outputConsole( n.name .. ": " .. n.usedCount .. " / " .. n.maxCount );
        end
    end
);