User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: How can I display something every second frame exactly?

  1. #1
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,081
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)

    How can I display something every second frame exactly?

    I want to run alternating events on every other frame (eg. ABABAB), and I'm not sure how to do it.

    I can make something display every second tick (every second loop of the events), but that won't necessarily correspond to actual frames that the monitor displays. Depending on the FPS and other variables such as vsync, some ticks may get displayed more than once, while others may run but not have time to get displayed, meaning that my ABABAB may end up something like ABAABAABBA

    Is there a way I can do this? Perhaps a way to test whether an event loop has made it to the screen?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,111
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Volnaiskra View Post
    Perhaps a way to test whether an event loop has made it to the screen?
    I doubt this is possible, but I'd like to know this too?

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    495
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Testing some functions and realized the "frame" action refers to the frame in the Frame List, not the number frame out of the framerate. I really wish Fusion used some different terminology, especially because both are under the Storyboard controls.

    Anyway, I can't believe this works, but create a Global Value, call it something like timeCheck. Always Add 1 to timeCheck. Then, run a Compare Two General Values funtion, and run a mod function to check for even numbers. The event list should look like this:

    Always: Add 1 to timeCheck
    timeCheck mod 2 = 0: Thing A
    timeCheck mod 2 = 1: Thing B

    I ran this with 3 tests: adding numbers to a list, switching a counter between 0 and 1, and flashing the screen between black and white (not recommended for anyone prone to seizures). In the list I got 100% consistent 0 and 1 on alternating lines. The counter switched between 0 and 1 without getting hung on a number. The flashing hurt like hell. This worked with VSync on and off.

    Theoretically this should give you consistent results but depending on how heavy the code gets you may want to run a Fast Loop as the first first event in the frame ("frame" being an interchangeable term now, ugh) just to kind of force the function to run before anything else.

  4. #4
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,081
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    Yes, this is the method I'm using currently, and it works well at 60fps but starts going haywire once the framerate dips much below that. And if the slowdown occurs during the rendering rather than during the events, then I don't think the fast loop suggestion would help.

    Totally agree about Clickteam needing different terminology! Frame can mean at least 4 different things, and this has caused plenty of confusion for me over the years:

    1 one visual frame in the fps sense
    2 a frame (including its event sheet) in the frame list on the side
    3 the visual and spatial portion of the game that you edit with the frame editor, as opposed to the event sheet, which you edit with the event editors.
    4 the size of the larger game area, as opposed to its resolution.

    Meanwhile, what do you call the area of the game that the player can currently see, to the exclusion of the rest of the level that lies outside its borders? To me, the most logical term for this would be the "frame". Yet this is the one of the few things that isn't called frame

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    495
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    See this is why I love Unity's term for the equivalent: Scene. As far as I know, Scene has no technological overlaps. So that would be very handy. I would personally call the area where you plop down objects and such the Canvas, in the level or not, but that's just me being an artsy type.

    Now as for the the technical problem, I tested this at 10fps and it still worked great. But then again my Phenom II has always cooperated with Fusion much better than other processors, particularly Intel, but creating timers like this was always the solution to keeping things running consistent no matter the CPU.

    Framerate variation is always going to occur, whether you're in Fusion or Unreal, just based on what's on screen, what needs to be rendered, what needs to be calculated, which part of the computer suddenly needs to do what, etc. So my general recommendation would be to redesign the system to be a bit less specific in terms of timing, or do what you can to try and force the engine to always maintain as steady a framerate as possible: VSync on, 2 or even 3 back buffers, 60fps, maybe even Machine Independent Speed and reduce the color count.

  6. #6
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,081
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    Framerate variation per se is not the problem. Some things just really need to be on alternate frames - think strobe effects or double-vision effect. Anything other than alternate frames is likely to create weird rhythmic patterns or jitteriness.

    The speed or quantity of those frames (ie. Whether steady 60fps or irregular 40-55fps) is less important

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    495
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I tested this method with a strobe effect and it seemed pretty perfect to me. It's possible but unlikely that what you are looking for is the actual Timer functions. Like set it to Every 1/100 Seconds instead of using a custom alterable value based timer, and toggle a flag somewhere along the way that'll switch up the function. I dunno if the Timer is less framerate dependent but it miiiight be the way to go?

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    495
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Otherwise it could be a delta time function but I've never used those much.

  9. #9
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,081
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    I've discovered the culprit. I was using Machine Independent Speed, and this is what's been screwing up the double-vision effect I've been working on.

    It makes sense I guess. Machine independent speed probably achieves its aim by dropping frames from the render queue when rendering them would cause a delay. So when I run my effect, which looked smooth on my main PC, on my laptop, there are dropped frames left right and centre. In most scenarios a few dropped frames don't really matter, but in this case it made the effect so jittery as to be unusable. If I disable machine independent speed then it's fine again (but the timing of the rest of my mfa becomes stuffed).

    I guess some sort of delta time solution might be the only answer. I really wish that there was a way for fusion to tell you if it's dropped a frame or not though.

    Anyone know of any good fusion-specific delta time tutorials?

  10. #10
    Clicker Fusion 2.5Android Export Module

    Join Date
    Sep 2010
    Posts
    536
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sorry if this is a completely stupid idea. I've never had to deal with time stuff that must be exact. I'm merely speculating here. Would the time/date object be useful? Can it be used to check seconds from the actual system/Windows clock? Like I said, I really don't know but i thought that it might be worth to at least throw the idea out there :-D

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Keep display from previous frame
    By Popcorn in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 21st December 2013, 11:52 PM
  2. Frame Properties > Keep display from previous frame not working - Beta9
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 31st May 2012, 08:49 AM
  3. Cannot get score to display on another frame
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 17th May 2010, 03:36 PM
  4. Display a picture on the end of the frame
    By PsySpooky in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 2nd April 2007, 04:08 PM

Posting Permissions

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