Results 1 to 8 of 8

Thread: Red Faction ESP

  1. #1
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Red Faction ESP

    I am making ESP for a game called Red Faction. It is a rather old game with no anti cheat. I have found player positions, hp, armor, and names so I can create some basic nametags. However, I am having trouble converting 3d coordinates to 2d coordinates. Normally when I do ESP I just use the D3DXVec3Project to do this. There is one problem though, the game never seems to call IDirect3DDevice8::SetTransform, IDirect3DDevice8::SetVertexShaderConstant, or IDirect3DDevice8::SetPixelShaderConstant so I cannot get the ViewMatrix. I have set breakpoints on these functions with olly and they never hit. I have also noticed that SetTexture is never called. Any help would be appreciated, also if anyone has any links to learning the necessary math to do this manually please do post them since I could likely find my yaw, pitch, roll, and fov.
    Last edited by zenma; 06-22-2009 at 02:41 PM.

  2. #2
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i dont know much about red faction, but this may be a tricky job. i think what you need to do is find the distance from your character to the object.

    i would start off by drawing a line from where the character is to the person on the 2d screen

    http://img70.imageshack.us/img70/2511/redfaction.jpg

    when drawing the line your trial and error process will take less time. your going to need some sort of function that will alter the 2d line based on the distance and direction in 3d space

    http://img81.imageshack.us/img81/2511/redfaction.jpg

    imagine the green square is your viewport and the blue ball is something you see on the screen. the vector from the center of your character to the center of the npc will be very important. perhaps you could post some pics with coords of you and the npc your trying to use and me, or someone else can help. we would need your coords the npc coords and a picture to get an idea
    Last edited by rogue poser; 06-26-2009 at 04:08 AM.

  3. #3
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heres a screeny http://img195.imageshack.us/img195/7720/screenyi.png. I'm TYP3CA5T and I'm trying to draw a nametag over Zanghfei. The name in blue is present when your crosshair is over someone.
    Last edited by zenma; 06-27-2009 at 08:30 AM.

  4. #4
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay so the blue name is part of the game and you want to simulate that. is there a way for you to get the direction your facing? like a compass or something?

    what im thinking is...

    1.(done) we have to find out how far away the other person is in vector form
    2.(not done) find out your orientation around the Z axis
    3.(not done) get a general idea of how many degrees are in your peripheral vision (probably like 120)

    with these three pieces of information, we can pretend your position is 0(because to you it kinda is), find the vector from you to the person whos name you want (step 1). If that person is in your line of sight, determine in degrees where they would be on the screen, in relation to a vector that we would draw going from the center of you to for example, where a bullet would go(2&3)

    now if we can find out these things, we could position a name above an opponent.

    the green line is the hypothetical vector, forgot to mark it




    after getting it to work in 2d space like above, you can have a name that is in the correct spot, only the Z positioning would be wrong, so a simple addition to the Y coord(2d screen) based on the distance away in the XY plane(3 space in the game), and the raise in level on the Z plain would give you a pretty darn accurate position of the name.


    hell, while your at it, you might as well make a mini map, because all the math would be done you just need to display it to the screen.

    OR!!!!!!

    just had an epiphany,

    find out what variable in memory is changed when you rest you crosshairs on the opponent, and make your program manually change it in memory, so all names are always visible, because the game will already do all the math for line of sight for you, so instead of doing it yourself, just find that address and change it?
    Last edited by rogue poser; 06-27-2009 at 11:12 AM.

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    By the way, the FOV looks like it's 90. Most likely is ;]

  6. #6
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just wanted to add a bit more if you cant find those variables

    [img=http://img20.imageshack.us/img20/8328/67258786.jpg]

    we would use our green vector from before to find out if the angle between that one and the red one in this image is greater than 45 or less than -45 (FOV? assuming its 90 degrees) lets call the angle A

    if ((A >= -45) && (A<= 45))

    we need to use this angle to paint the enemies name, on the XY plane of the screen at this angle. in addition we need to move that name along that degree, further away or closer, based on the distance from you the enemy is.

    [img=http://img33.imageshack.us/img33/9012/21146391x.jpg]

    hopefully thats some help

  7. #7
    Join Date
    Jun 2007
    Posts
    246
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogue poser View Post
    okay so the blue name is part of the game and you want to simulate that. is there a way for you to get the direction your facing? like a compass or something?

    what im thinking is...

    1.(done) we have to find out how far away the other person is in vector form
    2.(not done) find out your orientation around the Z axis
    3.(not done) get a general idea of how many degrees are in your peripheral vision (probably like 120)

    with these three pieces of information, we can pretend your position is 0(because to you it kinda is), find the vector from you to the person whos name you want (step 1). If that person is in your line of sight, determine in degrees where they would be on the screen, in relation to a vector that we would draw going from the center of you to for example, where a bullet would go(2&3)

    now if we can find out these things, we could position a name above an opponent.

    the green line is the hypothetical vector, forgot to mark it




    after getting it to work in 2d space like above, you can have a name that is in the correct spot, only the Z positioning would be wrong, so a simple addition to the Y coord(2d screen) based on the distance away in the XY plane(3 space in the game), and the raise in level on the Z plain would give you a pretty darn accurate position of the name.


    hell, while your at it, you might as well make a mini map, because all the math would be done you just need to display it to the screen.

    OR!!!!!!

    just had an epiphany,

    find out what variable in memory is changed when you rest you crosshairs on the opponent, and make your program manually change it in memory, so all names are always visible, because the game will already do all the math for line of sight for you, so instead of doing it yourself, just find that address and change it?
    Thanks for your help, I'll try all of this in a day or two when I have time. I'll try to find my yaw and pitch too so I can finish this. According to the tables in the game the fov is 180 but I'll try both 90 and 180 anyways. I thought about what you said and making them always visible. I couldn't get it to work but even if I did they would all draw in the center and it would just be a mess. Values probably stored temporarily in registers

  8. #8
    Join Date
    Feb 2007
    Posts
    143
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zenma View Post
    Thanks for your help, I'll try all of this in a day or two when I have time. I'll try to find my yaw and pitch too so I can finish this. According to the tables in the game the fov is 180 but I'll try both 90 and 180 anyways. I thought about what you said and making them always visible. I couldn't get it to work but even if I did they would all draw in the center and it would just be a mess. Values probably stored temporarily in registers
    well if you could find the values, you could choose to turn on their name if they are a certain distance away. It would be much easier than doing it all yourself.

    then again, the challenge of doing it all yourself would be fun, and pretty rewarding

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •