Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2009-05-01 20:35:06 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2009-05-01 20:35:06 +0400
commit672492f563e148dc608965c5d0011413fbfae0eb (patch)
tree57aa0b79b8de32cef7ce3dee32e6013045e30d76 /source/gameengine/PyDoc
parent1c6cd47f2b93ba05c54f82c9363f269c71e28cda (diff)
BGE: New function GameLogic.setMaxLogicFrame() to allow better control over the time spent on logic.
This function sets the maximum number of logic frame executed per render frame. Valid values: 1..5 This function is useful to control the amount of processing consumed by logic. By default, up to 5 logic frames can be executed per render frame. This is fine as long as the time spent on logic is negligible compared to the render time. If it's not the case, the default value will drag the performance of the game down by executing unnecessary logic frames that take up most of the CPU time. You can avoid that by lowering the value with this function. The drawback is less precision in the logic system to physics and I/O activity. Note that it does not affect the physics system: physics will still run at full frame rate (actually up to 5 times the ticrate). You can further control the render frame rate with GameLogic.setLogicTicRate().
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r--source/gameengine/PyDoc/GameLogic.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py
index 74e7f852018..85e94e63416 100644
--- a/source/gameengine/PyDoc/GameLogic.py
+++ b/source/gameengine/PyDoc/GameLogic.py
@@ -360,6 +360,21 @@ def stopDSP():
Only the fmod sound driver supports this.
DSP can be computationally expensive.
"""
+def getMaxLogicFrame():
+ """
+ Gets the maximum number of logic frame per render frame.
+
+ @return: The maximum number of logic frame per render frame
+ @rtype: interger
+ """
+def setMaxLogicFrame(maxlogic):
+ """
+ Sets the maximum number of logic frame that are executed per render frame.
+ This does not affect the physic system that still runs at full frame rate.
+
+ @param maxlogic: The new maximum number of logic frame per render frame. Valid values: 1..5
+ @type maxlogic: integer
+ """
def getLogicTicRate():
"""
Gets the logic update frequency.
@@ -372,7 +387,7 @@ def setLogicTicRate(ticrate):
Sets the logic update frequency.
The logic update frequency is the number of times logic bricks are executed every second.
- The default is 30 Hz.
+ The default is 60 Hz.
@param ticrate: The new logic update frequency (in Hz).
@type ticrate: float