Found: `CameraController::setMoveScale()` is a dead knob
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Read gui_client/CameraController.h and .cpp, then inspect MainWindow.cpp:5826 and the three processMove* functions in gui_client/PlayerPhysics.cpp. Confirm whether move_speed_scale should affect movement or whether the setter and startup call should be removed. Done means the API is no longer misleading and the intended movement-speed behavior is covered by the relevant existing checks.
Written by the indexing model from the issue text.
Description
Found: CameraController::setMoveScale() is a dead knob
What we were doing
Adding a "Camera speed" multiplier slider to the Photo Mode UI, backed by
CameraController::setMoveScale(). Slider changes speed live while walking
around a splat scene, log-scale, 0.001× - 10×.
How we noticed
The slider was wired to setMoveScale(), but dragging it did nothing to the
camera's actual movement speed. Investigating why revealed the surprise below.
The finding
CameraController::move_speed_scale is written but never read.
- Set once at app startup:
MainWindow.cpp:5826 cam_controller.setMoveScale(0.3f); - Set by
CameraController::setMoveScale()on demand. - Read: nowhere in
substrata/gui_clientorglare-core.PlayerPhysics.cpp
(which is what actually turns key-presses intomove_desired_vel) uses a
localstatic const float move_speed = 3;and never consults the
CameraControllerfor a scale.
So the setMoveScale(0.3f) call at startup is a no-op — the effective
in-game speed for every user has always been the raw move_speed = 3 in
PlayerPhysics.cpp, unaffected by the 0.3. The setMoveScale() API looks
functional from the outside (has a setter, has a member, header comment
"Adjust camera movement speed based on world scale"), so an author landing
new UI on it — as we did — quite reasonably assumes it works.
Why it looks strange
Either:
- The 0.3× was meant to apply and something later refactored it out
accidentally, in which case the whole app has silently been walking at 3.3×
the intended speed for however long. - Or the scale mechanism was intended but never finished, in which case the
startup call and the setter should probably be removed to stop misleading
future contributors.
Either way, current state is a "ghost knob": present, documented, and inert.
Relevant source files
All paths relative to the substrata repo root.
gui_client/CameraController.h— declaressetMoveScale()(line ~41) and
the privatemove_speed_scalefield.gui_client/CameraController.cpp— the setter body (writes the field), the
constructor default (move_speed_scale = 1;). No reader.gui_client/MainWindow.cpp:5826— the only in-repo call site of
setMoveScale()before this change (setMoveScale(0.3f)at app startup).gui_client/PlayerPhysics.cpp— the read side that isn't there. The three
processMove*functions (processMoveForwards,processStrafeRight,
processMoveUp) computemove_desired_velfrom a hardcoded
static const float move_speed = 3;and never consult the
CameraControllerfor a scale. This is the file where a one-line
* cam.getMoveScale()on each of the three additions would make the setter
do what its name suggests.
What we did about it in our own build
To make the Photo Mode slider work at all, we:
- Multiplied
move_desired_velbycam.getMoveScale()in the three
PlayerPhysics::processMove*functions (Forwards, StrafeRight, MoveUp). - Added a
CameraController::getMoveScale()const getter alongside the
existing setter. - Kept the startup
setMoveScale(0.3f)untouched so default in-game speed
does not change for existing users — the slider's "1×" label reflects
that baseline (slider multiplier × 0.3 → themove_speed_scalefield).
- Dominant language
- C
- Stars
- 85
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from glaretechnologies/substrata
-
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
glaretechnologies/substrata#29 · 1 reaction ·
All issues in glaretechnologies/substrata
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100