Time Scale Framework

Time Scale Framework

Summary :zap:

Ever wanted to speed up time or slow it down? This just might be the resource you’re looking for!
I have created this resource for a project of mine which I’m working on & would like to share the core mechanic of it with the community. I’ve been working on this on and off for the past few years and feel that it’s now stable enough to be shared with the community.
Tutorial can be found here.

For those who would like to contribute to this project, you can do so through the GitHub page here. Contributions are welcomed and much appreciated! :smiley:


Features :white_check_mark:


Bugs :bug:

You can find known issues & report new ones on the GitHub here.


Limitations :pause_button:

This framework does not have an integrated solution for Tweens meaning that you will currently have to account for time scale changes manually. A solution for this is currently under development. :warning: This is expected to take a while though! :warning:

The core of the framework is stable however there is some limitations to the framework which are listed below:

  • Humanoid jump is not affected by time scale.
  • Models must have a PrimaryPart set in order to be properly affected by time scale changes.


Future Updates :clock10:

In the future, I’d love to expand on this framework and make it work even better with more games to expand the number of possibilities! Below is some ideas I have on how I can achieve this. Please let me know if you have any other suggestions!

  • Correct time scale so that 10 is 10x faster than normal rather than 10x slower than normal.
  • Humanoid jumping support.
  • Tween support.


Links :link:

Below is links to where you can find my work on this framework:


Developer Documentation :open_book:

All events and functions are generated at runtime. Anything that is not mentioned in the documentation is not intended for use by developers.

Attributes

Learn more about Attributes.

ReplicatedStorage/TimeScaleUtilities/TimeScale - Set this to change the current time scale.

CollectionService Tags

Learn more about CollectionService.

TimeScaleWhitelist - Whitelist instances that can be affected by time scale.

Modules

Learn more about Modules.

ReplicatedStorage/TimeScaleUtilities

Function: Wait(Number WaitTime) - Adaptive wait function that takes into account time scale changing.



Updates :loudspeaker:

Below is a list of all updates made to the Time Scale Framework.

Release Date Version Forum Post GitHub Release
12/10/2021 Version 3 Update 3 Post Link GitHub Link
06/10/2021 Version 3 Update 2 Post Link N/A
05/10/2021 Version 3 Update 1 Post Link N/A
30/09/2021 Version 2 Update 1 Post Link N/A
22/03/2021 Version 1 Update 12 Post Link N/A
21/03/2021 Version 1 Update 11 Post Link N/A
23/02/2021 Version 1 Update 10 Post Link N/A
15/02/2021 Version 1 Update 9 Post Link N/A
11/02/2021 Version 1 Update 8 Post Link N/A
07/02/2021 Version 1 Update 7 Post Link N/A
04/02/2021 Version 1 Update 6 Post Link N/A
03/01/2021 Version 1 Update 5 Post Link N/A
20/12/2020 Version 1 Update 4 Post Link N/A
13/12/2020 Version 1 Update 3 Post Link N/A
12/12/2020 Version 1 Update 2 Post Link N/A
05/12/2020 Version 1 Update 1 Post Link N/A


Finishing Up :wave:

Please reply with any bugs or suggestions you have. I’d love to also see what people can make using this! :smiley:

Thank you so much for your time & a massive thank you to the contributors of this project! I hope this can be of use to you or just be an interesting resource to look into.

90 Likes

Once a part falls and you stop slow motion, The part will fling away just like in the video below.

https://i.gyazo.com/ca6a5b68172645b7b045e92d2f6c69e2.mp4

4 Likes

Ah yes, I believe that’s to do with Roblox physics system trying to keep. I have to run a loop through all the parts in order to keep them updated with the time scale that they should be in. I’m not too sure on how to counteract how jerky it can be at times but if you have any ideas feel free to let me know!

3 Likes

Perhaps when time is frozen, you simply anchor any affected parts? They’ll retain their velocity, but won’t be flung away when time resumes.

2 Likes

Forgive me if I’m misunderstanding what you mean but time doesn’t freeze though, the configuration file module let’s you change how slowed or sped up time is so I can’t really anchor objects. :c

2 Likes

@FracturedSoftware i suggest you use

this to adjust the anim speeds btw gr8 work over all

1 Like

Sounds like a cool idea. Might use this to make my own superhot

Thank you for the suggestions, will look at this now & try and get an implementation working. Haven’t really used animations before asides one or two occasions so I get to learn something new!

1 Like

Been taking a look at it & it doesn’t show up in the explorer and appears to only be accessible when it is returned by calling LoadAnimation and assigning it a variable. I can add a tag for animations which the developer can tag it once it’s created and hopefully that works but it’s not ideal. Should hopefully work for now though finger crossed.

1 Like

Animation Update

Quick update, animation support has been added, it’s relatively basic animation support at the moment and can sometimes be a little buggy, please let me know if you have any contributions to make to help make this project any better! :smiley:
The update also contains some humanoid fixes and other small improvements.
Enjoy! :stuck_out_tongue:
Still looking into some kind of multiplayer support… :upside_down_face:

1 Like

I would find this framework more useful if it were to support multiplayer as well.
Is it possible you could create server-sided API?

I’m working on a possible multiplayer solution at the moment, my current plan is to either blur or hide the other players views so that they would only get an see when a real 1/60th of a second or however long had passed while people who are in the speed time could see normally.
I can add server sided APIs and documentation to this, you got any thoughts on what you would like to see from this?

1 Like

I think just having logic handled on the server (with the client replicating the effect) will be a good way of doing it.

Alright I will work on that later, got to go out quickly for a bit, should have a working implementation of it for later.
Thank you for showing interest! :slight_smile:

1 Like

Doing a complete rewrite at the moment to allow for full multiplayer support and a complete API for developers to access to better integrate into any games/projects they work on with this. Also adding comments and documentation to make it more understandable.
Changes I’m working on can be seen on the demo place as I work on them.

1 Like

Update

Multiplayer is taking a little longer than expected as it turns out it requires a fairly large rewrite of the framework, I’ve began the rewrite with the latest version I’ve just pushed. This update features many important changes and improvements.

  • APIs for the server so that developers can more easily integrate into their games.
  • CollectionService tags have now been unified to just need the instance to be tagged with “TimeScaleWhitelist”. No more needing to manage tags for each instance!
  • Documentation added. Can now more easily understand what needs to happen in order to get this working!
  • Performance improvements. I’ve now made the script more efficient with updating parts when the time scale changes so there should be less lag when toggling time scale now.

Coming Soon

Still working on multiplayer, got some basic testing going with it but needs lots more refinements before I feel like it can be pushing to the public. More to come soon on this.

1 Like

Update

I’ve taken a feature from a game I’m working on using this framework and added it to the public version. There is now a TimeScaleUtilities module in the ReplicatedStorage which will allow you to run a “Wait” function which takes into account time scale changing.
This update also includes new API in the frameworks function folder with a function called “IsTimeScaleSlowed” which will return true if time scale is slowed otherwise it will return false.
Hope you all enjoy the update, should be no need to modify any existing code at this point unless something drastic changes in the future! The new APIs listed can be found in the documentation module.
Enjoy!

Update

Loads of bug fixes in this release. Sorry for the buggy release last time :pensive:, will improve testing going forwards.
With this release, gravity is now constant and does not need to change anymore.

  • Fixed gravity when slowed.
  • Fixed tagging objects to be slowed.
  • Fixed TimeScaleUtilities:Wait().
    Hopefully this update will be good till after Christmas. Enjoy all & merry Christmas! :grin: :christmas_tree:
    Let me know if there is any other bug that need fixing ASAP.

Can you provide a tutorial? I want to use this but don’t get how to set it up.

1 Like

Hello, I have created a Tutorial to walk you through setting up the framework. Hopefully it will be useful to everyone getting into using the framework! :slightly_smiling_face:

2 Likes