Вопрос Prediction error?

Пользователь
Статус
Оффлайн
Регистрация
12 Фев 2024
Сообщения
64
Реакции[?]
31
Поинты[?]
36K
velocity modifier is innacurate af
and events get delayed a fuck ton when i fakelag
about events delay( in createmove )
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;
}
about velocity modifier:
just netvar compression + in run cmd or phys_sim add smth like this:
C++:
if ( cmd.number == ( last_cmd_ack + 1 ) )
    player.velocity_modifier = prediction.m_net_velocity_modifier;
m_net_velocity_modifier get the value from proxy:
C++:
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;
    }
and set on spawn net_velocity_modifier on 1( how to game does ) + in ur prediction where u call prediction::update
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 );
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2021
Сообщения
37
Реакции[?]
10
Поинты[?]
3K
about events delay( in createmove )
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;
}
about velocity modifier:
just netvar compression + in run cmd or phys_sim add smth like this:
C++:
if ( cmd.number == ( last_cmd_ack + 1 ) )
    player.velocity_modifier = prediction.m_net_velocity_modifier;
m_net_velocity_modifier get the value from proxy:
C++:
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;
    }
and set on spawn net_velocity_modifier on 1( how to game does ) + in ur prediction where u call prediction::update
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 );
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 both
 
Пользователь
Статус
Оффлайн
Регистрация
12 Фев 2024
Сообщения
64
Реакции[?]
31
Поинты[?]
36K
Пользователь
Статус
Оффлайн
Регистрация
12 Фев 2024
Сообщения
64
Реакции[?]
31
Поинты[?]
36K
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2021
Сообщения
37
Реакции[?]
10
Поинты[?]
3K
Код:
 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;
            }
        }
there is nothing wrong with it cuz i tried it in other sources i had laying around and it did its job.
most likely some dumb ass hook i added while cride "helped" me.
also DONT ASK WHY I USE m_ on namespaces it looks cool:blush:
Код:
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);
    }
 
Начинающий
Статус
Оффлайн
Регистрация
22 Сен 2021
Сообщения
37
Реакции[?]
10
Поинты[?]
3K
YUP CRIDE CODE BACK AT IT AGAIN BRO MANAGED TO KILL MY HACK JUST WITH PHYSICS SIMULATE
 
Последнее редактирование:
Пользователь
Статус
Оффлайн
Регистрация
12 Фев 2024
Сообщения
64
Реакции[?]
31
Поинты[?]
36K
Код:
 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;
            }
        }
there is nothing wrong with it cuz i tried it in other sources i had laying around and it did its job.
most likely some dumb ass hook i added while cride "helped" me.
also DONT ASK WHY I USE m_ on namespaces it looks cool:blush:
Код:
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
are u sure that your send_packet is correct?
or smth other shit broke ur event delay fix
 
Сверху Снизу