Interleaved Thinking optimization: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
This optimization is used to reduce the effect of the AI's thinking routine on game performance. Depending on the distance to the player and if they are in the player's view, AI will only think once in a certain number of frames. This includes the Mind (States and Tasks), path finding and physics.  
This optimization is used to reduce the effect of the AI's thinking routine on game performance. Depending on the distance to the player, AI will only think once in a certain number of frames. This includes the Mind (States and Tasks), path finding and physics. Multiply AI will think on different frames (started randomly). Interleaved thinking is switched off if the AI is in the player's view (it doesn't look good since the animations are not played properly)


The settings for this can be adjusted for each AI via spawnargs.
The settings can be adjusted for each AI via spawnargs.


* '''max_interleave_think_frames'''
* '''min_interleave_think_dist:''' If the distance to the player is smaller than this, the AI will think every frame.
* '''min_interleave_think_dist'''
* '''max_interleave_think_dist:''' If the distance to the player is larger than this, the AI will only think once in  the number of frames given by max_interleave_think_frames. The thinking frequency decreases linearly between min and max dist.
* '''max_interleave_think_dist'''
* '''max_interleave_think_frames:''' The AI will only think once in this number of frames if the distance to the player is larger than max_interleave_think_dist. Setting this to 1 will make the AI think every frame.
 
 
'''IMPORTANT!''' Do not set max_interleave_think_frames to high values (above 30). This will lead to path finding and physics problems, the AI might run into a wall and get damaged or even die.

Revision as of 15:15, 20 May 2008

This optimization is used to reduce the effect of the AI's thinking routine on game performance. Depending on the distance to the player, AI will only think once in a certain number of frames. This includes the Mind (States and Tasks), path finding and physics. Multiply AI will think on different frames (started randomly). Interleaved thinking is switched off if the AI is in the player's view (it doesn't look good since the animations are not played properly)

The settings can be adjusted for each AI via spawnargs.

  • min_interleave_think_dist: If the distance to the player is smaller than this, the AI will think every frame.
  • max_interleave_think_dist: If the distance to the player is larger than this, the AI will only think once in the number of frames given by max_interleave_think_frames. The thinking frequency decreases linearly between min and max dist.
  • max_interleave_think_frames: The AI will only think once in this number of frames if the distance to the player is larger than max_interleave_think_dist. Setting this to 1 will make the AI think every frame.


IMPORTANT! Do not set max_interleave_think_frames to high values (above 30). This will lead to path finding and physics problems, the AI might run into a wall and get damaged or even die.