I have been working on a fps and its going well,
yet if i add more then one of my enemies it slows down almost exponetionaly, there not high polygon like maybe 100 each.
Im guessing its the python, dynamic, and collisions i have set up for them,
is there a way to optimize this? i set them up so you could shoot there heads and arms off so each part is a object all parented to a dynamic part that moves toward the player and when gets close enough attacks.
after i add about 4 of these guys it goes to 1/3 of speed, even if there not in camera range
also if i import them with a add object , there sounds quit working any ideals there
if they are dynamic then thats your problem…
Also keep python script low… try to make them univrsal if possible
i agree to sutabi.
a cause for slow downs may also be the always actuator. when the freuqency is set to 0 at EVERY frame a pulse is fired. even the other actuators may cause slow downs, cause when a pulse is processed the engine kinda stops (it doesn’t really stop, but is takin time) till all calculation is done.
so always think wether a condition (like collision or ray) is needed to check always. a good idea is to use a small python script instead of the AndController that checks some properties. working with messages is also a good practice, cause (at last i think so) the MessageSensor does not need to listen, it is triggered like a procedure call. but do not use the broadcast method, narrow it down by specifying the sender (listen only to messages from a sender containing a property or material or so).
next thing may be alpha-textures, they’re slow for sure. and last but not least: leave out all print statements from your python code, nothing slows a game more then writing to the console.
ok, really last thing i can think of: use as few dynamic actors as possible. in most cases enemies do not need gravity or damping, simulate this. they still respond to collisions when they’re not dynamic.
hope that helps,
Also, dynamic or not, blender is most limited in # of objects. This is because several times in the rendering process, it has to go through EVERY SINGLE OBJECT in every scene. It does this for logic processing, then it does this to put it in a render list, then it makes display lists for everything (at least I believe this is how it does this) then it goes through everything AGAIN to call the display lists.
There are probably at least 3 places in the pipeline that are ineficient due to the size of the object list, so the least amount of objects you put in the game, the faster it will be.
Also check for python errors, if the console is outputting lots of errors it will slow things down considerably.
Ahh thank you, I will go through and check these things out. It would be nice to keep my multiple object ememys because it is fun to blow there arms and head off . although if i can’t find a work around I will use the bone method
which leads me to my next question. I have gone through lots of games and was wondering if there was a way to replace a texture in game.
example, shoot guy = switch to bloody texture
Many thanks to all who have helped me. I plan on making a fun game that will be enjoyed by the whole blender comunity.
So far the plans consist of
5 guns , 1 enemy and 1 level. im mainly conserned with the guns and then i will add enemies and more levels, this will be my first thought out game and I hope it will be fun for all. I am going into game devlopment as a hobby but hope to make it a profession in the future. Some of the things i plan on trying will be a character demo (similar to the full fuction of tomb raider) A level demo ( boat and character that can swim and walk) more of a exploration game with caves and islands to explore. I been thinking about trying to implement my own pysics in python for dynamic falling and gravity so if a enemy falls on a ledge his arm will hang off ect… all planed, but im lazy so we will see how much i really do hehe. thx , out…