User Tag List

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

Thread: Best way to slow down time in a Game?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best way to slow down time in a Game?

    Hi
    Im wondering what would be the best way to slow dow time in a game?
    I also want the method to be able to slow down the game to a complete pause.

    All my movements are custum made ( no Built in Movements used ).

    ...
    I allready know about a few ways of doing this ( in theory ).

    METHOD 1
    Include a 'on loop "Game Loop"' event in all of the Events.
    This way how often "Game Loop" runs determines at what pace things happen in the game.

    Backside 1 - The game might look 'laggy' since the method just slows down how often the Events are run.
    Backside 2 - It might be hard to change the speed of Animation Sequences to fit the pace of the game.

    METHOD 2
    Have a global 'Speed Multiplier' ( like a Counter ) wich modefies all speeds in the Game, including Animation Sequences ( i think default Animation Speed can be accessed by going: Animation -> Restore -> Animation Speed )

    METHOD 3
    If possible, change the Frame Rate of the Application.
    Im unsertain if this will cause troubble for different Machines or just in general.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,329
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Seems like you have a good understanding of this allready. For me Method 2 stands out as the best choice. Since every movement is custom anyway, this should be easy to do.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for taking the time to find this Stephen, im sure it will be very helpfull

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,862
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    That example is incredible. Thank you Stephen for posting it. Really great effect!!!

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,537
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dines method is similar to what I've been using in Asunder; the game was designed from the beginning with dynamic time slowing, speeding, and reversal in all aspects.
    What I do is have a set of 3 main counters for every object in the engine (theres actually a lot more, but these are the pertinent ones to this time effect):

    "TimeScale"
    "TimeOffset"
    "TimeMod"

    The TimeScale is the speed of that object through time; 0 minimum, no cap. 1000 is a 1x speed modifier, making it travel at 'normal' speed.
    Now every frame, add to the objects TimeOffset its TimeScale, then set the TimeMod to the TimeOffset / 1000, and TimeOffset to itself modulo 1000
    That way the object will build up that increment based on its current speed- it will pass this along to the TimeMod variable- and store the remainder.

    Then for every action the object does, multiply it by the TimeMod. If it has a 1 px/frame movespeed, you make it move TimeMod/frame pixels.
    Not only does it let you slow down the game to ratios (TimeScale = 500 would make it move 1 px every 2 frames), but it lets you speed it up too (TimeScale = 5000 would move it 5 px every 1 frame). The trick here is that if you hardcode the modulo divisor into the events, you can make objects easily move at fractions of 1 px/frame even at 100% speed- it doesn't necessarily have to be a 1000 divisor.
    And thats something important to my engine since the movements are all non-linear relative to surface normals, so its otherwise difficult to make stuff travel at speeds other than integer px / frame. Also use these integer values instead of floats because of how data is stored for my time machine, but thats another story.

    But an example of it in action, for a particle effect, looks like this:



    The trick here is not only can you speed up / slow down objects to any specific speed, but you can have objects at any different dynamic speeds at the same time. So you could with a single line of code make it so that all objects travel faster according to where they are from left to right or at a distance from the player or any of that jazz. But the downside is, you need to plan for this effect from the very beginning of your project, and it would be nigh impossible to retrofit an existing game to use something like it.


    And to answer your question about animation speeds-
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=230080

    Jaffob was incredibly nice and whipped up a custom extension that helps do exactly that, I recommend you check it out. In my project, I can simply set all animation speeds by just multiplying their normal animation speed by their timescale / 1000.0 and turning it into a min/max capped integer.

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pixelthief, impressive, but that looks like overkill compaired to what i am trying to do.
    Where you the one who created a game called "Edgards Science"?

    ...
    I recently found out it is possible to change the FrameRate during runtime.

    Would it be bad conduct to alter the FrameRate to achieve time-slowdown?
    What would be the potential problems with doing this ( Windows, Flash, iOS, XNA )?

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,123
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Is there some example like that cool Bullet Time example that also works with Flash?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,862
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I wasn't able to find the "cool bullet" example? King,.I would bet the slowing the frame rate at run time would work also,.but not to slow. I think if it got to slow everything would seem to be jumpy? I'd like to see your example!

    EDIT:
    I just tried the slow frame rate with a simple event for a test and it worked pretty good! I just set "always" + timer is >10 secs,,"set frame rate to 10" and it looks pretty cool. Now to slow the sound down when this happens,.would be really cool..!! The above was just for testing, but you could use a simple a value and it would work too.

    Problem with this, it slows down all timed values too,..so it's not a good idea..

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I recently found out it is possible to change the FrameRate during runtime.

    Would it be bad conduct to alter the FrameRate to achieve time-slowdown?
    What would be the potential problems with doing this ( Windows, Flash, iOS, XNA )?
    Unfortunatley, I've heard that you can't change the FrameRate at runtime in Flash, so that would be one downside (don't know about iOS or XNA though). The other downside is it might look a little bit laggy if you lower it too much. There is a tutorial that tells you to use the FrameRate altering method, so it's not that bad (other than the downsides I already mentioned). You could try a multiplier counter, which is the second method on your list.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. time/split time for racing game
    By ptiseigneur in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th September 2012, 06:05 PM
  2. I need help with Bullet time(slow down) using PMO
    By Krim in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th June 2012, 08:43 PM
  3. app runs slow the first time
    By jchristiansen in forum File Archive
    Replies: 2
    Last Post: 16th May 2010, 02:49 AM
  4. app runs slow the first time
    By jchristiansen in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th May 2010, 10:42 PM
  5. game slow down
    By pirodaggar in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st July 2008, 02:16 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
  •