Proof of concept: Control game speed with right thumbstick#1401
Proof of concept: Control game speed with right thumbstick#1401DanEEStar wants to merge 2 commits intoProvenance-Emu:developfrom
Conversation
By steering the xAxis of the right thumbstick the player can control the game speed of the emulator directly. Press "right" -> GameSpeed.fast Press "left" -> GameSpeed.slow Neutral position -> GameSpeed.normal
|
Interesting idea. Not sure it should be merged in its current form though, as it might interfere with cores that use the right stick in their controller layer (PSX and n64 come to mind, initially...). Maybe it could be morphed into a setting-controlled feature that can be turned off and on in the settings, and maybe further do it on a core by core basis? |
|
First, I'd like to say that this is sorely needed. Just from playing Metroid, and I've played it hundreds of times, I can say with 100% certainty that NES emulation is actually too fast on my iPAD and on my iPhone. Sure it may be a core issue, but this feature would certainly allow for correction. In line with the settings suggestion above, I would like to add that it should be controlled with a slider, default emulation speed being center. |
6209b0b to
501aeb5
Compare
a789cf0 to
f0c3e73
Compare
|
@claude can you look into this feature request and idea? It's a very old ticket, so we have a lot of new controller code and systems to deal with. This could work, but as a user-configurable option in the pause menu or controller menus, and needs to have some support for how to work with cores with or without right thumbstick support requirements for game input. Come up with a plan and either update this PR or make a new work queue ticket and tag this PR in it |
✅ Done — Epic & Work Tickets CreatedCompleted
Issues Created
|
Agent Analysis: Right Thumbstick Game Speed ControlThanks for this feature request, @JoeMatt! After reviewing the codebase thoroughly, here's the full analysis and implementation plan. Current StateThe infrastructure for game speed already exists:
The original PR's approach (intercepting the right thumbstick X-axis and discretely snapping to The Core Problem: Right Thumbstick ConflictsMany systems require the right thumbstick for actual in-game input:
For systems like NES, SNES, GB/GBC/GBA, SMS, Genesis, Atari etc., the right thumbstick is unused and is a perfect candidate for this feature. Implementation PlanPhase 1: Settings Infrastructure (PVSettings + PVCoreBridge)New setting key in // MARK: Speed Control
public extension Defaults.Keys {
/// Whether the right thumbstick Y-axis controls game speed when the current system doesn't use it for input
static let rightThumbstickSpeedControl = Key<Bool>("rightThumbstickSpeedControl", default: false)
/// Speed control mode: discrete (snap to GameSpeed cases) or analog (continuous)
static let thumbstickSpeedControlMode = Key<ThumbstickSpeedControlMode>("thumbstickSpeedControlMode", default: .discrete)
}New enum in public enum ThumbstickSpeedControlMode: String, Codable, Defaults.Serializable, CaseIterable {
case discrete // Snaps to GameSpeed enum values
case analog // Continuous multiplier mapped from stick Y-axis
}Phase 2: System Detection (PVPrimitives / PVCoreBridge)Add a property to // In SystemIdentifier.swift
public extension SystemIdentifier {
/// True if this system legitimately uses the controller's right thumbstick for game input
var usesRightThumbstick: Bool {
switch self {
case .PSX, .PS2, .PS3, .PSP, .GameCube, .Dreamcast, .N64, ._3DS, .Wii:
return true
default:
return false
}
}
}Additionally, expose a protocol property on cores so per-core overrides are possible: // In EmulatorCoreRunLoop or a new protocol
@objc optional var usesRightThumbstickForInput: Bool { get }Phase 3: Input Handler (PVEmulatorViewController+Controllers or new extension)Add thumbstick monitoring in
Discrete mode: Analog mode: The handler should be registered/unregistered when:
Phase 4: Pause Menu & Settings UIOption A — Pause Menu (in-session toggle): Option B — Global Settings (persistent): Both options should be implemented — the global setting enables the feature, and the pause menu shows a contextual toggle and current mode. Phase 5: On-Screen Feedback (Optional Enhancement)When speed changes via thumbstick, show a brief OSD indicator (the existing Edge Cases to Handle
RecommendationSince the original PR branch (
I'll track this as a new GitHub issue linked to this PR. The work can be split into two sub-tasks:
Would you like me to proceed with the implementation now, or just file the tracking issue and let it go into the work queue? |
|
Tracking issue filed: See the detailed implementation plan posted above. Summary of recommendation: The original PR's branch is no longer in the remote, and the codebase has grown significantly (new controller systems, remapping, Delta skin support, RetroMenu overlay, etc.). Rather than trying to rebase the proof of concept, this should be implemented fresh in a new branch. The work naturally splits into two PRs:
I'll proceed with implementation once a tracking issue is created and prioritized. The plan comment above has full file-level detail. |
@claude make a epic and work tickets for this work, tag and close this PR |
|
Thank you for this proof of concept, @DanEEStar! 🎮 This feature idea is great and has been picked up for a proper implementation. Work Tickets Created
Why a fresh implementation instead of rebasingThe codebase has evolved significantly since this proof of concept — new controller remapping systems, Delta skin support, the RetroMenu overlay, and RetroAchievements integration all need to be taken into account. The new implementation will:
Closing this PR in favour of the tracked issues above. |
What does this PR do
By steering the xAxis of the right thumbstick the player can control
the game speed of the emulator directly.
Press "right" -> GameSpeed.fast
Press "left" -> GameSpeed.slow
Neutral position -> GameSpeed.normal
This is basically just a proof of concept. But maybe someone has the same problems as I had...
Where should the reviewer start
I don't know if this makes sense to merge...
How should this be manually tested
Any background context you want to provide
I recently started playing some older JRPGs in Provenance like Dragon Quest 1 and Final Fantasy VI. The battles especially in the beginning, can become very boring. You basically just have to press "Attack" and wait...
Also manually changing the Game Speed via the menu became boring fast...
So my idea was to map the Game Speed control to some, often unused, buttons on my XBOX-Gamepad. So I mapped the GameSpeed to the right thumbstick.
With this small change I can control the Game Speed in game directly with the controller.
What are the relevant tickets
Screenshots (important for UI changes)
Questions