Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Tickbase fix in runcommand

  • Автор темы Автор темы zbigniew
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
8 Дек 2022
Сообщения
4
Реакции
0
hello, im trying to fix my tickbase in runcommand (lw v3 paste), what im doing is setting shifted command number in createmove, and checking in runcommand if command number == shifted command number, if it is i just backup curtime and set tickbase to tickbase - shifted ticks, everything works perfectly fine, but while having +20 ping doubletap is starting to get slower. i cant figure out why this happens. in cl_showerror 2 i have only tickbase -13 while charging because rn im not fixing tickbase while charging but im like 99% sure its not my problem
 
C++:
Expand Collapse Copy
if (command number == shifting command number + 1)
    tickbase = backup tickbase + shifted ticks + m_globals()->SimulationTicksThisFrame;
else if (command number == shifting command number)
    tickbase  = backup tickbase - shifted ticks + m_globals()->SimulationTicksThisFrame;
 
C++:
Expand Collapse Copy
if (command number == shifting command number + 1)
    tickbase = backup tickbase + shifted ticks + m_globals()->SimulationTicksThisFrame;
else if (command number == shifting command number)
    tickbase  = backup tickbase - shifted ticks + m_globals()->SimulationTicksThisFrame;
thanks for replying but sadly it dont fix tickbase for me at all
 
C++:
Expand Collapse Copy
if (command number == shifting command number + 1)
    tickbase = backup tickbase + shifted ticks + m_globals()->SimulationTicksThisFrame;
else if (command number == shifting command number)
    tickbase  = backup tickbase - shifted ticks + m_globals()->SimulationTicksThisFrame;
shifting command number + 1 == next shifting command number??
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
pasta
hello, im trying to fix my tickbase in runcommand (lw v3 paste), what im doing is setting shifted command number in createmove, and checking in runcommand if command number == shifted command number, if it is i just backup curtime and set tickbase to tickbase - shifted ticks, everything works perfectly fine, but while having +20 ping doubletap is starting to get slower. i cant figure out why this happens. in cl_showerror 2 i have only tickbase -13 while charging because rn im not fixing tickbase while charging but im like 99% sure its not my problem
 
pasta


now im getting (1)C_CSPlayer::m_nTickBase - int differs (net 1945 pred 17) diff(-1928) while shifting O_9
C++:
Expand Collapse Copy
int adjust_player_time_base(int delta) {
    if (delta == -1)
        return false;

    static auto clockcorrection = m_cvar()->FindVar(crypt_str("sv_clockcorrection_msecs"));
    auto flCorrectionSeconds = math::clamp(clockcorrection->GetFloat() / 1000.0f, 0.0f, 1.0f);
    auto correction_ticks = TIME_TO_TICKS(flCorrectionSeconds);

    auto ideal_final_tick = delta + correction_ticks;

    auto estimated_final_tick = g_ctx.local()->m_nTickBase() + 13;

    auto too_fast_limit = ideal_final_tick + correction_ticks;
    auto too_slow_limit = ideal_final_tick - correction_ticks;

    if (estimated_final_tick > too_fast_limit
        || estimated_final_tick > too_slow_limit)
        return ideal_final_tick - 13 + m_globals()->m_simticksthisframe;
}

i think i changed ur code properly, i removed
Код:
Expand Collapse Copy
valve::g_globals->m_max_client_entites <= 1
because i couldnt find it

im using this code like this at the end of runcommand
Код:
Expand Collapse Copy
if (m_pcmd->m_command_number == g_ctx.globals.shiftingatm) {
    player->m_nTickBase() = adjust_player_time_base(13);
    m_globals()->m_curtime = backup_curtime;
}
 
now im getting (1)C_CSPlayer::m_nTickBase - int differs (net 1945 pred 17) diff(-1928) while shifting O_9
C++:
Expand Collapse Copy
int adjust_player_time_base(int delta) {
    if (delta == -1)
        return false;

    static auto clockcorrection = m_cvar()->FindVar(crypt_str("sv_clockcorrection_msecs"));
    auto flCorrectionSeconds = math::clamp(clockcorrection->GetFloat() / 1000.0f, 0.0f, 1.0f);
    auto correction_ticks = TIME_TO_TICKS(flCorrectionSeconds);

    auto ideal_final_tick = delta + correction_ticks;

    auto estimated_final_tick = g_ctx.local()->m_nTickBase() + 13;

    auto too_fast_limit = ideal_final_tick + correction_ticks;
    auto too_slow_limit = ideal_final_tick - correction_ticks;

    if (estimated_final_tick > too_fast_limit
        || estimated_final_tick > too_slow_limit)
        return ideal_final_tick - 13 + m_globals()->m_simticksthisframe;
}

i think i changed ur code properly, i removed
Код:
Expand Collapse Copy
valve::g_globals->m_max_client_entites <= 1
because i couldnt find it

im using this code like this at the end of runcommand
Код:
Expand Collapse Copy
if (m_pcmd->m_command_number == g_ctx.globals.shiftingatm) {
    player->m_nTickBase() = adjust_player_time_base(13);
    m_globals()->m_curtime = backup_curtime;
}
delta is the current tickcount and not a fixed number bro, why u setting ur tickbase to always be 13 lmao
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
now im getting (1)C_CSPlayer::m_nTickBase - int differs (net 1945 pred 17) diff(-1928) while shifting O_9
C++:
Expand Collapse Copy
int adjust_player_time_base(int delta) {
    if (delta == -1)
        return false;

    static auto clockcorrection = m_cvar()->FindVar(crypt_str("sv_clockcorrection_msecs"));
    auto flCorrectionSeconds = math::clamp(clockcorrection->GetFloat() / 1000.0f, 0.0f, 1.0f);
    auto correction_ticks = TIME_TO_TICKS(flCorrectionSeconds);

    auto ideal_final_tick = delta + correction_ticks;

    auto estimated_final_tick = g_ctx.local()->m_nTickBase() + 13;

    auto too_fast_limit = ideal_final_tick + correction_ticks;
    auto too_slow_limit = ideal_final_tick - correction_ticks;

    if (estimated_final_tick > too_fast_limit
        || estimated_final_tick > too_slow_limit)
        return ideal_final_tick - 13 + m_globals()->m_simticksthisframe;
}

i think i changed ur code properly, i removed
Код:
Expand Collapse Copy
valve::g_globals->m_max_client_entites <= 1
because i couldnt find it

im using this code like this at the end of runcommand
Код:
Expand Collapse Copy
if (m_pcmd->m_command_number == g_ctx.globals.shiftingatm) {
    player->m_nTickBase() = adjust_player_time_base(13);
    m_globals()->m_curtime = backup_curtime;
}
ayo wtf
delta this is server tick_count and if u are shift > 13 ticks than use ur variable for calc ticks to shift aka 13 -> m_shift_amount
and call adjust_player_time_base in create_move before if server sended new data related to it ( client_state->last_out_going_cmd >= g_eng_pred->m_local_data.at( cmd->m_number % 150 ).last_out_going_cmd ) check and than u can apply ur tickbaseee
 
Назад
Сверху Снизу