From BlenderWiki

Jump to: navigation, search

Blender 2.75: Game Engine

Game Engine updates include: work on the physics simulation, with constraint improvements, better velocity clamping and collision masking; things have been simplified, by clarifying some options and adding a shadow box for sun lamps that'll help lighting things; Python programmers have more power, as we introduced access to more corners of the engine, and custom KX_GameObjects can now use additional initializer arguments. For details and more fixes, read on.

Level of Detail (LOD)

Hysteresis settings per Scene
Hysteresis settings per Object


A new hysteresis parameter was introduced which prevents rapid alternation between detail levels when the camera moves close to a transition distance.

Hysteresis may be set:

  • Per scene, (default 10%) from the Scene context -> Level of Detail panel. This may be disabled if scene-wide hysteresis is not desired.
  • Per object (default 10%) from the Object context -> Levels of Detail panel. If active, this setting will overwrite the scene hysteresis setting.

Python API

  • A new "currentLodLevel" attribute was added to the Python API of KX_GameObject. The attribute returns the current lod level of the game object. This attribute may be used to manage logic routines according to the discrete lod-distance from the camera, avoiding the need to separately compute the Vector distance to the camera in Python.

Usage in Python module might look like:

def state_lod(cont):
    own = cont.owner
    lod_level = own.currentLodLevel
    lod_manager_state = 1
    lod_state = 1 + lod_level
    # Set the object's state as 1 (with the Pythons controller running state_lod)
    # And any state after from 1 -> 32
    own.state = lod_manager_state + (1 << lod_state)


  • For new blend files, the scene hysteresis setting is active by default, and the object setting disabled.
  • For the old blends, both hysteresis settings (per scene and per object) are set inactive by default.

Lock Translation for Dynamic Objects

Lock Translation Dynamic Object

It is now possible to lock the XYZ translation components of dynamic objects via the interface in:
Properties » Physics (tab) » Physics (panel)


Rigid Body Joint Constraint Replication

Blender now replicates rigid body joint constraints for group instances (DupliGroups). (0b4a71b07245 & D658)

GLSL Material Animations

GLSL materials can finally be animated. The animatable material properties are:

  • Diffuse color
  • Diffuse intensity
  • Specular color
  • Specular intensity
  • Hardness
  • Emit
  • Alpha


World and Mist API with GLSL Animations

GLSL world and mist and can be animated. The animatable properties are:

  • Horizon color = Mist color
  • Ambient color
  • Mist start
  • Mist depth
  • Mist minimum intensity


Python API

  • New world module with attributes for mist, background and ambient rendering.
.. attribute:: mistEnable
.. attribute:: mistStart
.. attribute:: mistDistance
.. attribute:: mistIntensity
.. attribute:: mistType
.. attribute:: mistColor
.. attribute:: backgroundColor
.. attribute:: ambientColor
scene = bge.logic.getCurrentScene() = [0.8, 0.8 ,0.2]


Sun Lamp: New debug draw shadow box

Shadow box debug drawing

Sun Lamps now have a option "Show Shadow Box" to display a debug representation the range of the lamp, providing feedback about which objects project shadows for the selected Sun Lamp.


Logic Brick Sensors

Skip parameter
  • "Frequency" parameter is renamed to "Skip" in the Logic Brick sensors as it represents skipped frames between pulses.
  • A new BGE python attribute 'skippedTicks' was introduced. The old 'frequency' attribute is maintained but deprecated.

.. attribute:: skippedTicks

Ordering Game Properties

New up/down buttons

Game Properties can now be ordered with the new move up/down buttons (a8adeeb).


  • A Python API for the collision group / mask has been added:
  • The maximum number of collision groups and masked has been increased from eight to sixteen. This means that the max value of collisionGroup/Mask is (2 ** 16) - 1
  • Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.
  • Additionally, EndObject will now activate objects that were sleeping and colliding with the removed object. This means that if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before. (3d55859)
  • The KX_GameObject.suspendDynamics() method now has an optional boolean "ghost" argument, that (when True) disables collision detection. This effectively makes the object a ghost. (4e7ef3f5cd8c)

Pre-Drawing Setup Callback

There is a new callback available to control the drawing setup. This is useful to setup the camera matrices (model view and projection) before the drawing itself. (9425a8f)


Python Sample Code

The sample scene would need a default camera (not used for rendering), a dummy camera ('Camera.VR'), and two cameras ('Camera.Left', 'Camera.Right') that will be used for the actual rendering.

from bge import logic, render
def callback():
    scene = logic.getCurrentScene()
    objects = scene.objects
    vr_camera = objects['Camera.VR']
    if render.getStereoEye() == render.LEFT_EYE:
        camera = objects['Camera.Left']
        camera = objects['Camera.Right']
    vr_camera.worldOrientation = camera.worldOrientation
    vr_camera.worldPosition =  camera.worldPosition
def init():
    scene = logic.getCurrentScene()
    objects = scene.objects
    main_camera = scene.active_camera
    main_camera.useViewport = True
    vr_camera = objects['Camera.VR']
    vr_camera.useViewport = True
    vr_camera.setViewport(0, 0, render.getWindowWidth(), render.getWindowHeight())

PyObjectPlus Subclassing (Mutating)

  • BGE Python subclassing now supports additional initialiser arguments. For example, we can do:
class Player(types.KX_GameObject):
    def __init__(self, gameobj, life):
        print("create new player :", self, ", life :", life)
def wrap_player(cont):
    own = cont.owner
    # Old reference to own will now be invalidated, so overwrite
    # Pass additional parameter life (50)
    own = Player(own, 50)

Optional AddObject reference argument

  • The reference argument has been made optional for the KX_Scene.addObject function. Without a provided reference object, the original rotation, scale and position of the source object is used.
  • New objects will then be added to the active layer of the scene.
obj = scene.addObject("Cube")


New isSuspendDynamics attribute

This is a new KX_GameObject attribute that returns the suspended state of the game object (a12b2ec).

.. attribute:: isSuspendDynamics

Correct velocity clamping

Velocity clamping is now applied on every physics subtick, instead of every logic tick (D1364)

New getDisplayDimensions method

This new rasterizer method returns the set dimensions (not necessarily the actual dimensions) of the current display device (e.g, the monitor), in pixels. (e36b0cb, c89637b)

from bge import render
width, height = render.getDisplayDimensions()

Rigid Body Constraint API keywords

createConstraint() now accepts keyword arguments. Omitted arguments will fall back to default values (87b6d3c):

const = bge.constraints.createConstraint(obj1_ID, obj2_ID, constraintType, pivot_x = 1.0, pivot_z = -1.0, axis_z = 90.0, flag = 128)

Bug fixes

This release includes over 40 bug fixes, for details see the list.

Compatibility Issues

New color-management setting
  • With the color-management fix, the "Color Management" switch in the BGE "Render > Shading" panel is being removed, use the "Display Device" setting in the "Scene > Color Management" panel instead.

  • Rigid body constraint API: initial values for the XYZ axis and Z rotation has been changed from 1.0 to 0.0. If these values were not set in older scripts, it is now necessary to set it on constraint creation, to get the same pivot position and rotation.
const = bge.constraints.createConstraint(obj1_ID, obj2_ID, constraintType, 1.0, 1.0, 1.0, 0.0, 0.0, 90.0)