This one's a bugger, if you've never had this bug then I guess you don't need this. But if you're hella frustrated with it then heres a kind of fix.
What is it?
For whatever scientific reason MMF2 will swap one graphic for another. This appears to spread over object types, in the aboves case it's swapping out a background object on a layer higher to the sprite with a random frame from said sprite.
I've had this! Enough, tell me how to fix it!
It's a simple fix, but I've only got a method for those making multi-frame games.
Rather than have the game go from-
Level/Frame 1 > Level/Frame 2
You'll be needing to send the game to an intermediate frame that contains no objects. So...
Level/Frame 1 > Clear frame > Level/Frame 2
In my project I've got it set to run a little fastloop to clear some sound channels too. It's easy enough to add in, so have some psuedo-MMF2 code!
Level/Frame 1... Start of frame+global value=0; set global value to frame number+jump to clear frame.
Start of frame+global value>0; set global value to 0.
Clear frame... Jump to frame: global value.
And that kills the bug! Ever since I added this I've not had the repeating graphic bug.
Why don't you do more articles, James? Could be phun!
I know a guy with the last name "Phun". It's pronounced foo-n.
Nice article, never heard of this, but if I ever see it, I'll know what to do. So there can be nothing whatsoever on the clear frame? Not even a watermark to scare people?
Well the more objects in the frame the longer (even slightly) it will take to jump back to Frame 2. Originally I had it set to create about 8mb worth of graphics using a loop, just to clear out the old graphics from memory. But it's not needed. All MMF needs is a break of a frame to sort of the problem.
Haha wow nice. I've had so many good memories of this bug in Ainevoltas 2. Thanks for a solution. Don't think I'll update my game though, keep it in it's glory.
I have never come across this problem, but I do remember several people complaining about it on the clickteam forums. I don't think Yves or Francois ever found the cause of the problem, as it was extremely rare and hard to reproduce.
James I would suggest you send one of them an example of the problem so they can work out the bug.
Good heavens yes. Was easy enough to fix though. Since saving and then restarting the game would remove the bug I figured it must have been something to do with memory and frames.
A wee update - it doesn't matter clearing the sound channels or creating actives. I've been testing this for a while now and all MMF2 needs to do is momentarily jump to a blank frame.
Very neat.
I've managed to avoid this since my games tend to take place entirely in a single frame, but now I'll know how to stop it if it does come around!