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

Improve frame skips when input queue gets filled #26

Open
ClementSparrow opened this issue Aug 22, 2021 · 0 comments
Open

Improve frame skips when input queue gets filled #26

ClementSparrow opened this issue Aug 22, 2021 · 0 comments
Labels
animation anything that can help create animations or make better animations in a game feature New feature or request games Concerns the games: exported, gist-loaded, or played in the editor. input keyboard, mouse, touch, ... devices, gameplay and accessibility polish Make the games or editor behave/look better question Further information is requested syntax/language Concerns the language or its syntax

Comments

@ClementSparrow
Copy link
Owner

This is a common technique in turn-based games to improve game feel in general and responsiveness in particular: when the player presses keys faster than the feedback animations can play, store the inputs in a queue, and if the queue gets too big, shorten the animations, or even skip them completely.

The difficulty in doing something similar in Pattern:Script is that PuzzleScript does not have a proper concept of animation frames and we need to use again or real_time to simulate them, but by definition, inputs are forbidden during again frames, which also prevent ticks from real_time. So, the player would have to use real_time, avoid using again, and manually interrupt/shorten animations if a new input is triggered (which is often quite easy to do and can even be done without the game dev realizing it). But queuing the inputs require more explicit work from the dev. Also, some game devs could perceive switching to a real time game as a huge step in increased complexity.

My idea is that I could pre-compute some number N of again frames in advance and reduce the again_interval according to some function of the input queue size. Or something like that. I may also have to add new commands like skipable so that devs can specify that the frame in which the command is triggered can be skipped if needed.

This is also something that has to be done for undos if I decide to animate them (see #23).

@ClementSparrow ClementSparrow added feature New feature or request question Further information is requested polish Make the games or editor behave/look better games Concerns the games: exported, gist-loaded, or played in the editor. syntax/language Concerns the language or its syntax labels Aug 22, 2021
@ClementSparrow ClementSparrow added input keyboard, mouse, touch, ... devices, gameplay and accessibility animation anything that can help create animations or make better animations in a game labels Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
animation anything that can help create animations or make better animations in a game feature New feature or request games Concerns the games: exported, gist-loaded, or played in the editor. input keyboard, mouse, touch, ... devices, gameplay and accessibility polish Make the games or editor behave/look better question Further information is requested syntax/language Concerns the language or its syntax
Projects
None yet
Development

No branches or pull requests

1 participant