User Tag List

Results 1 to 10 of 10

Thread: SloMo effect with Box2D - is it possible?

  1. #1
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    SloMo effect with Box2D - is it possible?

    Hi folks--

    It's been a long time since I've been able to devote real time to a Fusion game, but I'm getting back into, and playing around with the Box2D physics for the first time. (I know, I know. A little late to the game. )

    I'm trying to create a SloMo effect that would work well on objects using the Box2D physics engine. The intent is to use it when the player activates the weapons menu. Think Doom 2016 or Fallout 4 VATS...the game keeps going, but much more slowly, and gives the player some time to pick a new weapon or whatnot.

    Trouble is, I've been playing around with the different properties available, and different formulas, and I'm just not sure how to make this happen.

    This is what I was playing around with last, and yes, there are hard-coded values in there that I KNOW are not the right way to go. What I've made will approximate slomo movement, but actually ends up changing trajectories and stuff slightly. No good, right?

    What do you all think? Has anyone tried this before?
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export Module
    N64Mario's Avatar
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1,306
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Curiosity, souldn't you just change the current framerate to about half of it's original (Ex. from 60 FPS, to 30 FPS) to give the slow mo effect?

  3. #3
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ha, yes, I did try that! Even with the jerkiness that comes with it, I thought it could be an option.

    And it works... For the Y_POS / X_POS based movement.

    However, the Box2D physics objects continued to move at their regular speed, just with fewer drawn frames.

    So I didn't know exactly how Fusion calculates the Box2D physics, but it appears to happen at a rate independent of the frame rate...

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    Yeah, the physics engine adapts to the currently set FR. It only slows down if you set a FR higher than the actual output, for example setting the FR to 120 and Vsyncing to a 60Hz screen will slow the physics down, but that effect cannot be abused as a design choice I guess.

    A possibility for slowing down manually could be to save and store all important specs of your objects at a certain pace (normally gravity, linear velocity plus vector angle and angular velocity), then set all those values zero, reactivate the physics at your wished FR by applying the stored values back after pause. I pause my physics this way and it works well, have not tried to do it at high pace tho.

  5. #5
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hmm...
    Yeah, that's a cool idea! Effective introduce a regular "stutter" to simulate slow motion.
    I wonder what would be more costly in terms of memory: using expressions to store those values in the Alterable Variables of each object, or storing them all in the Named Variable Object.

    Well, I need to do some testing. Thanks for the ideas, guys! I'll post back about how it goes 👍

  6. #6
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Julian82 View Post
    Yeah, the physics engine adapts to the currently set FR. It only slows down if you set a FR higher than the actual output, for example setting the FR to 120 and Vsyncing to a 60Hz screen will slow the physics down, but that effect cannot be abused as a design choice I guess.

    A possibility for slowing down manually could be to save and store all important specs of your objects at a certain pace (normally gravity, linear velocity plus vector angle and angular velocity), then set all those values zero, reactivate the physics at your wished FR by applying the stored values back after pause. I pause my physics this way and it works well, have not tried to do it at high pace tho.

    I managed to create (basically) what you were talking about, but I'm not seeing the preciseness I'd expect. The bouncing balls controlled by Box2D ARE slowing down (which is good), but then they're also losing some sort of speed or momentum during the "switch off" / "switch back on" process. I've tried modifying world gravity instead of object gravity, but neither one made a difference. I tried fussing with the friction as well, and changing the order of action...to no avail.

    Any clue what the issue might be, based on what you've been able to do?


    Slow-Time with Physics_V2.mfa

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    I don’t have access to my PC right now, I’ll have a look tomorrow or today evening. I only use static objects, so maybe with bouncing ball there are other variables involved. When I need a bouncing ball btw I just make a static object with high elasticity.

  8. #8
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Julian82 View Post
    I donít have access to my PC right now, Iíll have a look tomorrow or today evening. I only use static objects, so maybe with bouncing ball there are other variables involved. When I need a bouncing ball btw I just make a static object with high elasticity.

    Sounds good- I appreciate it! (I'm only using the Box2D static movement as well.)

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    @alxmrg : Made an example of the "stutter"-method. I think you're right - when repetitively pausing/unpausing physics a little momentum seems to get lost. If you can use this will depend on how precise your slow motion has to match the real-time movements. I doubt players would really notice the difference on many setups.

    https://www.dropbox.com/s/yudv1crozb...0down.mfa?dl=0

  10. #10
    Clicker Fusion 2.5HTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2009
    Posts
    107
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Julian82 View Post
    @alxmrg : Made an example of the "stutter"-method. I think you're right - when repetitively pausing/unpausing physics a little momentum seems to get lost. If you can use this will depend on how precise your slow motion has to match the real-time movements. I doubt players would really notice the difference on many setups.

    https://www.dropbox.com/s/yudv1crozb...0down.mfa?dl=0
    Hey - I appreciate you testing it out. At least I know I'm not crazy!
    Where I was thinking it might be an issue is if I'm implementing some physics-based puzzles, but honestly, I should probably custom-code something like that anyway. (If opening the weapons menu causes slow-time, and the player keeps opening the weapons menu, they could muck up something physics-based if the object loses too much momentum.)

    I'll play around with it some more.

    Thanks again!

Similar Threads

  1. Pseudo 3D Parallax Effect (Pole Position Effect)
    By gkinfinity in forum Fusion 2.5
    Replies: 15
    Last Post: 30th November 2017, 05:16 PM
  2. 2 effect shader?? is it posable Blur's then Add effect
    By Darkseed in forum Hardware Accelerated Runtime
    Replies: 0
    Last Post: 7th March 2015, 04:31 AM
  3. [RC] Box2D
    By Looki in forum Beta Flash Extensions
    Replies: 32
    Last Post: 25th March 2013, 06:16 PM
  4. Box2D help
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 30th June 2012, 05:38 AM
  5. Explosion effect - possible with particle effect?
    By MediYama in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 13th April 2008, 08:36 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
  •