hello my Russian friends. ive seen a ton of "resolvers" on here and they're useless and shit. ill go over some ACTUALLY decent resolving methods here so, get your google translate out and stay tuned.
opposites: not the best choice, but it has its place and you'll find out why later
// less advanced
float EyeDelta = player->EyeAngles().y - animstate->goalfeetyaw;
int Side = (EyeDelta > 0.f) ? -1 : 1;
animstate->goalfeetyaw = player->EyeAngles().y + desync_delta * Side;
// more advanced
float EyeDelta = player->EyeAngles().y - animstate->goalfeetyaw;
bool LowDelta = EyeDelta <= 30.f;
int Side = (EyeDelta > 0.f) ? -1 : 1;
float desync_delta = LowDelta ? player->MaxDesync() / 2 : player->MaxDesync();
switch (missedshots)
{
case 0: animstate->goalfeetyaw = player->EyeAngles().y + desync_delta * Side; break;
case 1: animstate->goalfeetyaw = player->EyeAngles().y + desync_delta * -Side; break;
case 2: animstate->goalfeetyaw = 180.f;
}
anti-freestand: a safer choice than opposites. theres different ways to do this but i suggest using stickrpg's anti freestand. also you can use it in combination with opposites to cross reference the different angles
for (int i = 1; i < interfaces.engine->GetMaxClients(); ++i)
{
auto player = interfaces.ent_list->GetClientEntity(i);
if (!player || !player->isAlive() || player->IsDormant() || player->GetTeam() == csgo->local->GetTeam())
continue;
bool Autowalled = false, HitSide1 = false, HitSide2 = false;
auto idx = player->GetIndex();
float angToLocal = Math::CalculateAngle(csgo->local->GetOrigin(), player->GetOrigin()).y;
Vector ViewPoint = csgo->local->GetOrigin() + Vector(0, 0, 90);
Vector2D Side1 = { (30 * sin(DEG2RAD(angToLocal))),(30 * cos(DEG2RAD(angToLocal))) };
Vector2D Side2 = { (30 * sin(DEG2RAD(angToLocal + 180))) ,(30 * cos(DEG2RAD(angToLocal + 180))) };
Vector2D Side3 = { (60 * sin(DEG2RAD(angToLocal))),(60 * cos(DEG2RAD(angToLocal))) };
Vector2D Side4 = { (60 * sin(DEG2RAD(angToLocal + 180))) ,(60 * cos(DEG2RAD(angToLocal + 180))) };
Vector Origin = player->GetOrigin();
Vector2D OriginLeftRight[] = { Vector2D(Side1.x, Side1.y), Vector2D(Side2.x, Side2.y) };
Vector2D OriginHighLeftRight[] = { Vector2D(Side3.x, Side3.y), Vector2D(Side4.x, Side4.y) };
for (int side = 0; side < 2; side++)
{
Vector OriginAutowall = { Origin.x + OriginLeftRight[side].x, Origin.y - OriginLeftRight[side].y , Origin.z + 90 };
Vector OriginAutowall2 = { ViewPoint.x + OriginHighLeftRight[side].x, ViewPoint.y - OriginHighLeftRight[side].y , ViewPoint.z };
if (g_AutoWall.CanHitFloatingPoint(OriginAutowall, ViewPoint))
{
if (side == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
}
else if (side == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
}
Autowalled = true;
}
else
{
for (int side222 = 0; side222 < 2; side222++)
{
Vector OriginAutowallHigh = { Origin.x + OriginLeftRight[side222].x, Origin.y - OriginLeftRight[side222].y , Origin.z + 90 };
if (g_AutoWall.CanHitFloatingPoint(OriginAutowallHigh, OriginAutowall2))
{
if (side222 == 0)
{
HitSide1 = true;
FreestandSide[idx] = -1;
}
else if (side222 == 1)
{
HitSide2 = true;
FreestandSide[idx] = 1;
}
Autowalled = true;
}
}
}
if (!Autowalled)
FreestandSide[idx] = 0;
}
}
animlayers: now we're getting into big brain territory where i see tons of people messing up and not doing it right. for each layer you make you need to have THAT layer relate to a matrix or you're not really doing anything at all. example:
player->UpdateClientSideAnimation();
float EyeDelta = player->GetEyeAngles().y - animstate->m_flGoalFeetYaw;
std::memcpy(csgo->MoveLayers[0][6], player->GetAnimOverlay(6), 0x38 * int(player->GetAnimOverlays()));
player->SetupBones(csgo->zero, 128, 0x7FF00, interfaces.global_vars->curtime);
if (EyeDelta < 0.f)
{
std::memcpy(csgo->MoveLayers[1][6], player->GetAnimOverlay(6), 0x38 * int(player->GetAnimOverlays()));
player->SetupBones(csgo->positive, 128, 0x7FF00, interfaces.global_vars->curtime);
}
else
{
std::memcpy(csgo->MoveLayers[2][6], player->GetAnimOverlay(6), 0x38 * int(player->GetAnimOverlays()));
player->SetupBones(csgo->negative, 128, 0x7FF00, interfaces.global_vars->curtime);
}
make sure you set your fucking matrices and your layers im sick of seeing people just make 3 pseudo layers that dont do shit and using them to resolve its dumb.
also im not putting the calculations you need to find side off of animlayers cause its been posted a million times.
tracing: personally i hate tracing i think its basically useless, BUT if you actually set your vectors and matrices properly it might not be the worst idea
Vector current;
float back_two, right_two, left_two;
trace_t tr;
Ray_t ray, ray2, ray3;
CTraceFilter filter;
Vector right(player->GetEyeAngles().x, player->GetEyeAngles().y + player->MaxDesyncDelta(), player->GetEyeAngles().z);
Vector left(player->GetEyeAngles().x, player->GetEyeAngles().y - player->MaxDesyncDelta(), player->GetEyeAngles().z);
Vector back(player->GetEyeAngles().x, 180.f, player->GetEyeAngles().z);
current = player->GetEyeAngles();
filter.pSkip = player;
float distance = /*whatever*/;
ray.init(current, right);
ray2.init(current, left);
ray3.init(current, back);
float back_one, right_one, left_one;
right_one = current.y - right.y;
left_one = current.y - left.y;
back_one = current.y - back.y;
interfaces.trace->TraceRay(ray, MASK_SHOT, &filter, &tr);
right_two = tr.endpos.Length2D() - tr.startpos.Length2D();
interfaces.trace->TraceRay(ray2, MASK_SHOT, &filter, &tr);
left_two = tr.endpos.Length2D() - tr.startpos.Length2D();
interfaces.trace->TraceRay(ray3, MASK_SHOT, &filter, &tr);
back_two = tr.endpos.Length2D() - tr.startpos.Length2D();
*side = 0;
// if extending we have an easier time finding their real
if (player->GetAnimOverlay(3)->m_flCycle == 0.f && player->GetAnimOverlay(3)->m_flWeight == 0.f)
{
if (fabs(right_one) >= player->MaxDesyncDelta())
*side = 1;
else if (fabs(left_one) >= player->MaxDesyncDelta())
*side = -1;
else if (fabs(back_one) >= player->MaxDesyncDelta())
*side = 0;
}
// else we use tracing
else
{
if (fabs(right_two) >= distance)
*side = 1;
else if (fabs(left_two) >= distance)
*side = -1;
else if (fabs(back_two) >= distance)
*side = 0;
}
there are a few reasons to use tracing. tracing can sometimes give us safer and "stricter" resolves because tracing uses actual in game distance. experiment, the tracing code i put works better than others but its still FAR from perfect.
lby: usually doesnt work anymore, majority of cheats use micromovements now but in the off chance you come across an aimware user this is a pretty easy resolve. the idea is you check their lby angle when they set off sequence 979, their lby angle will almost always flick towards their fake which should (in theory) allow us to get a good resolve
int LbySide = 0;
if (player->GetAnimOverlay(3)->m_nSequence == 979 && player->GetVecVelocity().Length2D() == 0.f)
{
float LbyAngle = player->GetLowerBodyYaw();
LbySide = (LbyAngle > 0.f) ? -1 : 1;
}
animstate->goalfeetyaw = player->GetEyeAngles().y + desync_delta * LbySide;
alright thats about it. dont paste any of this by the way its all just for examples. you need to build these different methods IN YOUR ACTUAL SOURCE or else majority of them will return tons of errors or you'll fuck something up and they just wont work at all. good luck!