Does anybody know of any limitations of the game engine? (Nr. of faces, objects, logic bricks…) I’m working on a fairly complex game (6 players) and I have the feeling, that some of my logic bricks aren’t executed anymore. At some stage I could bring it to work by deleting all but one player, but I cannot reproduce this anymore… Rather stuck by now.
There aren’t any hardcoded limitations that I know of, but performance-wise things could break if your framerate is too slow. The logic bricks are not very efficient I’ve found, so if you can use python instead of logic bricks for much of it, it could help. If the players are all animated with armatures then you have a real problem, because even on my AMD1400, ATI Radeon 7200 256 megs of ram beast of a system, more than say 4 or 5 armature animated people start to slow it down.
Here is my order of importance as to how fast things run:
of objects - 150 or more could be a problem
of logic bricks on objects - Logic bricks take up a lot of memory on the object, so any skimping down of this will help a ton
of armatures per object - A lot of objects with a few bones is faster than one object with a lot of bones
Amount of textures and size of textures - Now we’re getting into things that can be fixed with a better graphics card
Polygons - can also improve poly performance with better gfx card.
I thought of switching to Python too, but I have one problem: I have a lot of “inter-object-dependencies”. (I mean: if a property of one object has a certain value, the property of a second object is modified.) With logic bricks its no problem.
But how do I solve this in Python? If I connect a python-script to a controller, I only find a routine to retrieve the object this python-script is attached to. (owner.getCurrentController() I think - sorry, don’t have the manuals with me … )
Suppose you have an object 1 that has a property named “position”. Now I want to set the property “status” of object 2 to: object2.status = object1.position * 1.1 .
This is what messages are for. They still aren’t a great solution for interobject dependancies, which is one of gb’s lowest points I think, but they are the best tool you’ve got. For the most part they work pretty well, but anything using a message is delayed a frame or so. Not noticable for mose things, but if you are changing an objects position you can probably notice the delay.
I think interobject logic bricks are another thing that slow gameblender down a lot. But for somethings, it makes more sense to use logic bricks than python, like if you have a bunch of objects that are all part of the player, it makes sense to link them up.
Thanks for the hint with the messages. I’ll try it, but normally I link the things directly in the realtime window (selecting both objects and than tie them together using the logic bricks).
What I really want to know now is how to link the blender rendering engine and the realtime engine using python. What I mean is: It seems to me, that the both have nothing in common, that you cannot use both of them really. If I have a python-script running, say on each frame change, I am not able to access the properties that I have defined in the realtime window of a given object. I can retrieve the object (Blender.Object.Get(name) I think), but I haven’t find a way to retrieve its properties (“Status” i.e.).
On the other hand, if I link a script to a logic brick for an object, I am able to access the properties (object.Status), but I am unable to retrieve any other object! (no “GetObject(name)”) Is there any solution? Do I miss something? Or shall I post another message to the python-forum?
Thanks for all your help and kind regards,
Tashimo