






1) Try to use short names for loops - MMF looks through list of all active loops letter by letter
2) As MMF looks trough all active loops keep them in groups which you are disabling or enabling as needed
One obvious optimization would be for scaling or rotating objects: always set "quality" to 0.
I also find that scrolling can cause significant FPS drops when there is a decent amount of thigs happening on screen ( as opposed to not scrolling ), or if background objects are too big or detailed.
Other than making design considerations or resizing the App window size, im not sure what else can be done about this.










- Reading strings is slower than reading values. Therefore, comparing strings in a fastloop can be way slower than comparing values. If you are going to loop through active objects, use alterable values instead of alterable strings if possible.
- Alphachannels can reduce fps. In some situations a good solution is to take a screenshot of the object that has alphachannels, then remove alphachannels from the object and use the new image instead.
Can an admin please allow me to edit this thread so I can add suggestions to it?
Sorry for spam, but I can't edit the thread, nor can I message any admin because it says I've reached my limit; even though I haven't sent a PM since the forum update.


When using fastloops, put each fast loop into its own event group. On the line that runs that fast loop, sandwich the call between opening and closing that group, for example:
*Always
= Open Group "Foo Loop"
= Run Loop "Foo" for 10 loops
= Close Group "Foo Loop"
If you're invoking a fast loop from inside of a fast loop, you can even close the current group and reopen it;
(inside of group "NOOP"):
*On Loop "NOOP"
= Close Group "NOOP Loop"
= Open Group "Foo Loop"
= Run Loop "Foo" for 10 loops
= Close Group "Foo Loop"
= Open Group "NOOP Loop"
The point here is to make it so that each time you call a fast loop in MMF2, the only visible fast loop events to the runtime are the ones you want to run. This way MMF2 doesn't have to parse all the exponential fast loop event overhead and string comparisons for each loop event on each loop call, but instead only the ones that you're actually going to use. So if you had 200 different fast loops, you'd make your program run about 200x faster
There are some good optimisation techniques on Chris Burrows site, especially for detectors on active objects and object pairing.
I've also been using a trick since C&C days which saves an event or two - If you have an object that is only supposed to live for a short period of time, for example a particle (fire/smoke/water etc) create an active object with only an Appearing animation. Make sure you delete the default stopped animation and set the Appearing animation up to play for how long you want the particle to live (through animation frames, frame times and repeats - but don't do an infinite loop). What MMF does when you create this active is it plays out the Appearing animation automatically and when that finishes as there are not other animation categories, MMF will destroy it. You can add Bouncing ball movement to it too. This trick works especially well in slower runtimes like iOS and Android as you can create loads of objects without having so much of a performance impact.
Andy H @ ovine.net
Awful Jokes - a new cartoon every day: http://awful.ovine.net/
Ovine's games: http://www.ovine.net