Results 1 to 5 of 5
  1. #1
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky

    ESP Tutorial by sraeG

    Introduction

    Ok then. I’m taking it you’ve all seen ESP’s before? If not, here is an example of one coded by Deltron, using the method that will be described in the following article:


    Image: CoD 4 ESP as coded by Deltron

    The idea behind an ESP is to gain extra information about enemies, and the general way this is done within gamehacks is by overlaying a layer of text over them.

    However, for people like me who can’t code in D3D or OpenGL and have no desire to waste their time learning, how can you determine where to write the text to on screen using only the in-game co-ordinates of the player/item/building that you want to tag? This is where the concept of 3d-to-2d comes in.

    I will say now, those who are not very good with mathematical understandings (especially trig) or are not very proficient in their chosen language, this tutorial may not be suitable for you. Also, this tutorial requires an angle given from my Aimbot tutorial to get our angle to aim at the enemy. With that said, let’s get the basics out of the way..


    Basic Understanding

    The whole idea of this concept is to be able to convert in-game 3d co-ordinates into 2d screen pixel co-ordinates.



    Now imagine this is you in your chosen FPS game, looking straight down at the player from above. Your player is viewing North, and there is an enemy ahead of you, and slightly to your right (North-East of you). The red partition is your field of view, i.e. if the enemy were to move further right and therefore out of this portion, he would not be visible on your screen.

    The screen (the blue horizontal line) therefore contains all it’s pixels between the points where to red lines cross, and the screen moves up and down depending on the distance of the enemy. To make this easier to understand, here is a picture showing where the screen would be for 2 enemies at different distances. It is assumed that the playing resolution is 800×600, and therefore, the width of the screen is 800 pixels:



    Now, let’s study this image briefly. As can be seen, the screen adjusts its position based on how far away the enemy is to us, and this in turn affects the distance of in-game co-ordinates that the 800 pixels is spread out to cover.

    Both enemies are the same distance to our right in this picture. However, by estimate we can visually see that due to their distance away from us, they do not take up the same proportion of our 800 pixels. Enemy 1 takes up about 1/3 of the right hand portion of our field of view, whereas Enemy 2 takes up around 1/2. Therefore, seen as though we know that the central line is at 400 pixels (which would be directly infront of us), we can evaluate that to tag Enemy 1 we would need to write at approximately 400 + (0.33 * 400) pixels, and to tag Enemy 2 we would need to write to around 400 + (0.5 * 400) pixels in the X direction.

    This can be simulated quite easy in real-life by putting two items infront of you, for example beer bottles. Put them directly infront of you, but one further away than the other. Now take a step to your left but keep looking straight forawrd. As can be predicted, you can see them both still though they are different angles.. the 1 further away is nearer to your viewing angle, and so would need less of a head-turn to look at.

    Hopefully you have understood this concept so far, if not, leave me comments or something. If you have, carry on reading.

    Expanding the Principle

    Ok, so let’s take a look at that above picture again with the 2 enemies. We know that by looking at this diagram, we can roughly guess the pixels, but how does this help? Let’s alter the picture slightly :



    Ok, so now with the inclusion of a grid (which will simulate our in-game co-ordinates on an exagerated scale), we can see things abit easier.

    What we can gather from this grid is that, if our enemy was 4 Game Co-ordinate units away from us, our screen of 800 pixels would cover roughly 10 Game Co-ordinates. That said, we can see that half of our screen would be 5 Game Co-ordinate unites, equating to 400 pixels. Now looking at the enemy, we know he is roughly 2 co-ord units to our right, meaning to tag him we would have to write our text to an X pixel co-ord of 400 + ((2/5)*400). Remeber, this first 400 is added as he is past the half way point.

    To make this more universally acceptible, we can say that if our enemy is to our right, he is:

    (ScreenXResolution / 2) + ((EnemyCoordUnits / FOVCoordUnits) * ScreenXResolution / 2)

    In our above example:

    * ScreenXResolution = 800
    * EnemyCoordUnits = 2
    * FOVCorordUnits = 5

    So, if we wrote our text to 400 + ((2/5)*400) which is 560 in the X direction, our text would be over our enemy (as far as horizontal is concerned, as vertical has not been accounted for).

    Now, let’s apply this to our game.

    Applying the Concept to a Game

    From now on, so that more detail can be put in, we will assume that the enemy we are working on is located to our right and therefore I will only show this side of the central line in following diagrams. Now, check this diagram out.. explanations will follow..



    Just as a pointer for people, lines are referred to by their points. For example, the line XZ is the line from us to our enemy, and the line DF is from the center point to where the FOV meets the screen. From now on, points will be referred to by their letter and lines by their point notation.

    Ok then, so this diagram shows all the infromation required to get the distances we need (in this diagram, DZ and DF). So lets start off from scratch… what do we need to get from memory?

    * Our players X and Z co-ordinates (not height, yet.. in this picture, Y would be either going into the screen or coming out at you)
    * Enemy’s X and Z co-ordinates
    * The angle that we are currently looking at
    * The angle that we need to aim at to hit the enemy (gained from Aimbot tutorial)
    * FOV Angle /2 - this can be done by trial and error, or some games specify it. Try 40 degrees, and work from there if in doubt

    Ok then, firstly, let’s get each of the parts we need, starting with the easiest.

    ANG

    ANG is simply the difference between where we are looking, and where we need to look to hit the enemy. For example, say we are looking at 270 degrees and to aim at our enemy we’d need to be looking at 289, ANG = 19 degrees.



    XZ

    XZ is obtained using pythagoras.


    A is the difference in ours and the enemy’s Z co-ords, and B is the difference in our and the enemy’s X co-ordinates. C is XZ.

    For example, if we are at co-ordinate (3,4) on a map and the enemy is at (6,10) :

    B = 6 - 3 = 3
    A = 10 - 4 = 6
    C² = 6² + 3² = 36 + 9 = 45

    C =?45 = ~6.7 = XZ

    Note: Remember that A and B in this diagram are NOT XD and DF on the previous diagram. This would only be true if we were facing directly north all the time.



    DZ

    Now that we have ANG and XZ, we can use triganometry to obtain DZ.

    Sin(angle) = Opposite / Hypotenuse

    Therefore, Opposite (which is DZ) = Sin(angle) * Hypotenuse

    DZ = Sin(ANG) * XZ



    DX

    Using the above information, but a different trig will give us DX.

    Cos(angle) = Adjacent / Hypotenuse

    Therefore, Adjacent (which is DX) = Cos(angle) * Hypotenuse

    DX = Cos(ANG) * XZ

    DX is required as it is the only line that stays a constant length in both triangles XDF and XDZ. Therefore, with this side we can use trig to get DF.



    DF

    Again, triganometry comes into play.

    Tan(angle) = Opposite / Adjacent

    Therefore, Opposite = Tan(angle) * Adjacent

    DF = Tan(FOV Angle/2) * DX

    Using the Obtained Values

    Now that we have the two essential values that we need (DZ and DF), we can apply this to the grid picture right back up top.

    If the enemy is to our right, in a 800×600 resolution game, the X write value is:

    400 + ((DZ/DF) * 400)

    Just for example with a 640×480 resolution:

    320 + ((DZ/DF) * 320)

    Now, assuming that the enemy is on our left, and therefore everything is flip reversed, it should be fairly obvious to see that the X write value is:

    400 - ((DZ/DF) * 400)

    Final Thoughts

    Now, that is the concept of converting 3d game co-ordinates into 2d pixels, applied for just the X value. The same concepts can be applied to Y value and then, by overlaying text at these co-ordinates you will have a fully working ESP As this is just an article on the concept, no code was or will be included, and this is as far as will be explained. If you have understood the article, creating the pixel co-ord for the Y value should be no problem, but as always, leave comments if needed.

    By the way, as a side note. If SetCursorPos is used on these co-ordinates, you have just successfully created an aimbot that doesn’t write any information to the game, and therefore gets past alot of anti-cheat applications.

    End Note

    An absolutely massive shout-out goes to Deltron who first proposed the challenge of doing this to me over MSN, which let to many hours of MSN conversations while we worked over the above method. Hopefully in the not too distanct future, we will collaborate on a full tutorial with better explanations, in-game pictures and such, and on that note could you please pass any suggestions or problems onto my by use of comments!!!

    Overall, good luck, and if you plan to use this tutorial then please give credits where due, to both me (sraeG) and Deltron.


    I(Hell_Demon) have nothing to do with this tutorial, all credits go to sraeG and Deltron!

    If you plan on using anything from this tutorial make sure to give credit to both sraeG and Deltron!


    P.S. Attached is a rar containing the page as it looked back when I took it, R.I.P. sraeG's blog.
    Ah we-a blaze the fyah, make it bun dem!

  2. The Following 33 Users Say Thank You to Hell_Demon For This Useful Post:

    Apokrif (07-29-2015),bloodeye161 (08-11-2013),Cambodia (08-26-2013),clubmixx (01-28-2014),crashburn0 (06-22-2015),Crasius (12-21-2012),ElgaGaming (02-22-2016),falzarex (04-21-2010),g0r1laz (09-08-2014),garriden (06-21-2015),Girlz Rule (05-06-2012),Grab (07-10-2012),gugel (09-01-2012),HackerPHC (08-11-2013),hilo peeps (06-24-2012),HUNK69 (02-29-2016),iPromise3 (01-20-2013),izwan jupining (01-04-2014),jackgm (10-11-2015),jokerskull123 (04-21-2010),Melodia (04-20-2010),mmt1994 (03-13-2014),nacalif (02-28-2013),NextGen1 (04-20-2010),nova0001 (08-05-2013),nubienub (01-14-2016),SaaaD (06-21-2012),TonyMane123 (08-13-2013),waynetay (01-13-2014),why06 (04-20-2010),xCyberxx (11-29-2013),Yakinican (10-01-2014),Zoom (04-20-2010)

  3. #2
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Thanks for sharing & giving credits. I will read soon!

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  4. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    A. WB HD

    B. Looks good, awesome


     


     


     



    The Most complete application MPGH will ever offer - 68%




  5. #4
    aLcohoL_95's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    SatyRicon
    Posts
    685
    Reputation
    8
    Thanks
    291
    My Mood
    Cynical
    thanx for sharing
    its awesome

    CANNIBAL CORPSE P0WNS


  6. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Read. Very good tutorial. Seems the aimbot tutorial is a requirement to read this, but the information about game coords was invaluable. Also I would like to say that the angle of the FOV is really arbitrary as long as the angles to ur targets are proportional to it...

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. need a tutorial for esp
    By bloqueado93 in forum Programming Tutorial Requests
    Replies: 2
    Last Post: 09-03-2008, 12:20 AM
  2. need ESP Help? In-Depth Tutorial
    By gudsoldier in forum Combat Arms Hacks & Cheats
    Replies: 16
    Last Post: 08-01-2008, 06:47 PM
  3. [Tutorial] How to find ESP address.
    By wr194t in forum WarRock - International Hacks
    Replies: 5
    Last Post: 12-20-2007, 03:42 PM
  4. Warrock Hack - Tutorial
    By Dave84311 in forum WarRock - International Hacks
    Replies: 667
    Last Post: 10-09-2007, 10:10 AM
  5. Photoshop Tutorials
    By Dave84311 in forum Art & Graphic Design
    Replies: 3
    Last Post: 12-31-2005, 07:21 AM