Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a time_scale modifier to Timer scene for independent time control #10373

Open
Lunarisnia opened this issue Aug 6, 2024 · 2 comments
Open

Comments

@Lunarisnia
Copy link

Lunarisnia commented Aug 6, 2024

Describe the project you are working on

A top down shooter involving time dilation as the main mechanics similar to Superhot or Sandevistan in Cyberpunk 2077 where time effectively slows down for everyone but the player and certain enemies.

Describe the problem or limitation you are having in your project

Since I want the player and certain enemies to stay at normal speed I can't use Engine.time_scale since it's slowing down everything regardless so I opted to add a time_scale modifier to every single object that can be slowed, the problem came with the enemies that are slowed, since I regulate their shoot_rate using a Timer scene I can't exactly control how fast the timer countdown without modifying Engine.time_scale.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a time_scale modifier to Timer scene and their getter and setter function.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I've already implemented it here Lunarisnia/godot@2974adc
Here are the visualizations:
NOTE: Timer for the player in the middle is always unscaled

time_scale.mp4

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes, but it would mean creating a minimal custom Timer scene which feels a little bit janky not to mention losing all the built in method Timer scene has.

Is there a reason why this should be core and not an add-on in the asset library?

This adds more feature to the standard Timer scene.

@Lunarisnia Lunarisnia changed the title Add a timescale modifier to Timer scene for more independent time control Add a time_scale modifier to Timer scene for more independent time control Aug 6, 2024
@Lunarisnia Lunarisnia changed the title Add a time_scale modifier to Timer scene for more independent time control Add a time_scale modifier to Timer scene for independent time control Aug 6, 2024
@Calinou
Copy link
Member

Calinou commented Aug 6, 2024

Note that this was proposed as a Node property a while ago and was rejected, for the reasons described in godotengine/godot#34544.

Something like #9068 is more likely to be accepted as it's less complex by exposing a boolean property that allows ignoring the time scale, as opposed to an arbitrary modifier.

@Lunarisnia
Copy link
Author

I see, my proposal has the exact same implementation as #34544 and this person is mentioning the same issue that I want to address in this proposal. godotengine/godot#34544 (comment)

Not if you need to engage slow motion and then turn it off, and then on again with a different multiplier, while the timer is ticking.

So I think I propose that #34544 be reopened because setting wait_time alone cannot cater to use case like this or at least not in a straightforward way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants