Confirm action with timer?

Game development with Board Game Arena Studio
ShaharHarshuv
Posts: 1
Joined: 30 June 2024, 17:35

Confirm action with timer?

Post by ShaharHarshuv »

In games like Catan after doing an action you have 3 seconds (timer visible on the action buttons) to cancel or it does it automatically.
I'm wondering how do I do that in my own game? Do I implement it from scratch in javascript or is there a built-in utility for this behavior? Code examples welcome.
User avatar
thoun
Posts: 1618
Joined: 10 December 2020, 22:25

Re: Confirm action with timer?

Post by thoun »

There is a built-in option in addActionButton, search autoclick in the wiki doc
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Confirm action with timer?

Post by RicardoRix »

Don't use them. Absolutely no need to intentionally put the user into this position. Either confirm or don't.
User avatar
Doctor Neo Cortex
Posts: 27
Joined: 05 March 2018, 16:09

Re: Confirm action with timer?

Post by Doctor Neo Cortex »

RicardoRix wrote: 29 October 2025, 10:27 Don't use them. Absolutely no need to intentionally put the user into this position. Either confirm or don't.
I don't like this feature either but I understand that some user love the countdown option. I would put this behind a user preference, so every player can choose it for themselves. ;)
User avatar
vurtan
Posts: 57
Joined: 13 June 2020, 19:54

Re: Confirm action with timer?

Post by vurtan »

I add this feature in all of my games where players need to confirm an action and provide a user preference to set a timer, have it manually of disable confirmation at all.

Since I had done it before the BGA framework got the option I have a custom JS-Class to deal with it. But you should check out the BGA one first.
Here is the link to the docs: https://en.doc.boardgamearena.com/Game_ ... #Title_bar
User avatar
Kayvon
Posts: 1059
Joined: 17 October 2011, 01:39

Re: Confirm action with timer?

Post by Kayvon »

Another vote for the "don't use them" campaign. There's a nice-to-have if someone wants the option, but they slow down the game.

They encourage users to simply ignore the game and await the timeout rather than clicking the button. Other players are invoncenienced over the wait. It's not unreasonable to ask you to interact while it's your turn. Hitting a confirm button is simply part of taking the turn.
User avatar
WetDogIsHappy
Posts: 53
Joined: 06 November 2012, 05:20

Re: Confirm action with timer?

Post by WetDogIsHappy »

It has a very good use, for actions where you have no choice.
Like not having enough money to buy anything.
Rather than slowing the game, figure it out, post a message in the action bar.
Have the ‘Done’ button count down and click.
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Confirm action with timer?

Post by RicardoRix »

No, 2 wrongs don't make a right. The UI is not meant to play the game for you. If you have no money and have to pass, that is still up to the player to realise that situation and end their turn.

The only plausible reason that I've heard is to stop mobile phone users with accidental clicks. Even so, I don't know why a simple confirm button is not enough in this case. And absolutely the count down timer should not be the default option.

Further reading:
https://boardgamearena.com/forum/viewtopic.php?t=16770
User avatar
paramesis
Posts: 398
Joined: 28 April 2020, 05:00

Re: Confirm action with timer?

Post by paramesis »

I'm glad to see this conversation is still ongoing in a productive way. Now that countdown timers have been officially accepted and incorporated into the framework, it is even more of an impetus on developers to consider the many kinds of people who use BGA when designing interfaces.

Countdown timers enabled by default are an accessibility nightmare. For some people, especially those new to BGA or new to a particular game, 15 seconds (or shorter!) is not long enough to evaluate the game state they are being asked to confirm, realize something is wrong, switch focus to the action bar to identify and click the undo button. For some people, the sudden presence and pressure of this timer induces panic. I've certainly experienced this when trying new games, and needlessly restarted my turn because I didn't expect that pressure while I was trying to understand an unfamiliar game state. Learning a new game on BGA should not be an experience that induces panic.

All that said, I have come around to the position of wanting to support players who find these counters useful and have been making them available as a non-default option in my implementations.
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Confirm action with timer?

Post by Victoria_La »

RicardoRix wrote: 30 October 2025, 10:25 Further reading:
https://boardgamearena.com/forum/viewtopic.php?t=16770
Wow that is 5 years old thread! Re-reading my old post - it is exactly what I would have said now!
Post Reply

Return to “Developers”