Hey, I just got a brainstorm for a good "expansion" to the system object. Of course, it's 12:30 at night, so I don't know if this idea is really as great as I think it currently is. Anyway:
You know how we've got these "always" events? Well, often times I find I have events that would be better off done every second frame, instead of every frame. Things like not so game critical processing stuff.
I know we can use a timer event, but the problem there is that if the framerate of the game drops on a slower computer, the timer events will "stack up", making it go slower and slower if the PC can't keep up with the calculations.
We can get around that timer limitation by using a counter, or an active object alterable value, essentally setting up "timers" that are event loop based instead of system clock based. But that's really messy, and questionable too because for each one of those we set up we now get an event that says "Always add to our counter", and another that says "check if our counter needs to be reset". Two new events just to limit the first one.
I propose a "always every second frame" feature. MMF could automatically run these "always every second frame" events only every other frame, pretending they don't exist for the first, third, and so on frame of the game. Essentally it's sort of like MMF has a second "game loop" that only is run every other frame. In principle, it's basically the opposite of what the "fast loops" let us do currently. Instead of telling MMF to do the action many times over each loop, we are telling it to give the event a break.
MMF could simply have a single internal "flag" that is flipped every loop to store/check if the extra "always every second frame" events should fire.
What do you all think? Would this be as helpful as I think it would be for saving resources? Or am I so left field and really need my sleep?
Come to think of it, something that works like "every x number of frames" would be really handy too. But I'm not sure if having the MMF runtime keeping all the spare numbers needed to support the "every x number of frames" would be worth it, especally since we can do the same thing with a "counter" and an "always" event(admittedly, that method is probably slower then if MMF's runtime supported it directly).
Then again, I know virtually nothing about the back end of MMF's runtime. I'm just a user who's a bit tired of making "always add 1 to alterable value X" or "Toggle flag 0" events in order to delay things to every other frame. :p












Reply With Quote





