Вопрос Need help shooting invalid times while doubletapping (valid_record) function

Забаненный
Статус
Оффлайн
Регистрация
8 Июн 2023
Сообщения
4
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
I'm using alpha cheat as base, i've reworked/modified many stuff but i still cannot figure out how to fix the issue that doubletap is causing on my valid_record function

Better explaination:

if i try to hit Front Record & player is moving & im shifting more than 11 ticks im mostly going to shoot invalid times
Considering im only pushing front_record & extrapolating if player's breaking lc
prob caused by this :
C++:
float time = pLocal->IsAlive() ? g_Vars.globals.predicted_curtime : Interfaces::m_pGlobalVars->curtime;
float delta_time = fabsf(correct - (time - record.m_flSimulationTime));
my valid_record function atm :
C++:
bool C_LagCompensation::IsRecordOutOfBounds(const Engine::C_LagRecord& record, float flTargetTime, float nTickbaseShiftTicks, bool dead_time_check) const {
        Encrypted_t<INetChannel> pNetChannel = Encrypted_t<INetChannel>(Interfaces::m_pEngine->GetNetChannelInfo());
        if (!pNetChannel.IsValid())
            return false;

        C_CSPlayer* pLocal = C_CSPlayer::GetLocalPlayer();
        if (!pLocal)
            return false;

        if (!pLocal->IsAlive())
            return false;

        int server_tick = Interfaces::m_pEngine->GetServerTick() + TIME_TO_TICKS(lagData.Xor()->m_flOutLatency);
        float correct = 0;
        // add out latency
        correct += lagData.Xor()->m_flOutLatency;

        // add in latency
        correct += lagData.Xor()->m_flServerLatency;

        // add interpolation amount
        correct += lagData.Xor()->m_flLerpTime;

        // clamp this shit
        correct = Math::Clamp(correct, 0.f, g_Vars.sv_maxunlag->GetFloat());

        // def cur time
        printf("g_Vars.globals.m_flCurtime: %f\n", g_Vars.globals.m_flCurtime);
        printf("g_Vars.globals.predicted_curtime: %f\n", g_Vars.globals.predicted_curtime);

        // get delta time
        float delta_time = fabsf(correct - (g_Vars.globals.predicted_curtime - record.m_flSimulationTime));
       
        printf("delta_time: %f\n", delta_time);

        bool delta = delta_time > 0.2f;

        if (delta)
            return true;
   
        return false; // (TICKS_TO_TIME(server_tick) - g_Vars.sv_maxunlag->GetFloat());
    }
predicted_curtime is getting updated in createmove by just
C++:
TIME_TO_TICKS(tickbase + extraprocessticks)
the debugging results are
WITH DOUBLETAP : delta_time always between 0.2xxxx 0.3xxx 0.4xxx
WITHOUT DOUBLETAP: delta_time always between 0.0002 0.0001 0.0000 which are the correct results

thats why my ragebot sometimes do not shoot or miss curtime when i dt because the deltatime goes above the supposed values
any thoughts?
 
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,176
Реакции[?]
314
Поинты[?]
152K
I'm using alpha cheat as base, i've reworked/modified many stuff but i still cannot figure out how to fix the issue that doubletap is causing on my valid_record function

Better explaination:

if i try to hit Front Record & player is moving & im shifting more than 11 ticks im mostly going to shoot invalid times
Considering im only pushing front_record & extrapolating if player's breaking lc
prob caused by this :
C++:
float time = pLocal->IsAlive() ? g_Vars.globals.predicted_curtime : Interfaces::m_pGlobalVars->curtime;
float delta_time = fabsf(correct - (time - record.m_flSimulationTime));
my valid_record function atm :
C++:
bool C_LagCompensation::IsRecordOutOfBounds(const Engine::C_LagRecord& record, float flTargetTime, float nTickbaseShiftTicks, bool dead_time_check) const {
        Encrypted_t<INetChannel> pNetChannel = Encrypted_t<INetChannel>(Interfaces::m_pEngine->GetNetChannelInfo());
        if (!pNetChannel.IsValid())
            return false;

        C_CSPlayer* pLocal = C_CSPlayer::GetLocalPlayer();
        if (!pLocal)
            return false;

        if (!pLocal->IsAlive())
            return false;

        int server_tick = Interfaces::m_pEngine->GetServerTick() + TIME_TO_TICKS(lagData.Xor()->m_flOutLatency);
        float correct = 0;
        // add out latency
        correct += lagData.Xor()->m_flOutLatency;

        // add in latency
        correct += lagData.Xor()->m_flServerLatency;

        // add interpolation amount
        correct += lagData.Xor()->m_flLerpTime;

        // clamp this shit
        correct = Math::Clamp(correct, 0.f, g_Vars.sv_maxunlag->GetFloat());

        // def cur time
        printf("g_Vars.globals.m_flCurtime: %f\n", g_Vars.globals.m_flCurtime);
        printf("g_Vars.globals.predicted_curtime: %f\n", g_Vars.globals.predicted_curtime);

        // get delta time
        float delta_time = fabsf(correct - (g_Vars.globals.predicted_curtime - record.m_flSimulationTime));
      
        printf("delta_time: %f\n", delta_time);

        bool delta = delta_time > 0.2f;

        if (delta)
            return true;
  
        return false; // (TICKS_TO_TIME(server_tick) - g_Vars.sv_maxunlag->GetFloat());
    }
predicted_curtime is getting updated in createmove by just
C++:
TIME_TO_TICKS(tickbase + extraprocessticks)
the debugging results are
WITH DOUBLETAP : delta_time always between 0.2xxxx 0.3xxx 0.4xxx
WITHOUT DOUBLETAP: delta_time always between 0.0002 0.0001 0.0000 which are the correct results

thats why my ragebot sometimes do not shoot or miss curtime when i dt because the deltatime goes above the supposed values
any thoughts?
show ur tickbase fix
 
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,176
Реакции[?]
314
Поинты[?]
152K
I'm using alpha cheat as base, i've reworked/modified many stuff but i still cannot figure out how to fix the issue that doubletap is causing on my valid_record function

Better explaination:

if i try to hit Front Record & player is moving & im shifting more than 11 ticks im mostly going to shoot invalid times
Considering im only pushing front_record & extrapolating if player's breaking lc
prob caused by this :
C++:
float time = pLocal->IsAlive() ? g_Vars.globals.predicted_curtime : Interfaces::m_pGlobalVars->curtime;
float delta_time = fabsf(correct - (time - record.m_flSimulationTime));
my valid_record function atm :
C++:
bool C_LagCompensation::IsRecordOutOfBounds(const Engine::C_LagRecord& record, float flTargetTime, float nTickbaseShiftTicks, bool dead_time_check) const {
        Encrypted_t<INetChannel> pNetChannel = Encrypted_t<INetChannel>(Interfaces::m_pEngine->GetNetChannelInfo());
        if (!pNetChannel.IsValid())
            return false;

        C_CSPlayer* pLocal = C_CSPlayer::GetLocalPlayer();
        if (!pLocal)
            return false;

        if (!pLocal->IsAlive())
            return false;

        int server_tick = Interfaces::m_pEngine->GetServerTick() + TIME_TO_TICKS(lagData.Xor()->m_flOutLatency);
        float correct = 0;
        // add out latency
        correct += lagData.Xor()->m_flOutLatency;

        // add in latency
        correct += lagData.Xor()->m_flServerLatency;

        // add interpolation amount
        correct += lagData.Xor()->m_flLerpTime;

        // clamp this shit
        correct = Math::Clamp(correct, 0.f, g_Vars.sv_maxunlag->GetFloat());

        // def cur time
        printf("g_Vars.globals.m_flCurtime: %f\n", g_Vars.globals.m_flCurtime);
        printf("g_Vars.globals.predicted_curtime: %f\n", g_Vars.globals.predicted_curtime);

        // get delta time
        float delta_time = fabsf(correct - (g_Vars.globals.predicted_curtime - record.m_flSimulationTime));
      
        printf("delta_time: %f\n", delta_time);

        bool delta = delta_time > 0.2f;

        if (delta)
            return true;
  
        return false; // (TICKS_TO_TIME(server_tick) - g_Vars.sv_maxunlag->GetFloat());
    }
predicted_curtime is getting updated in createmove by just
C++:
TIME_TO_TICKS(tickbase + extraprocessticks)
the debugging results are
WITH DOUBLETAP : delta_time always between 0.2xxxx 0.3xxx 0.4xxx
WITHOUT DOUBLETAP: delta_time always between 0.0002 0.0001 0.0000 which are the correct results

thats why my ragebot sometimes do not shoot or miss curtime when i dt because the deltatime goes above the supposed values
any thoughts?
and also the question on the local server works well?
 
Забаненный
Статус
Оффлайн
Регистрация
8 Июн 2023
Сообщения
4
Реакции[?]
0
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
as stated above, show your tickbase fix
wtf is alpha cheat? send the src and ill take a look

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.


Tickbase fix is public and is being run in runsim, i dont do any extra shit in runcommand or nor where
I'm not sure if the issue is with tickbase fixing since it doesn't output any prediction error but the real problem is
delta_time increasing and never going below 0.2, which now makes my ragebot not shooting if im shifting tickbase and trying to hit front_record
If i try to hit backtracked records it does work normal with no issue

(how i force front_record)

set all players as breaking lc in lagcomp just for testting
and in my ragebot if player breaking lc instead of iterating all valid records i just return front_record and check if record is valid ( which again it isn't )

The tickbasesystem is vader.tech
C++:
void InvokeRunSimulation(void* this_, float curtime, int cmdnum, CUserCmd* cmd, size_t local) {
    __asm {
        push local
        push cmd
        push cmdnum

        movss xmm2, curtime
        mov ecx, this_

        call Hooked::RunSimulationDetor.m_pOldFunction
    }
}

void TickbaseSystem::OnRunSimulation(void* this_, int iCommandNumber, CUserCmd* pCmd, size_t local) {
    g_pLocal = (void*)local;

    float curtime;
    __asm
    {
        movss curtime, xmm2
    }

    for (int i = 0; i < (int)g_iTickbaseShifts.size(); i++)
    {
        //ideally you compare the sequence we set this tickbase shift to
        //with the last acknowledged sequence
        if ((g_iTickbaseShifts[i].cmdnum < iCommandNumber - s_iNetBackup) ||
            (g_iTickbaseShifts[i].cmdnum > iCommandNumber + s_iNetBackup))
        {
            g_iTickbaseShifts.erase(g_iTickbaseShifts.begin() + i);
            i--;
        }
    }

    int tickbase = -1;
    for (size_t i = 0; i < g_iTickbaseShifts.size(); i++)
    {
        const auto& elem = g_iTickbaseShifts[i];

        if (elem.cmdnum == iCommandNumber)
        {
            tickbase = elem.tickbase;
            break;
        }
    }

    //apply our new shifted tickbase
    if (tickbase != -1 && local)
    {
        curtime = tickbase * s_flTickInterval;
    }

    fixed_curtime = curtime;
    //run simulation is the perfect place to do this because
    //all other predictables (ie your weapon)
    //will be run in the right curtime
    InvokeRunSimulation(this_, curtime, iCommandNumber, pCmd, local);
}
 
Модератор раздела "Создание скриптов для читов"
Модератор
Статус
Оффлайн
Регистрация
1 Фев 2020
Сообщения
1,197
Реакции[?]
390
Поинты[?]
45K
бож вас ещё учить нада

JavaScript:
mats.flor(*тут какая-то залупа код* /1000)
 
Сверху Снизу