Skip to content

perf(UI): add sleep time skip option with safe fallback#8240

Draft
scarf005 wants to merge 1 commit intocataclysmbn:mainfrom
scarf005:feat/skip-time-when-sleeping
Draft

perf(UI): add sleep time skip option with safe fallback#8240
scarf005 wants to merge 1 commit intocataclysmbn:mainfrom
scarf005:feat/skip-time-when-sleeping

Conversation

@scarf005
Copy link
Member

Purpose of change (The Why)

Add a sleep performance option that skips rendering-heavy sleep turns while preserving gameplay effects and a safety fallback when hostiles are nearby.

Describe the solution (The How)

  • Added SLEEP_SKIP_TIME option (Skip Time When Sleeping) with requested description text.
  • Added hostile-in-reality-bubble safety prompt and fallback to normal sleep flow.
  • Added fast sleep-time progression path that advances turns without wait-popup rendering while still processing item/field/vehicle updates.
  • Added tests for safe skip, hostile fallback behavior, and world progression effects (rot + charging).

Describe alternatives you've considered

  • Full inline reimplementation of do_turn() during sleep skip; rejected due to instability/segfault risk in tests.

Testing

  • cmake --build --preset linux-full --target astyle
  • cmake --build --preset linux-full --target cataclysm-bn-tiles cata_test-tiles
  • ./out/build/linux-full/tests/cata_test-tiles "[sleep][perf]"
  • ./out/build/linux-full/tests/cata_test-tiles "Vehicle charging station"

Additional context

N/A

Checklist

Mandatory

@github-actions github-actions bot added src changes related to source code. tests changes related to tests labels Feb 24, 2026
@scarf005 scarf005 force-pushed the feat/skip-time-when-sleeping branch from ba6b42a to f3e41b2 Compare February 24, 2026 18:48
@AzmodiusX
Copy link
Collaborator

Not sure if this changes the course here, but #8203 is going to swap the options under Debug->Performance to a new Performance tab, since we're getting many more performance options in general.
I'll be committing that soon.

@scarf005
Copy link
Member Author

Not sure if this changes the course here, but #8203 is going to swap the options under Debug->Performance to a new Performance tab, since we're getting many more performance options in general.

no worries, this PR will be ready tomorrow

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Assisted-by: openai/gpt-5.3-codex on opencode
@scarf005 scarf005 force-pushed the feat/skip-time-when-sleeping branch from f3e41b2 to b7197b9 Compare February 24, 2026 18:58
@scarf005 scarf005 changed the title perf: add sleep time skip option with safe fallback perf(UI): add sleep time skip option with safe fallback Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants