Skip to content

Memory Adjustments (console)

BAD-AL edited this page Jan 10, 2021 · 4 revisions

StealArtistHeap()

  • 'StealArtistHeap()' is a function that appears to reduce the amount of memory allotted to rendering textures and give more memory for 'models'. It is used in many of the stock maps.
  • See Console World memory notes for guidance on using 'StealArtistHeap.

Sound

If you are having trouble getting a map to load (1,2,3,4 player) consider trimming down what sounds get loaded.

Console 'SetMemoryPoolSize' calls

  • Psych0fred left some notes here about removing space for un-needed memory pools altogether.

  • AnthonyBF2 discovered that removing some of the 'SetMemoryPoolSize()' calls allows more content to load on console.

Using the following technique allowed 2-player splitscreen to load on a larger map (Realm Of Chaos):

  1. Remove all calls to 'SetMemoryPoolSize()'
  2. Load and play map on PC with the 'BF2 ModTools' exe.
  3. Check BF2 log for 'memory pool complaints' and set those specific pools accordingly.
  4. Play map with all characters using all abilities and check for memory pool log entries; adjust accordingly.
  5. Also pay attention for performance issues and adjust memory pools accordingly (use the binary search technique if you're not sure which ones to adjust).

Using this technique I was able to trim down the 'SetMemoryPoolSize' calls to only 5 and still have the map play well.

    --local weaponCnt = 1024
    --SetMemoryPoolSize ("ClothData",20)
    --SetMemoryPoolSize ("Combo",50)              -- should be ~ 2x number of jedi classes
    --SetMemoryPoolSize ("Combo::State",650)      -- should be ~12x #Combo
    --SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
    --SetMemoryPoolSize ("Combo::Condition",650)  -- should be a bit bigger than #Combo::State
    --SetMemoryPoolSize ("Combo::Attack",550)     -- should be ~8-12x #Combo
    --SetMemoryPoolSize ("Combo::DamageSample",6000)  -- should be ~8-12x #Combo::Attack
    --SetMemoryPoolSize ("Combo::Deflect",100)     -- should be ~1x #combo  

    --SetMemoryPoolSize("Aimer", 100)
    --SetMemoryPoolSize("AmmoCounter", weaponCnt)
    --SetMemoryPoolSize("BaseHint", 1024)
    --SetMemoryPoolSize("EnergyBar", weaponCnt)
    --SetMemoryPoolSize("EntityCloth", 32)
    
    SetMemoryPoolSize("EntityFlyer", 32)
    SetMemoryPoolSize("EntityHover", 32)
    --SetMemoryPoolSize("EntityLight", 200)
    SetMemoryPoolSize("EntitySoundStream", 4)
    SetMemoryPoolSize("EntitySoundStatic", 32)
    --SetMemoryPoolSize("MountedTurret", 32)
    --SetMemoryPoolSize("Navigator", 128)
    --SetMemoryPoolSize("Obstacle", 1024)
    --SetMemoryPoolSize("PathNode", 1024)
    --SetMemoryPoolSize("SoundSpaceRegion", 64)
    --SetMemoryPoolSize("TreeGridStack", 1024)
    --SetMemoryPoolSize("UnitAgent", 128)
    --SetMemoryPoolSize("UnitController", 128)
    --SetMemoryPoolSize("Weapon", weaponCnt)
    SetMemoryPoolSize("SoldierAnimation", 232)