Performance: Essential Must-Knows

From The DarkMod Wiki
Revision as of 16:46, 31 July 2007 by Fidcal (talk | contribs) (Added about noclipmodel)
Jump to navigationJump to search

written by Fidcal

All mappers should know the following but remember not to blindly follow every rule but consider the balance between performance and presentation on a case by case basis. Don't spoil a beautiful view or an interesting interaction to gain efficiency unless it is worth the trade.


Caulk

Textured brush surfaces that are hidden by patches or behind beams etc. still add to the rendering complexity. So to improve performance those surfaces should be textured with common > caulk because that texture is not rendered at all.

There is no need to use caulk texture on on any surfaces on the outside of the map in contact with the void because these will automatically be unrendered.

Collison Model Removal on some func_static Entities

For models that neither the player nor any AI nor any object can reach or interact with then some memory can be saved by setting the property:

noclipmodel 1

All moving game elements would then pass through the model so only normally use on inaccessible model features.

func_static v worldspawn Brushes

By converting worldspawn brushes to func_static...

  • You can add the property noshadows = 1 so that it doesn't cast shadows, improving frame rates.
  • It avoids creation of millions of polys in certain situations where the engine converts a brush into loads.
  • It reduces pathfinding complexity (see Preventing and Reducing Pathfinding Complexity in Select Locations in Pathfinding)


Lighting overlaps

Generally be cautious about the light from more than one source falling into the same geometry triangle. This overlapping lighting makes the rendering calculations more complex and reduces game performance resulting in slowdown. The console command r_showtris 2 shows what is currently rendered (as triangular wireframes) so you can check any suspect areas. Often you can add trim and other detail to split up large triangles to reduce this.


Patches, Fixed Tesselation

Setting patches to fixed tesselation instead of automatic can significantly decrease the number of polygons.


Pathfinding Complexity Reduction

see Preventing and Reducing Pathfinding Complexity in Select Locations in Pathfinding


Shadow Casting Removal

Where appropriate, remove shadows from lights, entity brushes, and models by settings the property noshadows = 1 (see func_static v worldspawn Brushes)


Render-Sectioning using Visportals

If visportals are not used then the entire map will be rendered at once wherever the player is - greatly reducing performance to the point where most maps are not likely to be playable at all. It is crucial that the map should be compartmentalized using visportals. Study the Visportals tutorial for details.