Skip to content

Feature/ach badge popup delay#18782

Merged
LibretroAdmin merged 2 commits intolibretro:masterfrom
Jamiras:feature/ach_badge_popup_delay
Feb 28, 2026
Merged

Feature/ach badge popup delay#18782
LibretroAdmin merged 2 commits intolibretro:masterfrom
Jamiras:feature/ach_badge_popup_delay

Conversation

@Jamiras
Copy link
Contributor

@Jamiras Jamiras commented Feb 27, 2026

Description

Further modifies the on-demand badge downloading logic as follows:

  1. Delays the popup while the badge is being downloaded as suggested here.
  • If the badge is not already available, a task will be queued to try again in 100ms, then 200ms after that, then 400ms after that, and then 800ms after that. If the badge is still not available at that point, the popup will be shown with the placeholder badge.
  • In my local testing, the badge was typically available between the second and third retry (around 350ms). A third of a second delay is not going to be as noticable to a user as a flash of the placeholder badge.
  • Even if it takes the full second and a half to fetch the image, it's still close enough to when the achievement triggered that the user probably won't even notice.
  1. If HAVE_THREADS is defined, a timer is started when the user loads the game. After five minutes, badges will start being downloaded in the background at the rate of one badge every ten seconds.
  • This avoids downloading the (possibly) hundreds of badges for a game that the user isn't even going to play
  • And for systems where threads are available, this should make the badge popups as responsive as they were before (cheevos) download badges on demand #18639 without impacting the systems where threads aren't available.
  • Caveat: I'm assuming the stuttering was caused by the download process interrupting the emulation process, and that's related to the HAVE_THREADS define. If it's not related, hopefully spacing the downloads out will make the issue less annoying.

Related Issues

n/a

Related Pull Requests

n/a

Reviewers

[If possible @mention all the people that should review your pull request]

@LibretroAdmin LibretroAdmin merged commit 623c9f4 into libretro:master Feb 28, 2026
35 checks passed
@Jamiras Jamiras deleted the feature/ach_badge_popup_delay branch February 28, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants