animations/actives cause FPS slowdowns?
Working on a game engine here. I have a few active objects that contain animation. More specifically they're water tiles consisting of 32x16.
I want all the animations of these tiles synced together. I did this by setting the 'inactive if too far away' option of the active object to no. Unfortunately, I noticed this causes a FPS slowdown in my game.
If I change the 'inactive if too far away' option to either automatic or yes, the water tiles are completely de-synced.
So I'm wondering if there is any way i can sync animated tiles together without making the FPS drop by inactivating the objects if they're too far, or having to make a separate animated object just for the size I need (placing the tiles together in one active object).
Re: animations/actives cause FPS slowdowns?
Too many actives on screen will cause lag wether they have animation or not.
If you want all water tiles to display the same frame at teh same time, just code it in your events.
Have some form of counter to store the current water frame and always set the water tile animation frame to the current value of the counter
Re: animations/actives cause FPS slowdowns?
So, even if I have off screen objects, inactive or active, you think it would slow down the fps rate? Or should inactive objects help with this using animation sync method?
Re: animations/actives cause FPS slowdowns?
Objects offscreen will only nominally increase render time- for the most part, they will simply be consuming extra memory, not processing. The amount of objects being displayed at the same time on-screen is what slows down programs graphically- normal MMF runs in software mode and will not be able to handle terribly many before performance suffers.
If possible, you should try the HWA version of MMF that can render in DX3D 9, which usually means you can have thousands of objects onscreen before the game slows down (providing your player has a graphics card on his computer).
Re: animations/actives cause FPS slowdowns?
Is this what you want me to do?
http://img204.imageshack.us/img204/2715/imageyc.gif
I did this, but this just freezes the animations of the water tiles. X_X
Maybe I did something wrong here. But this sounds like what I heard you told me to do with it. And again, this freezes all the water active object tiles. @_@
Re: animations/actives cause FPS slowdowns?
Have you turned off fine collision detection? MMF still has to save background for every single water tile, maybe that's the problem. Another idea: use an AO in screensize, invisible, no background saving, no fine collision. Uncheck "Follow the frame" or keep it centered in the visible area with code.
Water doesn't overlap BigAO -> Stop anim
Water overlaps BigAO -> synchronize animation
When centering the AO with code, you could also check if it has been moved since last water sync. If not, no anim update is required.
Re: animations/actives cause FPS slowdowns?
You should always increase counter by 1, and then set the animation frame to counter.
What you are doing is basically an infinite loop, you are setting them to eachother which is why nothing happens.
The following code should work
+Always
-> Add 1 to counter
+Counter > maximum water frames
-> set counter to 0
+Always
-> Set frame of water tiles to counter
Re: animations/actives cause FPS slowdowns?
And make sure that "Inactive if too far from frame" is set to "Yes". You don't want MMF2 to process the objects you can't see.
Re: animations/actives cause FPS slowdowns?
But if that's the case, the objects animation time of its own is not used. It is strict to the counters current number. If the counter always keeps adding 1, wouldn't that make the animation too fast? o_O
Re: animations/actives cause FPS slowdowns?
Change the animation speed with the counter by replacing "Always" with "Restrict actions for ___" and throw in the difference between each frame. You could then also change the animation speed to whatever you want..i.e. stormy level = stronger wind = faster water
-Waterspeed=0
-Restrict actions for: 00"-50
+Add 1 to water frame counter
-Waterspeed=1
-Restrict actions for: 00"-25
+Add 1 to water frame counter