Page 1 of 1

Of pitch curving.

PostPosted: Tue Oct 04, 2011 1:37 pm
by Johnson
How do I disable pitch curving, or an acceleration curve?

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 1:52 pm
by L. Spiro
What he is asking is sometimes you hack an FPS game and you see a 16-bit number going up and down as you aim your character up and down (*cough* Unreal Tournament 2003 *cough*).
This is a sin/cos table. The 16-bit value is used to index into a table of 65,535 floats for sine values and 65,535 floats for cosine values.

Today, these tables cannot keep up with simply calling cos() or sin() due to the slowness of cache hits using tables vs. the raw speed of the FPU at simply calculating these numbers.
But they were more efficient back in the day.


So you have encountered this 16-but unsigned short that moves up and down as you angle up and down. What do you do with it? Use it as an index into one of the tables, of course.

One way is to find the tables in the game RAM.
You could copy them to your local RAM for efficient access, or use ithem directly if you are using DLL injection.


Another way is to generate your own tables. The code below illustrates how to make and use the tables.
Code: Select all
#define LSM_TABLESIZE            (0xFFFF+1)


   LSREAL      CMathLib::m_fCosTable[LSM_TABLESIZE] = { LSM_ZERO };
   LSREAL      CMathLib::m_fSinTable[LSM_TABLESIZE] = { LSM_ZERO };



         // Create a cos/sin look-up tables.
         for ( LSINT32 I = LSM_TABLESIZE; --I >= 0; ) {
            LSREAL fCos = LSMCOS( (2.0 * LSM_PI_DOUBLE / LSM_TABLESIZE) * I );
            LSREAL fSin = LSMSIN( (2.0 * LSM_PI_DOUBLE / LSM_TABLESIZE) * I );
            m_fCosTable[I] = fCos;
            m_fSinTable[I] = fSin;
         }



Code: Select all
LSMREAL fCos = m_fCosTable[ui16Index];


ui16Index here is the 16-bit value you discovered in the game. fCos represents the cosine of that value.


L. Spiro

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 2:07 pm
by Johnson
I do not know, whether it uses a table; because I never found indices, but did modify the floats.

What does this mean?

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 4:25 pm
by L. Spiro
I don’t know. What floats?
If you did not find indices, what did you find?


L. Spiro

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 5:24 pm
by Johnson
I found a vector for the pitch, and a vector for the yaw.

The pitch and yaw are stored in radians, at vPitch.m_rX and vYaw.m_rY.

But the pitch seems to be curved!

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 8:27 pm
by L. Spiro
What does “curved” mean?


L. Spiro

Re: Of pitch curving.

PostPosted: Tue Oct 04, 2011 8:42 pm
by Johnson
I was told that the pitch becomes more sensitive around body, but less sensitive around the feet or sky; and that this may be handy for consoles.

Re: Of pitch curving.

PostPosted: Wed Oct 05, 2011 6:35 pm
by L. Spiro
Unless you describe it more clearly I cannot help.


L. Spiro

Re: Of pitch curving.

PostPosted: Wed Oct 05, 2011 7:07 pm
by Johnson
Imagine you're playing a FPS with a controller.

Most aiming is done around the center; there it is more sensitive.

Aiming done on extremes is made less sensitive, because would make it a pain on controller.

Or not?

Re: Of pitch curving.

PostPosted: Wed Oct 05, 2011 7:50 pm
by L. Spiro
So what is the data you have and what do you want to do with it?


L. Spiro

Re: Of pitch curving.

PostPosted: Wed Oct 05, 2011 7:58 pm
by Johnson
If an aimbot is to work, it needs to curve the pitch, no?

Re: Of pitch curving.

PostPosted: Thu Oct 06, 2011 9:09 am
by L. Spiro
That is an input mechanism, but an internal mechanism.
An auto-aim only needs to point the player at a target using standard vector math.


L. Spiro