-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
My issue in basic words:
-I stopped trying to hit backtrack records and only push front record
-Im trying to fix my issues with doubletap hitting front record if it is moving
Extra info:
Doubletap works perfectly fine if im shooting backtracked records, tickbase is also properly fixed no matter latency/community-local server
In my IsValidTick im already taking account of predicted curtime : t2tick ( tickbase + extraprocessticks )
it returns as a valid delta range between the records but seems it is not right.
Resume:
If im shifting tickbase and player's moving im mostly going to shoot at a wrong time seems like the 1st bullets shoots invalid time and the seccond work works perfectly fine.
If i disable double tap, and try to hit front record everything works.
What should it be?
enginepred: setting curtime tb etc
IsValidTick function :
fixing tickbase proccess OnPredictionUpdate hook :
s_PostTickBase & pretickbase are getting calculated inside Cl_Move
Preview:
Im also invoking predicted curtime onrunsimulation:
Full hook code >
-I stopped trying to hit backtrack records and only push front record
-Im trying to fix my issues with doubletap hitting front record if it is moving
Extra info:
Doubletap works perfectly fine if im shooting backtracked records, tickbase is also properly fixed no matter latency/community-local server
In my IsValidTick im already taking account of predicted curtime : t2tick ( tickbase + extraprocessticks )
it returns as a valid delta range between the records but seems it is not right.
Resume:
If im shifting tickbase and player's moving im mostly going to shoot at a wrong time seems like the 1st bullets shoots invalid time and the seccond work works perfectly fine.
If i disable double tap, and try to hit front record everything works.
What should it be?
enginepred: setting curtime tb etc
C++:
// backup tickbase
int nOldTickBase = predictionData->m_pPlayer->m_nTickBase();
if (!m_pLastCmd ||
m_pLastCmd->hasbeenpredicted)
predictionData->m_nTickBase++;
else
predictionData->m_nTickBase = predictionData->m_pPlayer->m_nTickBase();
THE WAY I SET CURTIME:
Interfaces::m_pGlobalVars->curtime = TICKS_TO_TIME(predictionData->m_nTickBase);
C++:
curtime = TICKS_TO_TIME(m_nTickBase + g_TickbaseController.s_nExtraProcessingTicks + simTicksThisFrame);
C++:
auto start = *(int*)((size_t)g_pLocal + OFFSET_TICKBASE);
for (size_t i = 0; i < g_iTickbaseShifts.size(); i++) {
const auto& elem = g_iTickbaseShifts[i];
if (elem.cmdnum == (outgoing_command + 1)) {
*(int*)((size_t)g_pLocal + OFFSET_TICKBASE) = s_PreTickBase;
Interfaces::m_pGlobalVars->curtime = TICKS_TO_TIME(s_PreTickBase);
s_FinalTickbase = s_PreTickBase;
printf("[TickbaseSystem] on pred update | tickbase: %i\n", s_PreTickBase);
break;
}
else if (elem.cmdnum == (outgoing_command)) {
*(int*)((size_t)g_pLocal + OFFSET_TICKBASE) = s_PostTickBase;
Interfaces::m_pGlobalVars->curtime = TICKS_TO_TIME(s_PostTickBase);
s_FinalTickbase = s_PostTickBase;
printf("[TickbaseSystem] post update | tickbase: %i\n", s_PostTickBase);
break;
}
}
}
Preview:
C++:
int start = *(int*)((size_t)g_pLocal + OFFSET_TICKBASE);
int estimated = start + s_nExtraProcessingTicks + **(int**)Engine::Displacement.Data.m_uHostFrameTicks + choke;
if (estimated > arrive + s_iClockCorrectionTicks || estimated < arrive - s_iClockCorrectionTicks) {
estimated = arrive - s_nExtraProcessingTicks - choke - **(int**)Engine::Displacement.Data.m_uHostFrameTicks + 1;
s_PostTickBase = estimated;
}
Full hook code >
C++:
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 + 1)) {
tickbase = s_PreTickBase;
break;
}
else if (elem.cmdnum == (iCommandNumber)) {
tickbase = s_PostTickBase;
break;
}
}
//apply our new shifted tickbase
if (tickbase != -1 && local)
{
curtime = s_PredCurtime = tickbase * s_flTickInterval;
s_FinalTickbase = tickbase;
}
//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);