Demystifying and Improving the Smogtours Timer

Adaam

إسمي جف
is a Community Contributoris a Forum Moderator Alumnusis a Top Tiering Contributor Alumnusis the 8th Grand Slam Winner
Hello everyone. The timer is an essential component to battling. It prevents players spending minutes per turn planning their entire game while rewarding those who see the better play fast. Many games have been outright lost on players timing out. Others have had their endgames influenced by rushed decision-making. Despite how important the timer is, it is frankly baffling how next to nobody knows how it works.

Here is the only public post I could find regarding the timer. It is from 2019 and is not pinned anywhere in the Tournaments subforum. This would naturally explain the overall confusion around the timer, but I am not here to critique Smogon's publishment of the timer. Rather, I want to first clarify how it actually works, and then I want to suggest improvements to be made.

Here is the source code for the battle timer. There are many relevant lines, but the most important ones are Lines 298-308. From gleaming the code, Smogtours timer works as follows (note I will focus only on the singles format timer):
  • Battle timer is initialized to 300 seconds at the start of a battle.
  • Timer is capped at 300 seconds.
  • At the end of turn 1, 0 seconds are added to the timer.
  • At the ends of turns 2-100, 10 seconds are added to timer.
  • At the ends of turns 101-200, only 5 seconds are added at the end of every turn.
  • At the ends of turns 201 onwards, 5 seconds are added at the end of every other turn.
  • Total time is only reduced every 5 seconds. For example, if your timer is at 150 seconds at the beginning of turn 62, and you make your move after 3 seconds, your total time will be 160 seconds next turn and NOT 157 seconds.
  • Battle log will display timer updates every drop in 30 seconds until the player reaches 30 seconds. Then, the next update will be at 20 seconds, and then 15, 10, 5, until the player times out.
  • At the beginning of a turn, the player is alerted of their time remaining if, and only if, their timer is <= 30 seconds. The text in this case is different from the normal updates: "Player X has Y seconds left this turn."
  • Due to the nature of the implementation of the timer, it is possible that this is not totally precise.
Now this is vastly different from Zarel's explanation, so you might be skeptical of my analysis. I have some examples to demonstrate this behavior:
  • Me vs TPP (OST) - On turn 75 battle log shows I reach 30 seconds. The next update is not until I reach 20 seconds, which does not occur turn 75. This means I clicked when my timer was at 25/30 seconds. I gained 10 seconds to put me at 35/40 seconds, which is why I did not receive an "iwillbeatyou69 has 30 seconds left this turn" at the start of turn 76. Turn 78 I reach 10 seconds before clicking, and at the beginning of turn 79 I have 20 seconds. However, at turn 80, I only have 25 seconds instead of 30. I don't know why, perhaps there is an internal race condition with respect to the timer's implementation causing the inconsistency.
  • beatiful vs Luispeikou (SPL I think) - Skip to turn 201 and you can see Luis only gain a mere 5 seconds on even numbered turns. With such a low amount of timer given, he is unable to ever rebuild his timer despite speed clicking for 100+ turns.
  • TPP vs Lord_Enz (OST) - Both players get low on time in turns 100+. To give a specific turn, at the end of turn 181, TPP and Lord_Enz have 5 and 15 seconds respectively, and at the start of turn 182, they have 10 and 20 seconds.
Now, we can agree that time management is an important skill, but the current implementation is complex and far too punishing in longer games. It inappropriately weighs the early and mid game more than the end game and reduces them to clickfests. I see no viable reason to reduce the amount of timer given back at the end of each turn, especially to something laughably small like 5 seconds every other turn. Something as simple as network delay can screw you over if you dare to let your timer drop below 30 in a 200+ turn game.

My Solution

I do not want to reinvent the wheel here. I think a simple 300 second base time + 15/10 second increase per turn is a sufficient implementation. Every player will easily remember this instead of the complex reduction we have today, and it values every turn the same. We can debate the amount of time to be added per turn, but I strongly recommend against any form of diminishing return implementation. Players shouldn't be forced to stay low forever.

Final Note

I spent a couple hours reading Pokemon source code on a 60 degree day so please toss a like to justify my pathetic use of time.
 
Last edited:

Quite Quiet

why fall in love when you can fall asleep
is a Site Content Manageris a Member of Senior Staffis a Community Contributoris a Tiering Contributoris a Contributor to Smogonis a Top Smogon Media Contributoris a Top Dedicated Tournament Hostis a Tournament Director Alumnusis a Battle Simulator Moderator Alumnus
TFP Leader
Not to take away anything from this, but the timer looks the way it does in an effort to combat timer stalling on main. Since we're using the same timer on Smogtours, we get the current situation. Not to argue if timer stalling is an actually issue here, that's probably beside the point, but it is in part why the timer is designed this way (so time eventually runs out).

As long as we maintain the same timer on main and smogtours (which we absolutely should, anything else would be an even bigger mess), there are some policy things main does that impacts tournaments games on smogtours. It would probably not be an unreasonable suggestion to be a bit nicer with how the dropoff is handled for longer games, but that probably has to be a compromise between main's needs and smogtours.
 

Lutra

Spreadsheeter by day, Random Ladderer by night.
is a Community Leader Alumnusis a Programmer Alumnusis a Community Contributor Alumnus
Now, we can agree that time management is an important skill, but the current implementation is complex and far too punishing in longer games. It inappropriately weighs the early and mid game more than the end game and reduces them to clickfests.
Strongly agree with this. I was playing RBY Ubers in RBYPL, and one game I lost because I took time to do a damage calc or two in a late turn, without realising that made me have to click fast for the rest of the match. I ended up losing because I thought it was a bug that the timer wouldn't replenish enough, and just couldn't decide on a move in time where I needed to think. Then in a game in a different series, I choked because I played too fast. It's not something that is a case of being too lax on one's self. We shouldn't have to play double blitz when we have to weigh up crucial sacrifices in PP war situations. My RBY Ubers team was built to go past 200 turns, but it would probably rarely go past 400 turns. One of my opponents was under time pressure in another game, and although they didn't lose, that would have been another opportunity to feel like I didn't really win if they did indeed lose to the timer.

I think it also needs to be said how much of an impact the opponent delaying in certain turns can have on your effective timer. When you make your move first, you then have to wait for your opponent to move. That means you actively have to avoid going off your opponent's rhythm and try to set a fast internal rhythm in your head if you don't want to get caught out. I don't think players should need to get stressed out in these situations due to the 5 second timer.
 
Last edited:
The PS! timer seems archaic. The intervals it displays the time left at aren't picked out poorly, but the fact that it only displays your time somtimes is extremely weird to me. Why can't it be like on sites such as chess.com or lichess.org where your time is being displayed exactly at all times? I think the timer is one of the areas PS! has a very clear opportunity to improve. Increments (the time you get after every move) should be displayed clearly as well, especially if they are as unintuitive as they are on PS!, and maybe you could experiment with letting players pick their starting time / increment themselves.
I cannot see how it is competitively (or otherwise) beneficial to hide the time players have left from said players. Of course, the timer doesn't need to be identical to the one in chess as they are very different games. For example there should be an upper limit of time one can amass (like there currently is), since some games can drag on for a lot of moves, and the increment can get shorter as the game progresses (like it currently does). The main thing I would love to see changed is the visibility of the remaining time at all times.
 

Finchinator

-OUTL
is a Tournament Directoris a Top Social Media Contributoris a Community Leaderis a Community Contributoris a Smogon Discord Contributoris a Top Tiering Contributoris a Contributor to Smogonis a Top Smogon Media Contributoris a Top Dedicated Tournament Hostis a Senior Staff Member Alumnusis a Battle Simulator Moderator Alumnusis a Past WCoP Championis the defending OU Circuit Championis a Two-Time Former Old Generation Tournament Circuit Champion
OU Leader
As long as we maintain the same timer on main and smogtours (which we absolutely should, anything else would be an even bigger mess), there are some policy things main does that impacts tournaments games on smogtours.
Can you explain why this would be an issue? Both servers have different purposes, even if they’re simulating the same game. SmogTours server is the default for tournament games and either party can force tournament games to be played on that server after all. Main is the default for casual play, which is at the mercy of trolls and timer stalling (I realize ladder and challenges have different timers — you can argue we should just change challenge timer overall and that’s fine with me, but I assume that’s an issue if you’re bringing this up as is as well). I understand having a discrepancy seems messy, but is there a formal, concrete (set of) reason(s) as to why this isn’t a possibility? Not trying to argue against so much as understand beyond what I currently do.

To me, it is pretty clear that the current timer creates a situation less than ideal for tournament play once you surpass a certain number of turns as the OP alludes to, but any departure from the norm creates a situation less than ideal to counteract attempts to timer stall on main (an issue that never pops up in Smogon tournaments afaik). Adaam’s proposal will help a great deal with the former, but also make the timer stalling problem even more time consuming in the matter scenario. Applying it to Smogon Tours and not main seems ideal to me, but I realize there is likely more to it and I do not want to propose something outright impossible. If it isn’t possible, I’d argue applying it to both is still worth considering anyway.
 
Last edited:
I agree with Finchinator re: questioning the need for consistency between servers. We don't need the timers to be the same between servers, we just need to be able to communicate how it works to players effectively (in an obvious place, or make it intuitive enough that an explanation is not required). To me, the main problem with the status quo is how hard it is to find the information about the timer. I haven't had any issues with the amount of time provided to players.
 

Bughouse

Like ships in the night, you're passing me by
is a Site Content Manageris a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
I don’t even think the timer needs to be different by server. Why can’t it just be different for ladder games vs challenges? It already is, no? The challenge timer just needs to be less punishing. The ladder one can still aim to prevent timer stalling.

also agree that I’ve never understood why the PS timer is so imprecise when for comparison chess sites are able to use exact and transparent timers. If that’s been explained before, my apologies.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
Now this is vastly different from Zarel's explanation, so you might be skeptical of my analysis.
Your explanation is exactly correct. Mine is from 2019 and we've made a few updates since then (including basically everything I said I was considering changing in that post). Although one difference is that what you call "5 seconds per turn" I call "10 seconds per turn", because the first 5 seconds are "free" with the tick system, essentially.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
The PS! timer seems archaic. The intervals it displays the time left at aren't picked out poorly, but the fact that it only displays your time somtimes is extremely weird to me. Why can't it be like on sites such as chess.com or lichess.org where your time is being displayed exactly at all times?
also agree that I’ve never understood why the PS timer is so imprecise when for comparison chess sites are able to use exact and transparent timers. If that’s been explained before, my apologies.
We do display your time exactly at all times... I'm confused if you two have just never noticed that. It's right here:

1616520988793.png


We just also put reminders in the chat.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
I don’t even think the timer needs to be different by server. Why can’t it just be different for ladder games vs challenges? It already is, no? The challenge timer just needs to be less punishing. The ladder one can still aim to prevent timer stalling.
This is true. I'm open to changing the challenge timer however people feel best.

Strongly agree with this. I was playing RBY Ubers in RBYPL, and one game I lost because I took time to do a damage calc or two in a late turn, without realising that made me have to click fast for the rest of the match. I ended up losing because I thought it was a bug that the timer wouldn't replenish enough, and just couldn't decide on a move in time where I needed to think.
The timer is not currently designed to actually "replenish". It's just a bank of time, and once you use it, it's over. The +5 seconds are there to make it a bit more forgiving, but it's not intended to let you bank time back up or anything.

As mentioned before, I'm fine with changing that for challenge games. But for ladder games, the timer is intended to make it so the games don't take forever.
 

Amaranth

is a Site Content Manageris a Forum Moderatoris a Community Contributoris a Top Tiering Contributoris a Top Contributoris a Dedicated Tournament Hostis a Tournament Director Alumnusis a Social Media Contributor Alumnusis a Community Leader Alumnusis a Past SPL Champion
UPL Champion
I honestly forgot about that one, however, you still can't see your opponent's time, and spectators cannot see either
That's probably by design, as showing your opponent whether you've clicked a move or not provides meta information which we probably don't want to give. You still sort of get meta information by seeing the messages in chat, but it's to a much lesser degree
 

Bughouse

Like ships in the night, you're passing me by
is a Site Content Manageris a Forum Moderator Alumnusis a CAP Contributor Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnus
That's probably by design, as showing your opponent whether you've clicked a move or not provides meta information which we probably don't want to give. You still sort of get meta information by seeing the messages in chat, but it's to a much lesser degree
We do display your time exactly at all times... I'm confused if you two have just never noticed that. It's right here:

View attachment 325439

We just also put reminders in the chat.
Thanks - not sure I ever saw this spelled out, but this makes sense for the lower transparency. How long you take to move I guess can convey information to an opponent, if they want to read into that sort of thing. No such issue displaying perfectly transparent timer info in a game like chess where turns alternate. That was my main concern, not whether someone can know their own time transparently, which I knew they can.
 

power

uh-oh, the game in trouble
showing your opponent whether you've clicked a move or not provides meta information which we probably don't want to give
Why do we not want to give this information? This seems like an untested assumption; do you have a rationale?
 

Amaranth

is a Site Content Manageris a Forum Moderatoris a Community Contributoris a Top Tiering Contributoris a Top Contributoris a Dedicated Tournament Hostis a Tournament Director Alumnusis a Social Media Contributor Alumnusis a Community Leader Alumnusis a Past SPL Champion
UPL Champion
Why do we not want to give this information? This seems like an untested assumption; do you have a rationale?
The rationale is that I personally don't feel like it's within the spirit of the game to get game information from things that are not the game itself. To me, the reason the timer is here is to limit the amount of thinking time available, not to provide information, so if it provides information that's going against its purpose.

It's not cold hard logic but I think you'd be very hard pressed to find a cold hard logic answer to a question that is very much about personal opinion on what the game should be like; there's no official rulebook stating what the spirit of the game is, but I reckon most people would agree that getting meta information from the timer would be lame and it's not something we want to introduce
 

DragonWhale

It's not a misplay, it's RNG manipulation
is a Top Social Media Contributor Alumnusis a Community Leader Alumnusis a Community Contributor Alumnusis a Dedicated Tournament Host Alumnusis a Battle Simulator Moderator Alumnus
Ranked battles on cart uses a chess timer and not a replenishing one like PS, but it does show the remaining time the opponent has at the start of the turn.

For example if I take 25 seconds and the opponent takes 17 seconds on turn 1, then on the next turn the game will display a static 6:43 under the opponent's health bar, and below that there will be my active chess timer starting from 6:35 and turn timer counting down from 45 seconds (though turn timer is not relevant to this convo).

The important part imo is that the opponent's timer is shown, but its not active. Like Amaranth says above, a visibly active opponent's timer reveals certain information that otherwise cannot be obtained, whereas a static timer provides information relevant to its purpose and nothing more. The only way to find out how long the opponent makes a selection during a turn is when you already made your selection before them and the game is waiting on the opponent, at which point you are unable to undo your selection anyway.
 

Zarel

Not a Yuyuko fan
is a Site Content Manageris a Battle Simulator Administratoris a Programmeris a Pokemon Researcheris an Administrator
Creator of PS
Ranked battles on cart are also probably not what we want to use as a model – the cart timer is intended to eliminate stall as a strategy, and to end a lot of games on time (with a really low hard limit of like 15 minutes total). That's not what PS is going for.

Anyway, I've pushed an update with a new challenge timer for Smogtours (ladder remains unaffected). No change except I removed the acceleration, it's now 15 seconds/turn no matter which turn it is. Main will take a bit longer to update.
 
Last edited:

Adaam

إسمي جف
is a Community Contributoris a Forum Moderator Alumnusis a Top Tiering Contributor Alumnusis the 8th Grand Slam Winner
Ranked battles on cart are also probably not what we want to use as a model – the cart timer is intended to eliminate stall as a strategy, and to end a lot of games on time (with a really low hard limit of like 15 minutes total). That's not what PS is going for.

Anyway, I've pushed an update with a new challenge timer for Smogtours (ladder remains unaffected). No change except I removed the acceleration, it's now 15 seconds/turn no matter which turn it is. Main will take a bit longer to update.
Thank you for the quick responses and implementation!
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top