User Tools

Site Tools


hpl2:amnesia:performance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:amnesia:performance [2017/05/22 21:29]
mudbill Added short note on timers
hpl2:amnesia:performance [2019/01/22 15:45]
darkfire [Make use of global fog]
Line 18: Line 18:
  
 You can activate the global fog in the level settings (Edit > Level settings > Fog) in the Level Editor. The global fog can be used to prevent the game from rendering objects beyond the ending point of the fog if culling is enabled for the global fog. For indoors it should be safe to allow for a longer end point, but use what you find best for your story. You can activate the global fog in the level settings (Edit > Level settings > Fog) in the Level Editor. The global fog can be used to prevent the game from rendering objects beyond the ending point of the fog if culling is enabled for the global fog. For indoors it should be safe to allow for a longer end point, but use what you find best for your story.
 +
 +The fog distance can be set so that the fog is never seen by the player, but it still culls a lot of the map. For example, if the longest corridor of the map is 12 meters long, setting the fog distance to 14 should work. Just in case the player sees it, however, set the fog's colour to black. This way, it will look like darkness.
  
 ===== Reduce particle effects ===== ===== Reduce particle effects =====
  
 Having too many particle effects can reduce performance. This includes lamp entities, be they torches, candles or otherwise. If you require more light, consider simply adding dimmed box lights or point lights with a large radius or replacing the wall with a window, or have a sunroof, with a spot light shining through. Having too many particle effects can reduce performance. This includes lamp entities, be they torches, candles or otherwise. If you require more light, consider simply adding dimmed box lights or point lights with a large radius or replacing the wall with a window, or have a sunroof, with a spot light shining through.
 +
 +===== Use fading on particle effects =====
 +
 +Having a big number of particle effects is doable in HPL2, but they need to fade them at distance (note: if you are already using fog culling, this probably won't help much). When placing a particle in the map, set it's fade distance so that the player can't see it when they are too far. Depending on your map, you might want to fade in a bigger particle in the place of few small ones - this way something will be visible from distance, but still will increase performance.
 +
 +The more particles there are in the map, the more this method will be effective. From the author'​s experience, this allows the map to have a couple hundred particles in the map without any performance drop.
 +
 +Example: Outside map with rain. There are two particles needed to be placed every couple meters: splashes on the ground and the actual rain. These particles need to cover the whole area, so there will be a lot of them and they'​ll decrease the performance significantly. However, the player will only see only the nearest 1 to 4 of these particles at once; therefore the rest of particles can fade at e.g. 10 meters from the player.
  
 ===== Avoid fast-looping timers ===== ===== Avoid fast-looping timers =====
hpl2/amnesia/performance.txt ยท Last modified: 2019/01/22 15:45 by darkfire