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 tile animation speed control from TileMapLayer #11250

Open
berarma opened this issue Nov 28, 2024 · 0 comments
Open

Add tile animation speed control from TileMapLayer #11250

berarma opened this issue Nov 28, 2024 · 0 comments
Labels

Comments

@berarma
Copy link

berarma commented Nov 28, 2024

Describe the project you are working on

Old fashioned platform game heavily based on tiles.

Describe the problem or limitation you are having in your project

I'm unable to control tile animations in any way. Some cool effects could be implemented if such control was possible like completely freezing the game world, making it run slower, faster, backwards,...

I would also be able to stop animations in the editor and start them when the game runs. This would be easier to do with a few lines of code.

This could help fix issues like godotengine/godot#44625, godotengine/godot#4158 and #492 (the mention for tile animations).

Another limitation I would have liked to address is controlling the speed per tile but this seems harder to do at the moment. Allowing negative or zero animation speeds in tile sets wouldn't be an issue, but doing it continuously without resetting to the first frame wouldn't be as easy. There are cases where continuity wouldn't be an issue and it could be worth it but I think it should be a new proposal.

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

Adding an animation_speed setting to TileMapLayer could allow such control, with any float values allowed, negative, positive or zero.

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

The Canvas renderer in the renderer server uses current_time to update tile frames. Instead we could use an internal variable to the canvas that would be updated by TileMapLayer at every process notification based on the current time and the value of the animation_speed setting in TileMapLayer.

Additionally, I thought about adding TileMapLayer method calls to set this internal variable manually from code if we wanted to have finer control to update it ourselves. I don't think this is needed but it could be an option to consider.

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

It isn't possible to work around this limitation in a reasonable way.

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

Yes, it needs to change the way the server renderer updates tile animation frames. There isn't another way that I know.

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

No branches or pull requests

2 participants