Гайд Resolving Guide

Забаненный
Статус
Оффлайн
Регистрация
20 Дек 2022
Сообщения
5
Реакции[?]
3
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
I know there have been posted many thread's about this topic but i think its still not clear for newcomer's to understand what, how and where Resolver itself should be made. For me best way of finding player's side is animation's mainly, maybe some other thing's like tracing in case animation's fail. what many of you do is create local animstate and modify goalfeetyaw from there (from most resolver's i see here) example:
Код:
auto animstate = player->get_animation_state();

animstate->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + bruteyaw);
what you need to do to set goalfeetyaw that server use's is modify it directly from player example:
Код:
player->get_animation_state()->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + bruteyaw);
you need to do this just if you want to modify goalfeetyaw if you want to use it in some calculation's you dont. now let's move on resolving player. i would like to start on check's for animation resolve witch would be:
Код:
auto UseAnimLayerResolve = (Speed > 5.0f && layers[6].m_flPlaybackRate > 0.0f);
// Speed 5 means full movement start
to determine players side while he is moving we will do simple delta comparing. now comparing itself is not so hard but setup itself for animation's for newcomer's may be.
soo let's start with setup, what we want now to do is make an layer example:
Код:
AnimationLayer ResolverLayers[3][13];
next is to memcpy each layer for each matrix. we firstly modify our goalfeetyaw in update_animations and next we update client side animations and setup matrixes, after that we memcpy our layers,
example:
Код:
        // modifying goalfeetyaw for left(negative matrix)
        animstate->m_flGoalFeetYaw = math::normalize_yaw(e->m_angEyeAngles().y - 58.0f);
       
        // then we run an update_clientside_animation to update our data for current goalfeetyaw
       
        g_ctx.globals.updating_animation = true;
        e->update_clientside_animation();
        g_ctx.globals.updating_animation = false;

        // and now we setup our matrix

        setup_matrix(e, animlayers, NEGATIVE_MATRIX);
       
        //now what do we do here is empty current animstate soo we dont use previous one
       
        memcpy(animstate, &state, sizeof(c_baseplayeranimationstate));
       
        // and we finally memcpy our layers
       
        memcpy(record->m_ResolverLayers[2], e->get_animlayers(), sizeof(AnimationLayer) * 13);
you could learn more about memcpying on
Пожалуйста, авторизуйтесь для просмотра ссылки.
. okay now lets move on the topic. now comparing itself starts here. in our moving check or playbackrate check we settup each playbackrate example: (you can just go raw instead of this but i recommend doing like this)

Код:
        float_t CenterYawPlaybackRate = player_record->m_ResolverLayers[0][6].m_flPlaybackRate;
        float_t RightYawPlaybackRate = player_record->m_ResolverLayers[1][6].m_flPlaybackRate;
        float_t LeftYawPlaybackRate = player_record->m_ResolverLayers[2][6].m_flPlaybackRate;
next we make delta's for each playbackrate, example:

Код:
        float_t CenterYawPlaybackRateDelta = fabsf(CenterYawPlaybackRate - ServerYawPlaybackRate);
        float_t RightYawPlaybackRateDelta = fabsf(RightYawPlaybackRate - ServerYawPlaybackRate);
        float_t LeftYawPlaybackRateDelta = fabsf(LeftYawPlaybackRate - ServerYawPlaybackRate);
make sure we fabsf our values because we dont know what playbackrate is bigger between each other. now now comparing itself i would leave up to you.
delta detection is pretty much self-research i would recomment you take look at:
Пожалуйста, авторизуйтесь для просмотра ссылки.

now for resolving stand we can compare angles' and use trace for side. only delta detection that i am aware of it for stand is to check if player is extended, example:
Код:
auto IsExtended = (layers[3].weight == 0.0f && layers[3].cycle == 0.0f);
when player is extending he is most likely using max delta, else if he is not extending we would put out brute value somewhere in the middle like max delta * 0.85f.
now lets move on detecting his side. there is not much too explain about comparing angles here, example:

Код:
        auto Delta = math::normalize_yaw(player->m_angEyeAngles().y - AnimationState->m_flGoalFeetYaw);
        if (Delta > 35.0f)
            ResolvedSide[idx] = -1;
        else if (Delta < -35.0f)
            ResolvedSide[idx] = 1;
now this is only for extended aka high delta value. for lower delta value we would need to use traces. (note this is only for standing) detecting with trace would be:

Код:
    Vector src3D, dst3D, forward, right, up, src, dst;
    float back_two, right_two, left_two;
    trace_t tr;
    Ray_t ray, ray2, ray3, ray4, ray5;
    CTraceFilter filter;

    math::angle_vectors(Vector(0, GetBackwardYaw(player), 0), &forward, &right, &up);

    filter.pSkip = player;
    src3D = player->get_shoot_position();
    dst3D = src3D + (forward * 384); // number 384 represents how far trace will go

    ray.Init(src3D, dst3D);
    m_trace()->TraceRay(ray, MASK_SHOT, &filter, &tr);
    back_two = (tr.endpos - tr.startpos).Length();

    ray2.Init(src3D + right * 30, dst3D + right * 30);
    m_trace()->TraceRay(ray2, MASK_SHOT, &filter, &tr);
    right_two = (tr.endpos - tr.startpos).Length();

    ray3.Init(src3D - right * 30, dst3D - right * 30);
    m_trace()->TraceRay(ray3, MASK_SHOT, &filter, &tr);
    left_two = (tr.endpos - tr.startpos).Length();

    if (left_two > right_two)
        ResolvedSide[idx] = -1;
    else if (right_two > left_two)
        ResolvedSide[idx] = 1;
    else
        ResolvedSide[idx] = 0;
when extending our brute angle ( we cant really determine his real angle delta here when standing we can just take our best guess) would be max desync angle function ( i would not explain this function because you have it in your local lw source). when enemy is not extending and he is standing our brute angle would be max_desync_angle * 0.80f (somewhere in the middle enough for safepoints to overlap them). now we can just set our goalfeetyaw from our data we got, example:
Код:
player->get_animation_state()->m_flGoalFeetYaw = math::normalize_yaw(player->m_angEyeAngles().y + (ResolvedSide[idx] * ResolvedDelta[idx]));
really hope this helps someone and there would be no more llama blatantly pasted resolvers or even worse weave resolvers.
 
Последнее редактирование:
get good get legendware
Участник
Статус
Оффлайн
Регистрация
22 Сен 2020
Сообщения
438
Реакции[?]
201
Поинты[?]
48K
you’re missing ALOT of things

also all of this wouldn’t work if you have no proper animation system
also if you have a correct animfix and you’re setuping animation layer data correctly and you detect play back rate and you still miss then you put a check for EnemyUsingRoll = true;
and we simulate eyeangles.z = -+ 90 then safe point it if you don’t want to dump
otherwise just hit body lol
 
Keep Ev0lving, Stay Fatal
Эксперт
Статус
Оффлайн
Регистрация
6 Фев 2018
Сообщения
1,551
Реакции[?]
586
Поинты[?]
102K
Если отдельно брать ресольвер, то тут информации где-то на 60-70%.
Слишком мало информации о том, что ты юзал и как.
Тема f0rtis1337 с пояснениями за некоторые анимации пригодится перед чтением этого гайда.
 
Начинающий
Статус
Оффлайн
Регистрация
25 Окт 2022
Сообщения
35
Реакции[?]
6
Поинты[?]
0
А для чего normalize_yaw и откуда 58?
 
Последнее редактирование:
Эксперт
Статус
Оффлайн
Регистрация
30 Дек 2019
Сообщения
1,967
Реакции[?]
958
Поинты[?]
19K
Новичок
Статус
Оффлайн
Регистрация
22 Ноя 2024
Сообщения
1
Реакции[?]
0
Поинты[?]
0
you’re missing ALOT of things

also all of this wouldn’t work if you have no proper animation system
also if you have a correct animfix and you’re setuping animation layer data correctly and you detect play back rate and you still miss then you put a check for EnemyUsingRoll = true;
and we simulate eyeangles.z = -+ 90 then safe point it if you don’t want to dump
otherwise just hit body lol
whats he missin
 
Похожие темы
Сверху Снизу