= Intention
This thread is meant to share knowledge, get people to test and find out new ground.
Especially the config part is hardly known at all and little understood.
So more testing is needed to find out, if it can help.
= Scripting
Their main purpose is to be used in mission, especially when beaming
the player from on place to another.
- camPreload: Preload the scene for the prepared camera.
- preloadCamera: Preload all textures and models around given Position to avoid visual artifacts after camera is moved.
- preloadObject: Preload all textures, materials and proxies needed to render given object.
- startLoadingScreen: When loading screen is shown,simulation and scene drawing is disabled, scripts run at full speed.
And a few more, specific, found in BIKI: Category:Scripting Commands ArmA2 (load/preload).
= Config
The sample code is taken from 1.04 configs.
The comments are taken from binarize source files, part of the BI tools,
written by BI - yet no guarantee to be correct or up-to-date.
Code:
class PreloadVehicles
{
access = 1;
};
No comment - probably doing nothing.
Code:
// any texture corresponding to the entry below is preloaded
// and kept in the memory permanently
// actual texture file is looked up in the corresponding config entry
// lookup values:
// "*" - path is relative to Data unless it starts with a backslash
// "\*" - path is always absolute
// "@*" - model name (rel. to data3d) is given in the config - load all textures for itreferenced by it
// "\@*" - model name (abs) is given in the config - load all textures for itreferenced by it
// in future other values or combinations may be possible,
// like for textures which need to be loaded, but not all mipmaps are needed
class PreloadTextures
{
class CfgInGameUI
{
imageCornerElement = "*";
class GroupDir
{
image = "*";
};
class PeripheralVision
{
cueTexture = "\*";
bloodTexture = "\*";
};
class Cursor
{
me = "*";
aim = "*";
weapon = "*";
select_target = "*";
lock_target = "*";
leader = "*";
mission = "*";
tactical = "*";
move = "*";
selected = "*";
attack = "*";
getIn = "*";
watch = "*";
outArrow = "*";
};
};
class CfgCloudletShapes
{
cloudletSmoke = "@*";
cloudletWater = "@*";
cloudletFire = "@*";
cloudletUniversal = "@*";
};
class CfgWorlds
{
class Chernarus
{
pictureShot = "*";
};
class utes
{
pictureShot = "*";
};
};
class CfgWeaponCursors
{
class RifleCursor
{
texture = "*";
};
class MGCursor
{
texture = "*";
};
class LawCursor
{
texture = "*";
};
};
};
This works. Has been used in a1 to preload gear and map elements to speed
up loading time.
What about textures not defined in config and only in rvmat/p3d?
It might be possible to create config definitions for yet undefined textures.
Does it work? Dunno - testing needed. Might not for every type at least.
Unknown how the preloading works - into Ram/VRam?
Might cause issues if too much data is preloaded that way.
Code:
// addon configuration
// Following official addons should be always loaded if present
// this should help to minimize compatibility problems
// with older missions that do not have correct addons[] list
// (This applies especially to mission using official weapons).
class CfgAddons
{
access = 1;
class PreloadBanks {};
class PreloadAddons
{
class CA
{
list[] =
{
"CAData",
//...
};
};
};
};
This probably helps the engine do the preloading on mission loading.
The same is done via addons/addonsAuto array as part of the mission.sgm.
NOT recommended to define community work that way as it crates
save game issues (makes a save dependent on the addon no matter what).
Same/similar thing can be achieved via activateAddons (scripting command).
Not much potential here I think.
Code:
// any texture corresponding to the entry below is preloaded
// and kept in the memory permanently
// actual texture file is looked up in the corresponding config entry
// lookup values:
// "*" - the class including all subclasses is made permanent
// "." - only this class is made permanent
// "fastFind" - optimize searching in this class
class PreloadConfig
{
RadioProtocolBase = "*";
RadioProtocolDefault = "*";
CfgVoice = "*";
class CfgCloudlets
{
CraterBlood = ".";
CloudletsMissileManual = "*";
CloudletsMissile = "*";
CloudletsScud = "*";
CraterDustSmall = "*";
CraterDustBig = "*";
CraterSmoke1 = "*";
CraterSmoke2 = "*";
CraterSmoke3 = "*";
CraterWater = "*";
Explosion = "*";
};
CfgDestructPos = "*";
CfgCloudletShapes = "*";
CfgMimics = "*";
CfgVehicles = "fastFind";
CfgNonAIVehicles = "fastFind";
CfgAmmo = "fastFind";
CfgMusic = "*";
CfgTitles = "*";
CfgCameraEffects = "*";
RscTitlesText = "*";
CfgFonts = "*";
CfgFontFamilies = "*";
RscMainMenu = "*";
RscSubmenu = "*";
RscMoveHigh = "*";
RscMoveDir = "*";
RscReply = "*";
RscStatus = "*";
RscWatchDir = "*";
RscWatchMoreDir = "*";
RscMoveDist = "*";
RscFormations = "*";
RscCombatMode = "*";
RscTeam = "*";
RscSelectTeam = "*";
RscRadio = "*";
CfgHQIdentities = "*";
RscButtonImages = "*";
class RscInGameUI
{
RscUnitInfoSoldier = "*";
};
RscObjectives = "*";
CfgDestroy = "*";
class CfgSFX
{
Church = "*";
};
};
Preloading configs does not seem like a source to speed up the game.
Code:
//Core engine data (preloaded textures and models)
class CfgCoreData
{
access = 0;
textureHalf = "#(argb,1,1,1)color(0.5,0.5,0.5,1,dt)";
textureZero = "#(argb,1,1,1)color(0,0,0,0)";
textureTIConversion = "core\data\ticonversion.tga";
lodTransitionSpeed = 0.125;
halfspaceModel = "core\default\default.p3d";
textureDefault = "ca\data\data\default_co.paa";
textureTrack = "ca\data\data\texturetrack_ca.paa";
textureTrackFour = "ca\data\data\texturetrackfour_ca.paa";
maskTextureFlare = "ca\data\data\masktextureflare%02d_co.paa";
eyeFlare = "ca\data\data\eyeflare_ca.paa";
cloudletBasic = "ca\Data\cl_basic.p3d";
cloudletFire = "ca\Data\cl_fire.p3d";
cloudletFireD = "ca\Data\cl_fireD.p3d";
cloudletWater = "ca\Data\cl_water.p3d";
paperCarModel = "ca\Data\papauto.p3d";
collisionShape = "ca\Data\colision.p3d";
sphereModel = "ca\data\koule.p3d";
rectangleModel = "ca\data\rect.p3d";
craterShell = "ca\data\krater.p3d";
craterBullet = "ca\data\krater_po_kulce.p3d";
sphereLight = "ca\data\kouleSvetlo.p3d";
cloudletMissile = "ca\data\missileSmoke.p3d";
horizontObject = "ca\data\horizont.p3d";
skysphere = "ca\data\obloha.p3d";
halflight = "ca\data\halfLight.p3d";
textureBlack = "ca\data\data\black.pac";
textureLine = "ca\data\data\tracer.paa";
forceArrowModel = "ca\ui\force.p3d";
footStepL = "ca\characters\stopa_L.p3d";
footStepR = "ca\characters\stopa_P.p3d";
slopBlood = "ca\characters\krvava_skvrna.p3d";
cobraLight = "ca\air\cobraSvetlo.p3d";
marker = "ca\air\obrysove svetlo.p3d";
};
Not much known again. Might be a way to preload p3d files.