Optimize your map

Aggror NOTE: work in progress. Gathering information, topics and ideas about map optimization

Topics found

http://www.leadwerks.com/werkspace/topic/14881-other-ways-to-optimize/#entry100945
http://www.leadwerks.com/werkspace/topic/14578-performance-issue/page__hl__performance
http://www.leadwerks.com/werkspace/topic/14392-need-an-explanation/page__hl__performance
http://www.leadwerks.com/werkspace/topic/14175-leadwerks-editor-crashing-and-fps-drops-in-game/page__hl__performance#entry97254
http://www.leadwerks.com/werkspace/topic/14624-lua-editor-quality-setting-whats-it-in-code/page__hl__multisamplemode#entry99571

Tips

  • Near viewdistance: Small objects like oildrums, debris, crates should have a near viewdistance. The scene manager will skip those objects when they are far away without ever even iterating through them.
  • Collapse entities: Models that contain a lot of sub-entities (buildings or modular construction kits) cause performance drops. You can collapse those entities in a moddeling program and export them as 1. You can also collapse models and CSG brushes in the Leadwerks editor. Use the model editor or the collapse checkbox on CSG brushes.
  • Extreme texture sizes: When you are in your projects models and/or texture folder do a *.* search and sort by size. If you have textures that are over 20MB and they are used for small objects, you need to convert it to use smaller size.
  • Disabling shadows: Disabling shadow for objects that are barely or visible or even unvisible, set the shadow mode to none. Even CSG brushes used as triggers or models/brushes that have the invisible material applied.
  • Occlusion culling: Check that only things like lights and characters have the 'occlusion culling' checked.
  • Light shadow mode: post-45-0-52881600-1454359124.jpg

Debugging performance

—DRAW stats
http://www.leadwerks.com/werkspace/topic/13222-analyzing-performance/page__hl__drawstats
—Render statistics
context:SetBlendMode(Blend.Alpha)
if DEBUG then
context:SetColor(1,0,0,1)
context:DrawText("Debug Mode",2,2)
context:SetColor(1,1,1,1)
context:DrawStats(2,22,true)
context:SetBlendMode(Blend.Solid)
else
—Toggle statistics on and off
if (window:KeyHit(Key.F11)) then showstats = not showstats end
if showstats then
context:SetColor(1,1,1,1)
—context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
context:DrawStats(2,2,true)
end
end

—Refresh the screen
context:Sync(true)

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License