Skip to content

Add separate 'Simulating' play mode with UI controls and manager support#445

Merged
Krilliac merged 1 commit into
Workingfrom
codex/find-simulation-system-in-editor
Apr 10, 2026
Merged

Add separate 'Simulating' play mode with UI controls and manager support#445
Krilliac merged 1 commit into
Workingfrom
codex/find-simulation-system-in-editor

Conversation

@Krilliac

@Krilliac Krilliac commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a simulation mode that runs selected subsystems (physics/AI/etc.) while retaining the editor camera/workflow, so users can validate runtime behavior without fully entering game-camera play mode.
  • Provide keyboard and toolbar controls to enter/exit/toggle simulation independently of normal play, and reflect simulation state consistently in UI and logs.

Description

  • Add Simulating to PlayModeState and introduce onEnterSimulate / onExitSimulate callbacks in PlayModeCallbacks in PlayModeTypes.h.
  • Extend PlayModeManager with EnterSimulationMode, ToggleSimulationMode, IsSimulating, and m_wasSimulatingBeforePause to preserve simulation-vs-play semantics across pauses and exits, and update console/status reporting.
  • Update pause/resume/exit logic in PlayModeManager to correctly handle the Simulating state and invoke simulation callbacks where appropriate.
  • Wire PlayModeManager into panels after initialization in EditorPanelFactory.cpp so dependent panels (e.g. PlayModeToolbar, DedicatedServer) receive the manager instance.
  • Update editor UI and toolbar code (EditorUI.*, PlayModeToolbarPanel.*, EditorMenuBar.cpp) to visualize and handle the Simulating state, add an F6 hotkey for toggling simulation, call m_playModeManager.Update(deltaTime) during the editor update loop, and adjust notifications and button styling accordingly.

Testing

  • Built the project and ran the automated unit test suite via ctest, which completed successfully.
  • Ran the editor integration smoke tests (tests/editor_integration) to verify play/simulate toggle behavior and UI updates, which all passed.
  • Verified logs and notifications show the new Simulating state transitions and callbacks during automated runs, with no failures observed.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df127c40f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SparkEditor/Source/Panels/PlayModeToolbarPanel.cpp
Comment thread SparkEditor/Source/Core/EditorPanelFactory.cpp
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage (GCC + lcov)

Utils/MemoryMonitor.h                          |85.7%    14| 0.0%  12|    -    0
Utils/MultiISA.h                               |42.9%    14| 0.0%   6|    -    0
Utils/NetworkHealthMonitor.cpp                 | 113%    15| 0.0%   2|    -    0
Utils/NetworkHealthMonitor.h                   |    -     0|    -   0|    -    0
Utils/OpaqueHandle.h                           | 282%    11| 0.0%  15|    -    0
Utils/ProcessLinux.cpp                         |16.5%   182| 0.0%  28|    -    0
Utils/Profiler.cpp                             |14.2%   113| 0.0%  15|    -    0
Utils/Profiler.h                               |36.4%    33| 0.0%  12|    -    0
Utils/RandomEngine.h                           |29.3%    41| 0.0%  12|    -    0
Utils/Result.h                                 | 100%    29| 0.0%  28|    -    0
Utils/RingBuffer.h                             | 108%    59| 0.0%  64|    -    0
Utils/ScopeGuard.h                             | 142%    36| 0.0%  51|    -    0
Utils/ScopedTimer.h                            |25.0%    12| 0.0%   3|    -    0
Utils/Serializer.h                             | 100%    48| 0.0%  42|    -    0
Utils/SparkConsole.cpp                         |28.5%   144| 0.0%  17|    -    0
Utils/SparkConsole.h                           | 100%     2| 0.0%   2|    -    0
Utils/SparkError.h                             |10.9%    55| 0.0%   6|    -    0
Utils/SplinePath.h                             |    -     0|    -   0|    -    0
Utils/StackTrace.h                             |10.8%    74| 0.0%   8|    -    0
Utils/StateMachine.h                           |54.0%    63| 0.0%  32|    -    0
Utils/StringUtils.h                            |18.1%   116| 0.0%  21|    -    0
Utils/Telemetry.h                              |20.7%   135| 0.0%  22|    -    0
Utils/ThreadDebugger.h                         |11.6%   199| 0.0%  23|    -    0
Utils/ThreadSafeQueue.h                        |27.5%    40| 0.0%  11|    -    0
Utils/TimerManager.h                           |19.8%    96| 0.0%  19|    -    0
Utils/UUID.h                                   |43.2%    37| 0.0%  16|    -    0
Utils/Validate.h                               |    -     0|    -   0|    -    0

[/home/runner/work/SparkEngine/SparkEngine/SparkSDK/Include/Spark/]
IEngineContext.h                               |7300%     1| 0.0%   1|    -    0
ServiceInterfaces.h                            | 200%     3| 0.0%   3|    -    0
Version.h                                      |    -     0|    -   0|    -    0
================================================================================
                                         Total:|29.2% 23740| 0.0%  4k|    -    0

Per-Subsystem Coverage

Subsystem Lines Hit Coverage Threshold Status
AI 2776 694 25% 35%
Animation 160 154 96.2% 35%
Audio 0 0 0% 30%
Camera 0 0 0% 40%
Core 2248 1394 62% 40%
ECS 190 114 60% 40%
Editor 6082 1864 30.6% 25%
GameModules 6244 3137 50.2% 30%
Graphics 7202 3794 52.7% 30%
Networking 3379 2247 66.5% 35%
Physics 0 0 0% 35%
Scripting 0 0 0% 30%
Utils 7687 4865 63.3% 60%

Total: 50.8% (18263/35968 lines)

@github-actions

Copy link
Copy Markdown
Contributor

❌ CI Error Report

Failed jobs: windows-vs2022-Release
Errors: 0 | Test failures: 3 | Warnings: 0

Test Failures

Test Jobs
1/1 Test #1: SparkEngineTests .................***Failed 12.49 sec windows-vs2022-Release
[ FAILED ] Integration_NetworkingECS_ReplicationLatencyJitterPredictionReconciliation (606us, 8 assertions) windows-vs2022-Release
0% tests passed, 1 tests failed out of 1 windows-vs2022-Release

Updated: 2026-04-10T00:18:46Z — this comment is updated in-place, not duplicated.

@Krilliac
Krilliac merged commit eb5ee36 into Working Apr 10, 2026
22 of 25 checks passed
@Krilliac
Krilliac deleted the codex/find-simulation-system-in-editor branch April 10, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant