Начинающий
-
Автор темы
- #1
velocity modifier is innacurate af
and events get delayed a fuck ton when i fakelag
and events get delayed a fuck ton when i fakelag
about events delay( in createmove )velocity modifier is innacurate af
and events get delayed a fuck ton when i fakelag
else // keep up communication even when fakelagging.
{
const auto current_choke = net_channel->choked_packets;
net_channel->choked_packets = 0;
net_channel->send_datagram();
--net_channel->out_sequence_nr;
net_channel->choked_packets = current_choke;
}
if ( cmd.number == ( last_cmd_ack + 1 ) )
player.velocity_modifier = prediction.m_net_velocity_modifier;
void __cdecl velocity_modifier(valve::recv_proxy_data_t* const data, valve::c_entity* const entity, void* const out) {
orig_velocity_modifier(data, entity, out);
if (!valve::g_local_player
|| entity->index() != valve::g_local_player->index()
|| data->m_value.m_float == hacks::g_eng_pred->net_velocity_modifier())
return;
hacks::g_eng_pred->net_velocity_modifier() = data->m_value.m_float;
valve::g_prediction->m_prev_ack_had_errors = true;
}
if ( m_net_velocity_modifier < 1.f )
m_net_velocity_modifier = clamp( m_net_velocity_modifier + globals->interval_per_tick * 0.4f, 0.f, 1.f );
i already do the createmove stuff but thats the problem it wont work properly but when i try it on supremacy it works just fine and i do the packet start stuff on bothabout events delay( in createmove )
about velocity modifier:C++:else // keep up communication even when fakelagging. { const auto current_choke = net_channel->choked_packets; net_channel->choked_packets = 0; net_channel->send_datagram(); --net_channel->out_sequence_nr; net_channel->choked_packets = current_choke; }
just netvar compression + in run cmd or phys_sim add smth like this:
m_net_velocity_modifier get the value from proxy:C++:if ( cmd.number == ( last_cmd_ack + 1 ) ) player.velocity_modifier = prediction.m_net_velocity_modifier;
and set on spawn net_velocity_modifier on 1( how to game does ) + in ur prediction where u call prediction::updateC++:void __cdecl velocity_modifier(valve::recv_proxy_data_t* const data, valve::c_entity* const entity, void* const out) { orig_velocity_modifier(data, entity, out); if (!valve::g_local_player || entity->index() != valve::g_local_player->index() || data->m_value.m_float == hacks::g_eng_pred->net_velocity_modifier()) return; hacks::g_eng_pred->net_velocity_modifier() = data->m_value.m_float; valve::g_prediction->m_prev_ack_had_errors = true; }
put it:
C++:if ( m_net_velocity_modifier < 1.f ) m_net_velocity_modifier = clamp( m_net_velocity_modifier + globals->interval_per_tick * 0.4f, 0.f, 1.f );
я нигде не упомянул о том что это приватный код если чтоPoTrOsHiTeL Privete paste c public $$$$
bool allow_packet(int command) {
if (!g_local || !g_local->is_alive())
return true;
if (commands.empty())
return true;
for (int i = 0; i < commands.size(); ++i) {
int cmd = commands.at(i);
if (!cmd || cmd != command)
continue;
commands.erase(commands.begin() + i);
return true;
}
return false;
}
if (variables::m_packet) {
variables::m_angle = variables::m_cmd->viewangles;
engine_prediction::commands.emplace_back(variables::m_cmd->command_number);
while (engine_prediction::commands.size() > 64)
engine_prediction::commands.pop_front();
}
else {
INetChannel* nci = g_client_state->m_NetChannel;
if (nci) {
const int choke = nci->m_nChokedPackets;
nci->m_nChokedPackets = 0;
nci->send_datagram(nullptr);
--nci->m_nOutSequenceNr;
nci->m_nChokedPackets = choke;
}
}
void __fastcall packets::packet_start::hook(void* ecx, void* edx, int incoming, int outgoing) {
if (engine_prediction::allow_packet(outgoing))
return original(ecx, edx, incoming, outgoing);
}
everything is fine with ur packet start hookКод:bool allow_packet(int command) { if (!g_local || !g_local->is_alive()) return true; if (commands.empty()) return true; for (int i = 0; i < commands.size(); ++i) { int cmd = commands.at(i); if (!cmd || cmd != command) continue; commands.erase(commands.begin() + i); return true; } return false; }
there is nothing wrong with it cuz i tried it in other sources i had laying around and it did its job.Код:if (variables::m_packet) { variables::m_angle = variables::m_cmd->viewangles; engine_prediction::commands.emplace_back(variables::m_cmd->command_number); while (engine_prediction::commands.size() > 64) engine_prediction::commands.pop_front(); } else { INetChannel* nci = g_client_state->m_NetChannel; if (nci) { const int choke = nci->m_nChokedPackets; nci->m_nChokedPackets = 0; nci->send_datagram(nullptr); --nci->m_nOutSequenceNr; nci->m_nChokedPackets = choke; } }
most likely some dumb ass hook i added while cride "helped" me.
also DONT ASK WHY I USE m_ on namespaces it looks cool
Код:void __fastcall packets::packet_start::hook(void* ecx, void* edx, int incoming, int outgoing) { if (engine_prediction::allow_packet(outgoing)) return original(ecx, edx, incoming, outgoing); }
Проект предоставляет различный материал, относящийся к сфере киберспорта, программирования, ПО для игр, а также позволяет его участникам общаться на многие другие темы. Почта для жалоб: admin@yougame.biz