Skip to content

Achievement Notification Queue with Configurable Delay#522

Merged
Detanup01 merged 6 commits into
Detanup01:devfrom
dasafe:pr2-notification-queue
May 26, 2026
Merged

Achievement Notification Queue with Configurable Delay#522
Detanup01 merged 6 commits into
Detanup01:devfrom
dasafe:pr2-notification-queue

Conversation

@dasafe

@dasafe dasafe commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description:
Add a rate-limiting queue system for achievement notifications with configurable delay.

How It Works
Before: Achievement notifications were shown immediately when triggered, with sound playing at trigger time.
After:

  • Notifications are queued and shown with a configurable delay
  • Rate-limiting ensures notifications don't pile up - they're spaced out
  • Sound plays when the notification is actually shown (not when triggered)
  • Users can configure the delay via Achievement_Notification_Delay setting (in seconds)

New Settings

  • Achievement_Notification_Delay - Delay in seconds before showing notification (e.g., 2.0 = 2 second delay)

How It Works

  1. When an achievement triggers, it's added to a queue with a scheduled show time
  2. The scheduled time is calculated as: last_scheduled_time + delay
  3. A background process checks the queue and shows notifications when their time arrives
  4. Sound is played at show time (not trigger time), so it syncs with the notification appearing

This prevents notification spam and ensures users actually see and hear each achievement.

Changes

  • Add rate-limiting queue for achievement notifications
  • Add configurable Achievement_Notification_Delay setting
  • Delay achievement sound to play when notification is actually shown
  • Add sound for progress notifications
  • Add debug output for achievement delay debugging

Comment thread overlay_experimental/steam_overlay.cpp Outdated
Comment thread overlay_experimental/steam_overlay.cpp Outdated
@dasafe

dasafe commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both issues - removed errant < character and merge conflict marker. Ready for review.

@Detanup01 Detanup01 requested a review from universal963 May 22, 2026 19:51
Comment thread dll/settings_parser.cpp Outdated
Comment on lines +1597 to +1606

// Achievement notification delay (in seconds, converted to milliseconds)
{
auto val = ini.GetLongValue("overlay::general", "Achievement_Notification_Delay", -1);
if (val >= 0) {
settings_client->achievement_notification_delay_ms = static_cast<int>(val * 1000);
settings_server->achievement_notification_delay_ms = static_cast<int>(val * 1000);
PRINT_DEBUG("Setting achievement notification delay to %i ms", settings_client->achievement_notification_delay_ms);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these for? I suppose they are code leftover or something, since they look like to be redundant and are not mentioned in EXAMPLE.ini changes.

dasafe added a commit to dasafe/gbe_fork that referenced this pull request May 23, 2026
…y_general_config

The Achievement_Notification_Delay setting is already parsed in
load_overlay_appearance() (reading from [overlay::appearance] section
using std::stof for proper float handling). The duplicate block in
parse_overlay_general_config() used GetLongValue which truncates
decimal values and read from the wrong INI section.

Resolves review feedback from universal963 on PR Detanup01#522.
@dasafe dasafe force-pushed the pr2-notification-queue branch from a7605ce to 4bfa98b Compare May 23, 2026 22:20
dasafe added 6 commits May 24, 2026 00:25
- Add achievement_notification_delay_ms setting to Settings class
- Parse Achievement_Notification_Delay from configs.overlay.ini (in seconds)
- Implement rate-limiting queue with scheduled_show_time tracking
- Queue processes achievements based on minimum delay between starts
- Default delay is 0 (no delay/simultaneous display)

Test cases verified:
- Simultaneous burst with spacing
- Trigger within delay window (throttled)
- Trigger after delay window passed (immediate)
- Default behavior (delay=0)
- Long chain stacking
- Mixed stacking with catch-up
- Mass burst with 0 delay
- Spaced out burst
…y_general_config

The Achievement_Notification_Delay setting is already parsed in
load_overlay_appearance() (reading from [overlay::appearance] section
using std::stof for proper float handling). The duplicate block in
parse_overlay_general_config() used GetLongValue which truncates
decimal values and read from the wrong INI section.

Resolves review feedback from universal963 on PR Detanup01#522.
@dasafe dasafe force-pushed the pr2-notification-queue branch from 4bfa98b to c223a83 Compare May 23, 2026 22:26
@Detanup01

Copy link
Copy Markdown
Owner

y'all and your force pushes

@Detanup01 Detanup01 requested a review from universal963 May 23, 2026 23:08
@Detanup01 Detanup01 merged commit 4cf3a19 into Detanup01:dev May 26, 2026
213 of 214 checks passed
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.

3 participants