User Tag List

Results 1 to 8 of 8

Thread: Every Other Frame Always Event Suggestion

  1. #1
    Clicker Fusion 2.5SWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    Indiana, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Every Other Frame Always Event Suggestion

    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

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    How about

    Always
    - Add 1 to Alterable value X

    Alterable value X MOD 2 = 0
    - Execute your every second frame event


    Or if MOD scares you:

    Always
    - Add 1 to Alterable value X

    Alterable value X = 2
    - Execute your every second frame event
    - Set Alterable value X to 0

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    I'll add that the issue with requesting new features that can alternatively be done with low level MMF knowledge, is that the investment in time isn't worth the limited results.

    If Clickteam go and patch the event editor with an 'every second frame' event, then somebody says "Hey you know what would be good? An 'every third frame' event! When does it end? You can't please everybody, so it's best to leave the functionality up to the developer by making the event editor as flexible as possible.

    Throwing in a bunch more single-purpose conditions won't do much good, in fact I think there are too many conditions/events as it is.

    For example, Add To Alterable Value and Subtract From Alterable Value, Set Positon and Set X Position/Set Y Position. A lot of this could be condensed.

  4. #4
    Clicker Fusion 2.5SWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2006
    Location
    Indiana, USA
    Posts
    110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    Eh, your probably right. It was late, and I was just tired of staring at all the bazillion versions of those add to alterable value events trying to figure out which one was the broken one. (my game has quite a few seperate ones, because none of the objects are going to always be there, including the HUD actives.) :p

    Never thought to use Mod on the alterable value to save an event though. Does that work infinitely? I'd think after a while the alterable value would either loop to negative, hit it's max limit, or the mod function would start taking an insane amount of time to calculate(thus canceling out any performance issues it might have solved) due to the alterable value's size.

    I'm with you on the Subtract alterable value. Add is useful, but I'm not sure why there is a Subtract when you can do the same thing by "adding" a negative value. Just write the formula as "0 - whatever", and it does the same thing that subtract would do. In all my time using MMF/TGF, I don't think I actually ever used that function.

    The set X and Y positions however are useful because sometimes you only want to alter one axis, and other times you want to fully set both to some point on the screen. Sometimes I do wish the Set Position would let us put in complex formulas, but on the other hand it's nice to be able to just pick a spot on the screen visually, especally for new users of the software who arn't quite used to "thinking in event code".

    Perhaps a better feature(if it doesn't do it already) would be to compile runtime versions that only contain the functions of the MMF engine we actually used. Of course, that sounds like a scary feature that would probably break everything to hell and back again if it didn't work right. But it would also mean that if you event coded your program to not use, say for example, the timer events, the final exe/swf/java/whatever would not even have the timer code installed in it, cutting down the file size.

    Then again, that sort of feature probably would take a total restructuring of how MMF ticks, and so probably isn't worth the few kb it would shave off every project MMF made. :p

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    You're right, using mod would hit a limit

    Alterable Values maximum is 999999999.

    So after 192 days of your game running non-stop, the limit would be hit.

    However, in many cases I've used an alterable value just to keep track of the current frame per second. Eg.

    Always
    - Add 1 to Alterable Value A

    Alterable Value A = 60
    - Set Alterable value to 0

    In this case you could use MOD to get your every 2nd frame without worrying about reaching a limit or dealing with high numbers.

    You're probably right that it gets slower with higher numbers, whether this will be noticable compared to everything else that MMF2 has going on though would be debatable.

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    I had a feeling I'd seen an object that had an 'on every n ticks' or something, which effectively would run every, say, 5 frames. Shouldn't be hard for someone to make an extension which did this, it would just assign itself a unique id and keep counting every time its condition was tested until the count was equal to the value of its parameter. If so, then reset the count to 0 and return TRUE to trigger the actions...?

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    Quote Originally Posted by Ryan
    Alterable Values maximum is 999999999.
    No...?
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=197945

    Quote Originally Posted by Dines
    I had a feeling I'd seen an object that had an 'on every n ticks' or something, which effectively would run every, say, 5 frames. Shouldn't be hard for someone to make an extension which did this, it would just assign itself a unique id and keep counting every time its condition was tested until the count was equal to the value of its parameter. If so, then reset the count to 0 and return TRUE to trigger the actions...?
    RickyRombo's WaitFor object?
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Every Other Frame Always Event Suggestion

    Thanks LB, I did a quick google search to find out, turns out it brought up an outdated post

Similar Threads

  1. 1 event in first frame activate an event in another frame? Sub-Application Tool
    By CloudExSolider in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th October 2013, 11:23 PM
  2. Event Editor suggestion
    By RayMarble in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 19th January 2010, 04:21 PM
  3. Suggestion: Minimise Event
    By stuckboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 6th July 2008, 06:26 AM
  4. A Suggestion for MMF (Event Editor)
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 18th September 2006, 01:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •