Random protips on the go!
Hover your mouse wherever possible in this site, there are hidden tresures inside.
Use .DDS files for faster performance, it does improve it.
Turn on Static Shadow when your objects in the scene are not moving. You can turn it off in the light settings.
Range Engine: Use deltaTime() when you scene's FPS is fluctuating. This can help the object move with same speed no matter how much the framerate is.
Don't use Occlusion Culling, it wastes your CPU.
Don't create 9999+ files for python stuff, it's cancer. Instead put all the stuff that runs in a loop inside a looping function and put stuff the runs once in a function that runs once as a single file like this.
def init(cont):
if "init" not in own or own["init"] != True: #If init property exists or if it's not true
own["init"] = True
#your stuff that must be added once goes here
def loop(cont):
if own.sensors["forward"].positive:
own.applyMovement((0,1,0), 1)
#code that must run in a loop goes here
Or you can run the whole code in a loop and put the stuff that runs once under an if condition like this.
def loop(cont):
if "init" not in own or own["init"] == False:
#put stuff that runs once, intend for if condition.
#put stuff that runs in a loop here, intend for function.
When you're trying to change the material color with python, turn off Material under Constant Values in Material settings. Or else your material values won't change.
When converting Text object to Mesh, add a Decimate Modifier to reduce the face count of the mesh. Because having an optimized geometry can improve the performance, homie!
Set the Decimate mode to Planar. Convert the text object to mesh if it's not a mesh as you can't apply modifiers to text objects. And also set the collision to No Collision.
When changing an object's color with KX_GameObject.color, enable Object Color in the Materials menu -> Options. You also need to have a material assigned to that object.
You can access every objects in the scene without using bge.logic.getCurrentScene() by using owner.scene.object