Throttle and Debounce
The plugin provides access to two special conditions: Not more than once in <X> seconds and For a postponed event.
Note
Due to limitations in Construct 3's visual programming, these conditions are implemented using "pseudo-loops," so you might notice the loop icon to the left of their names.
However, these are genuinely conditions, not loops.
If you prefer JavaScript, you can refer to the articles: Debounce example with a search form and Throttle example with page updates on scroll.
Throttle
Sometimes certain parts of a game can heavily impact overall performance. For example, physics processing or AI calculations.
Due to the complexity of such computations, it's better to avoid running them too frequently. For such cases, people often use Every <X> seconds to execute code every X seconds. However, this isn't always possible.
Imagine a complex game mechanic that runs when the screen is tapped. In situations where you need to limit how often code executes but can't use a timer, the Not more than once in <X> seconds condition comes in handy.
Warning
Avoid using Not more than once in <X> seconds on every tick. While it won't cause errors, it's better to use Every <X> seconds instead in such cases.
Debounce
Some methods in the Yandex Games SDK have rate limits for API requests. Exceeding these limits might lead to your game failing moderation.
For example, if you update a leaderboard score too frequently, you should use the For a postponed event condition.
However, it can be confused with the Not more than once in <X> seconds condition since both prevent functions from being called too often. What's the difference?
The key distinction is that Not more than once in <X> seconds limits how often a function can run, while For a postponed event delays the function execution until a certain time has passed. This is exactly what we need for leaderboard updates — we don't need constant updates, just compliance with rate limits.
Visualization of the difference between Not more than once in <X> seconds and For a postponed event: