// much while seeking. If the framerate is still high while seeking, you
// may increase this, but increasing this with low framerate is unlikely to
// improve seek performance.
+// _demoseeking_speed_factor
+// Factor of remaining time to seek speed. Default 10.
+// The seek speed is defined by the formula
+//
+// 1.0 + [remaining seek seconds] * _demoseeking_speed_factor
+//
+// bound by _demoseeking_min_speed and _demoseeking_max_speed.
+// _demoseeking_fast_speed
+// Seek speed above which rendering is disabled. Default 80.
+//
+// Type demoseeking_reset_options in the console to reset all options.
//
// Variables:
//
_demoseeking_init_vars${_demoseeking_vars_loaded ?}
// option initialization (persistent)
-alias _demoseeking_init_options "seta _demoseeking_options_loaded 1; seta _demoseeking_min_speed 1.5; seta _demoseeking_max_speed 200"
+alias demoseeking_reset_options "seta _demoseeking_options_loaded 1; seta _demoseeking_min_speed 1.5; seta _demoseeking_max_speed 200; seta _demoseeking_fast_speed 80; seta _demoseeking_speed_factor 10"
+alias _demoseeking_init_options demoseeking_reset_options
alias _demoseeking_init_options1 ""
_demoseeking_init_options${_demoseeking_options_loaded ?}
// - Adjust the playback speed by setting the slowmo cvar. The further the seek, the faster the playback speed.
// - Compare the speed to different speed levels to maximize performance for long seeks while reducing screen flashes for short ones.
// Then continue the loop with "defer 0", so the check is run on every rendered frame.
-alias _seekdemo_check_continue_1 "set _seekdemo_speed_level failed; cl_cmd rpn _seekdemo_target time sub 10 mul _demoseeking_min_speed max _demoseeking_max_speed min dup /slowmo exch def dup 80 gt exch 2 gt add /_seekdemo_speed_level exch def; _seekdemo_set_options; defer 0 _seekdemo_check_time"
+alias _seekdemo_check_continue_1 "set _seekdemo_speed_level failed; cl_cmd rpn _seekdemo_target time sub _demoseeking_speed_factor 0.01 max mul 1 add _demoseeking_min_speed max _demoseeking_max_speed min dup /slowmo exch def dup _demoseeking_fast_speed gt exch 2 gt add /_seekdemo_speed_level exch def; _seekdemo_set_options; defer 0 _seekdemo_check_time"
alias _seekdemo_check_continue_failed "_seekdemo_failed \"(demo ended?)\""
alias _seekdemo_failed "_seekdemo_leave_seek; echo SEEK FAILED ${1 ?}"