A theory / question about improving game performance

Hello friends,

It could probably be said that this might be better off in the forums, and I’m not opposed to that. Perusing them, however, I couldn’t exactly figure out WHERE to put this topic, so I thought I’d post it in answers. Hope I’m not clogging up the place with it.
So, this has to do with performance. I noticed after adding different models, textures, etc. that my framerate went way down, while my drawcalls and tris went skyrocketing. Ok, no problem. A little google search taught me about the “Combine Children” script. Always wondered what that was. Used it, and life seemed good.

For a moment.

Performance improved dramatically, but then I noticed that many of my combined meshes just plain weren’t showing up anymore. I’ve read up on this, I see it’s an issue that’s been addressed, and while I haven’t found a unified single answer, I know that the topic’s been covered enough to not warrant one more noob asking about it.

So believe it or not, I’m not asking how to fix it. Not right now. Instead, I’m going to ask for opinions on a workaround that I’ve thought up. It’s dawned on me that I might be drawing things unnecessarily in my game. For instance: let’s say the town of bogville is 20 miles away from the spooky forest. Yet the spooky forest is still active on my map when I walk into the town of bogville. Would I save drawcalls, save on performance if I just put an invisible box collider nearer to the spooky forest which would activate / deactive it when the player is close? I suppose I could do this with any models that were collected in a gameobject throughout the game, my question is just would this be a way (good, bad, or ugly is irrelevant right now, I just am thinking proof of concept) of improving performance? Thanks, and God bless.

For instance: let’s say the town of bogville is 20 miles away from the spooky forest. Yet the spooky forest is still active on my map when I walk into the town of bogville. Would I save drawcalls, save on performance if I just put an invisible box collider nearer to the spooky forest which would activate / deactive it when the player is close?

You can toggle renderers on and off, yes. This should improve performance since Unity doesn’t have to cull objects and since Unity doesn’t have to render them (in case your frustum is super big, like the 1 KM frustum that is default with Unity).

I suppose I could do this with any models that were collected in a gameobject throughout the game, my question is just would this be a way (good, bad, or ugly is irrelevant right now, I just am thinking proof of concept) of improving performance? Thanks, and God bless.

It’s a good thing to do. You can also use occlusion culling if you have Unity Pro.

Other things that may or may not be obvious is your render mode (try switching between deferred and forward) and try disabling lights (maybe you have too many dynamic lights). Use light mapping and light probes. Also check the number of materials you use, and make sure you actually use the same materials and don’t do things like setting the color individually per item. For dynamic batching, you should not [non-uniformly] scale your objects. Everything that is staticly batched must not change.