Seeking advise

Hi all,

I am planning on making a game where spaceships are represented by smaller modules all connected. I would like to do this so that when the ship gets hit by, say, a weapon, individual segments can be damaged/destroyed (trying to sidestep not being able to change mesh geometries in the game mode).

Is this sensible? How much would it slow the game down to have many objects surrounded by other objects (so they are not visible) vs. not having them at all? Said another way, does the drawing process spend lots of time on objects that aren’t visible?

Also, if anyone has suggestions on other ways to implement damage to different parts of the same ship, I would be open to suggestions. One other thought I had for another method was to use a collision sensor in combination with a list in python, cross referencing weapon position at time of impact to data about the ship. This would work fine for changing UV data, but wouldn’t allow me to change the mesh if, say, a part gone blown completely off.


as long as it isn’t too high poly, having the ship as a bunch of parts should work fine. It is actually a pretty good idea.

What he said, having many objects doesn’t really slow BGE down much at all. It’s the polycounts and the textures that matter more. So from what I understand it would be the about the same if you had fifty 100 poly objects or one 5000 poly object.

Ah, thanks, that clears some things up.

The thing I’m worried about it wasting processor time on poly’s that are inside the ship and not visible- the back sides of modules on the surface and interior modules, etc.

Will the game engine spend time running them or does it have en efficient algorithm for not? I’m just wondering as I have no idea myself.

if its in view (even behind something) its being processed visually, but its a different story if its not in the screen (behind the camera for eg)

Like the above poster said.

BGE isn’t efficient at all like that. One way you could speed things up is to add the objects as you need them. Not sure how it would work in your specific case though. Search this forum for LOD. Also making objects literally invisible until you need them also helps quite a bit.

Try to keep less then 20 000 quadular polygons on-screen at once.

If you have one object with 20 000 polygons, you scene should run fine.

If you have one thousand objects, each with 20 polygons, the performance will drop dramatically.

Try to keep the number of individual objects minimal.

Yep, Chaser is right, I just checked. I did a little test and there was quite a difference. Not huge though.

I don’t know how you guys get 20,000 polys. If I subdivide a single cube to 25,000 polys I will be under 60 fps. I can use 5000 safely. Perhaps more, but if I add too much logic, or especially armatures, my framerate goes south. Most people don’t have a brand new PC with all the latest hardware. Just a thought.

Did you enable display lists? Without display lists I can have a single 40 000 quad object until fps drops below 60. With display lists I can have a single 200 000 quad object. I have four years old mainstream computer which can’t be considered fast by todays standars.

That doesn’t mean you can have one thousand 200 quad objects and still have the same performance, but perhaps the ship needs only a few dozen. One thousand dynamic objects is way too much for Bullet physics anyway. Disabling collision helps a little, but you still can’t have them all visible at once.

Well, with the system I have set up each ship only needs 6 dynamic objects to get spinning right (could be reduced to 4, but the math gets more complicated and I’m lazy), all of the surrounding objects are parented to a core that has bounds including all of them.

That said, my current designs have around 150-200 objects, mostly of poly count 6-10ish.
With, say, 100 ships (probably less) in the scene that would come out to… waaay too much. Safe to say that I’ll be redesigning my models considerably.

Making things invisible would be pretty easy, I’d just have to add a script to make them visible if whatever covering them is destroyed. Adding new objects as they are needed could work with my setup, but would be kind of a (giant) pain in the butt. Would the performance boost over just having them be invisible be worth it? They would not be dynamic actors.

Question to PSK131: What exactly do display lists do (other than boost performance)?

Thanks to everyone for the help,

100 ships which have six dynamic objects means you already have 600 dynamic objects. If I understood right, in addition to that you’re planning to have 150-200 static objects per ship bringing the total object count near 20 000 — way too much even if all of them were invisible and collision disabled. It would be best to keep the total object count under one thousand. So, if you have 100 ships in scene each of them should have 10 parts max. If that doesn’t bring your computer to its knees you can always add more :rolleyes:

For explanation of display lists, have a look at ovidiu’s post (#62) on this thread: