Skip to content

Commit 99f1d31

Browse files
committed
feat: add cvar to control camera smoothing in tas
1 parent d42444c commit 99f1d31

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

docs/cvars.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@
633633
|sar_tas_stop|cmd|sar_tas_stop - stop TAS playing|
634634
|sar_tas_tools_enabled|1|Enables tool processing for TAS script making.|
635635
|sar_tas_tools_force|0|Force tool playback for TAS scripts; primarily for debugging.|
636+
|sar_tas_use_raw_interpolation|0|Allows TAS controller to perform extra mouse samples to make camera movement more smooth. Can affect raw playback outcome!|
636637
|sar_teleport|cmd|sar_teleport [noportals] - teleports the player to the last saved location|
637638
|sar_teleport_setpos|cmd|sar_teleport_setpos - saves current location for teleportation|
638639
|sar_tick_debug|0|Output debugging information to the console related to ticks and frames.|

src/Features/Tas/TasController.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const int g_TasControllerInGameButtons[] = {
1919
};
2020

2121
Variable sar_tas_real_controller_debug("sar_tas_real_controller_debug", "0", 0, 4, "Debugs controller.\n");
22+
Variable sar_tas_use_raw_interpolation("sar_tas_use_raw_interpolation", "0", "Allows TAS controller to perform extra mouse samples to make camera movement more smooth. Can affect raw playback outcome!\n");
2223

2324
TasController *tasControllers[2];
2425

@@ -141,6 +142,14 @@ void TasController::ControllerMove(int nSlot, float flFrametime, CUserCmd *cmd)
141142

142143
//console->Print("TasController::ControllerMove (%d, ", cmd->tick_count);
143144

145+
if (!sar_tas_use_raw_interpolation.GetBool()) {
146+
// without raw interpolation, treat is as if extra mouse samples never happened
147+
wasInExtraMouseSamples = false;
148+
if (inExtraMouseSamples) {
149+
return;
150+
}
151+
}
152+
144153
if (inExtraMouseSamples && !tasPlayer->IsUsingTools()) {
145154
if (!wasInExtraMouseSamples) {
146155
viewanglesPreExtraMouseSamples = engine->GetAngles(nSlot);

0 commit comments

Comments
 (0)