what about sounds?
are really CPU wasting in games as shooter.
that is a simple solution
#### faster_sounds.py
# NOTES : to use only for little sounds (gun shoot, explosions for little file as ogg, wav) ..no music
# big files due problem with RAM
import aud
ACTUATORS_BUFFERIZED = {}
def bufferize_my_actuators_sound(cont): # <- always (no pulse,just in the first frame)
gob = cont.owner
gob_name = gob.name
for act in [a for a in gob.actuators if hasattr(a, "sound") and a.sound]:
factory_id = gob_name + act.name
if not factory_id in ACTUATORS_BUFFERIZED:
buf = aud.Factory.buffer(act.sound)
ACTUATORS_BUFFERIZED[factory_id] = buf
act.sound = ACTUATORS_BUFFERIZED[factory_id]
after that you can run the actuators normally, but without lag!
PS: this MUST be a module(no script)