I was just wondering if anyone has any practical experience with how many objects can / should be on-screen or loaded at any time. I'm working on a fairly complex project with at least six layers right now, running ~110 objects and I haven't started the serious enemies & AI yet.
I've noticed that in some irresponsibly-coded scenarios, the debug counter tends to max out around 500 objects & then strange effects start to appear.
I'm also running a ridiculously fast dual-core, so I've never seen slow-down. Is speed testing something I'll have to do on my friends' computers after building the whole thing?
So what are your records for objects on screen / memory usage / number of rules, and what strange behavior starts to develop in large projects?
its probably maxing out at 500 objects because you have "max objects" set to 500 on your frame properties. maximum available is 20,000 though its probably not a good idea.
nope its 20k. anything higher than 20k it sets the object limit to 20k. but yeah anything over 1000 is pretty slow, depending on the # of events/loops/collisions/etc related to the actives.
Well, for what I'm working on, I won't need to push the absolute limit of 20k or even 10k.
I estimate reaching at least 300 objects with the whole engine in place, and I'm wondering if that's already dangerous territory. From the sounds of it, I probably have plenty of breathing room.
You can always generate systems that lower objects like particles when fps is too low. Or you can make fastloop map system that loads only viewable map (or little bit bigger), so you can do 9000x9000 maps with only about 100 objects at a time.
I have proven new mathematic formula to be true...
Also the more code you have attached to these countless objects the slower it will get. On my project before I optimised the face offa it even just 300 objects ran slow, because they had physics, alpha, AI or whatever attached to them too.
Originally Posted by Dr. James Also the more code you have attached to these countless objects the slower it will get. On my project before I optimised the face offa it even just 300 objects ran slow, because they had physics, alpha, AI or whatever attached to them too.
Yes, I'm also trying to keep the complexity & number of the rules down. Do you have any estimates about how much code you had before & after optimization?
When I code, I try to include extra constraints so that an action isn't triggering every frame if it doesn't have to; I also only add fastloops if completely necessary. I'm guessing this helps. Any tips on how to streamline the code?
That's what I'm doing, but with some particles and other disposable objects in a qualifier group that removes and deactivates certain effects if the FPS drops too low. Also destroying objects when out of the windows view, "freezing" enemy physics if they're not in view. That kind of stuff. I've also set my game to adjust the rotation quality depending on the frame rate, it only goes to low quality mode if the game is performing less than 5 frames off the FPS rate.
On the game I'm working on right now (Final Styricum Shower), it currently has around 600 on screen and with a fair bit of programming linked to objects with AI programming and all that. Doesn't seem to be a problem yet.
I'd say under 500 and you'll usually be fine, as a rule of thumb. I had a bug where my game made 20k objects though and with responsible programming it only went to half fps (I was freaked out by that I must admit).
If you're using the Hardware Accelerated build of MMF2, which a lot of people idiotically think isn't much faster then the normal MMF2, and your videocard doesn't suck, then you can pull the full 10k, moving, resizing, rotating, animating, etc, and still pull a solid 60fps.
Originally Posted by BrandonC If you're using the Hardware Accelerated build of MMF2, which a lot of people idiotically think isn't much faster then the normal MMF2, and your videocard doesn't suck, then you can pull the full 10k, moving, resizing, rotating, animating, etc, and still pull a solid 60fps.
that is an excellent point, and something i neglected entirely. thanks for mentioning it. I hadn't given any consideration to the hardware acceleration before this.
Don't use that as it stands. It's still quite buggy and doesn't support quick backdrop gradients with ink effects, might even be all quick backdrop objects. And don't make any object larger than 1024*1024 (I think, might be bigger) or else it won't display.
But if you're adamant then be sure to disable DirectX rendering of the frame editor. It's the cause of many crashes for me.
And Brandon, WTF, chillout! No need to call people idiots.
I'd say about 1000 or so. Best way to tell is by using the debugger and try to patch it when the frame rate starts dropping. One thing about MMF is that if it's struggling to work on your comp, chances are it'll be struggling to work on someone else's comp as well, whether it's 50% better or worse.
I used the colorizer object to make a major colorizing effect on my game. Since it lagged so badly when it use, I only created the object while using it. Strangely, by slowing the frame rate down, it added a bit of a bullet time effect
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.