So, I was looking into ways I could remove lag from Fangame, and it lead me straight to the dust I have swept under the rug a while back.
A short explanation. MMF2 has some built in functions involving "collisions with backgrounds", and "backgrounds" in this context means solid tiles such as walls, floors, and ceilings.
Rather than using this method, which originally I had confused with actual background scenes, I created all of the solid tiles as "Active Objects" rather than "Background Objects" as I described above. As far as I could tell, there was little difference, so I continued to build the game in this manner.
To get to the point, it just so happens that there IS a difference. Active Objects use more memory than Background Objects. Now, you wanna know why Fangame lags? This is why. All of those solid walls, floors, and ceilings are Active Objects that take up memory.
Converting all of those tiles to backgrounds and modifying the event code to detect collisions with these backgrounds is a lot easier said than done, however it will result in two very important good things:
1. It will greatly optimize the event code in a way that will be more globalized and centralized, making future edits much more manageable.
2. It SHOULD not only reduce lag from the game, but could very well eliminate it altogether.
So, when I get home today, I am going to begin working on this... hopefully.
|