Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Sneak84's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    18

    PTC and FPS problems

    Hello. Problem is that if i call PTC in Present i expirience a huge FPS lags. If i add a lot features my FPS becomes less than 15, but normally (without PTC but with menu and hooked dip for wallhack/chams) i have ~80-90! If i add more than 4 features game becomes unplayable.

    Here is the PTC function that i use:
    Code:
    void PushToConsole( const char* Command )
    {
        DWORD *Adress = ( DWORD* ) LTClientEXE;
    
        if ( *(BYTE *) GameStatus ) 
        {
            __asm
            {
                PUSHAD;
                PUSH Command
                CALL Adress
                ADD ESP, 0x4
                POPAD;
            }
        }
    }
    Code:
    HRESULT WINAPI myPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d)
    {
        // call menu and other shit
    
        if ( NxChams )
        PushToConsole("SkelModelStencil 1.0");
        else
        PushToConsole("SkelModelStencil 0.0");
    
        if ( Fog )
        PushToConsole("FogEnable 1.0");
        else
        PushToConsole("FogEnable 0.0");
    
        if ( Fullbright )
        PushToConsole("FullBright 1");
        else
        PushToConsole("FullBright 0");
    
        return pPresent(pDevice, a, b, c, d);
    }
    With this now i got ~30-35 from normally 90! Also i tried Nightmare's hotkeys base that hook Present but doesn't do any drawing on the screen and still have a performance issues. It is possible to use PTC and have a normal gameplay with the same time? Maybe it's possible to call it in another d3d function which doesn't works so slowly but doesn't have an ideas which one is better or maybe other ideas i'll be very glad if you help here a little.
    Last edited by Sneak84; 10-20-2012 at 12:34 PM.

  2. #2
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    414
    Reputation
    9
    Thanks
    329
    My Mood
    Twisted
    if it's something like:
    Code:
    while(true = true){ // creates the loop of course
    if ( NxChams )
        PushToConsole("SkelModelStencil 1.0");
        else
        PushToConsole("SkelModelStencil 0.0");
    
        if ( Fog )
        PushToConsole("FogEnable 1.0");
        else
        PushToConsole("FogEnable 0.0");
    
        if ( Fullbright )
        PushToConsole("FullBright 1");
        else
        PushToConsole("FullBright 0");
    }
    Your issue would be that it's reapplying code millions of time.

    Also inside of PTC you should have
    Code:
    sleep(50);
    Spares the cpu a bit.

    Someone more experienced please correct me here if i'm wrong.

  3. The Following User Says Thank You to LilGho$t For This Useful Post:

    Sneak84 (10-21-2012)

  4. #3
    Sneak84's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    18
    Quote Originally Posted by LilGho$t View Post
    if it's something like:
    Code:
    while(true = true){ // creates the loop of course
    if ( NxChams )
        PushToConsole("SkelModelStencil 1.0");
        else
        PushToConsole("SkelModelStencil 0.0");
    
        if ( Fog )
        PushToConsole("FogEnable 1.0");
        else
        PushToConsole("FogEnable 0.0");
    
        if ( Fullbright )
        PushToConsole("FullBright 1");
        else
        PushToConsole("FullBright 0");
    }
    Your issue would be that it's reapplying code millions of time.

    Also inside of PTC you should have
    Code:
    sleep(50);
    Spares the cpu a bit.

    Someone more experienced please correct me here if i'm wrong.
    lol, thanks for trying to help, but i call PTC inside present function and if i add while{}/sleep() game will be fucked. don't know what to do, looks like serious trouble.

  5. #4
    Shadow`'s Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    MN
    Posts
    643
    Reputation
    74
    Thanks
    2,999
    My Mood
    Relaxed
    Quote Originally Posted by Sneak84 View Post
    lol, thanks for trying to help, but i call PTC inside present function and if i add while{}/sleep() game will be fucked. don't know what to do, looks like serious trouble.
    Your console commands are being activated repeatedly, causing lag. Have it enable once when activated, not every frame. You also won't need the while(true) if it's in your present.
    Last edited by Shadow`; 10-21-2012 at 08:23 PM.
    Currently coding applications in Java and C++.

    "It is change, continuing change, inevitable change, that is the dominant factor in society today. No sensible decision can be made any longer without taking into account not only the world as it is, but the world as it will be." -Isaac Asimov

  6. #5
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    414
    Reputation
    9
    Thanks
    329
    My Mood
    Twisted
    Quote Originally Posted by Shadow` View Post
    Your console commands are being activated repeatedly, causing lag. Have it enable once when activated, not every frame. You also won't need the while(true) if it's in your present.
    ^ this ^
    However i didn't know about it being in present xD

    anyways, as a general rule of thumb (at least what i do) is:
    Code:
    void PushToConsole( const char* Command )
    {
        DWORD *Adress = ( DWORD* ) LTClientEXE;
    
        if ( *(BYTE *) GameStatus ) 
        {
            __asm
            {
                PUSHAD;
                PUSH Command
                CALL Adress
                ADD ESP, 0x4
                POPAD;
                sleep(50); // spares le cpu
            }
        }
    }

  7. #6
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    524
    Reputation
    151
    Thanks
    1,887
    My Mood
    Amused
    Quote Originally Posted by LilGho$t View Post
    ^ this ^
    However i didn't know about it being in present xD

    anyways, as a general rule of thumb (at least what i do) is:
    Code:
    void PushToConsole( const char* Command )
    {
        DWORD *Adress = ( DWORD* ) LTClientEXE;
    
        if ( *(BYTE *) GameStatus ) 
        {
            __asm
            {
                PUSHAD;
                PUSH Command
                CALL Adress
                ADD ESP, 0x4
                POPAD;
                sleep(50); // spares le cpu
            }
        }
    }
    That will barely help, it's still rendering the ptc command every frame, just create a timer where you call the ptc hacks and you're set. Or do what @Shadow` said, enable it only once when activated.
    Reversing is the only way to move forward.

  8. #7
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    414
    Reputation
    9
    Thanks
    329
    My Mood
    Twisted
    Quote Originally Posted by arun823 View Post
    That will barely help, it's still rendering the ptc command every frame, just create a timer where you call the ptc hacks and you're set. Or do what @Shadow` said, enable it only once when activated.
    Issue with enabling it each time and never pushing it again is that some ptc commands (fog for example) disable themselves after a while.

  9. #8
    arun823's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Los Angeles, California
    Posts
    524
    Reputation
    151
    Thanks
    1,887
    My Mood
    Amused
    Quote Originally Posted by LilGho$t View Post
    Issue with enabling it each time and never pushing it again is that some ptc commands (fog for example) disable themselves after a while.
    Never experienced that, then use a timer if all else fails.
    Reversing is the only way to move forward.

  10. #9
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    818
    Reputation
    125
    Thanks
    1,785
    My Mood
    Doh
    Inc(iCounter)

    if iCounter > 20000 then
    begin
    do your hacks
    iCounter:= 0
    end
    DJector.Lite
    Get the advantages of new injection technology, with 1 click easy to use injector, work for all platforms x86/x64

    Download

    D-Jector
    Get the most advanced and full featured injector around, works for any game and any platform x86/x64, nothing comes even close.
    Download

  11. #10
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    414
    Reputation
    9
    Thanks
    329
    My Mood
    Twisted
    Quote Originally Posted by arun823 View Post
    Never experienced that, then use a timer if all else fails.
    I haven't coded for ca in a few months so that might have changed but back when i was coding you occasionally had to reapply every so often.

  12. #11
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,693
    Reputation
    3319
    Thanks
    11,105
    My Mood
    Happy
    Don't call Sleep in your present

    It'll just make it lag more. Either call each item only once and push the command once, or just call it all in a timer.

    Either of those are better.


    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  13. #12
    LilGho$t's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    414
    Reputation
    9
    Thanks
    329
    My Mood
    Twisted
    Quote Originally Posted by Flengo View Post
    Don't call Sleep in your present

    It'll just make it lag more. Either call each item only once and push the command once, or just call it all in a timer.

    Either of those are better.
    of course you wouldn't call sleep in your present xD that'd make shit so laggy because it'd be sleeping like 50 ms, normal for maybe 3 then sleeping again. I just recommend putting sleep in the ptc method.

  14. #13
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,693
    Reputation
    3319
    Thanks
    11,105
    My Mood
    Happy
    Quote Originally Posted by LilGho$t View Post
    of course you wouldn't call sleep in your present xD that'd make shit so laggy because it'd be sleeping like 50 ms, normal for maybe 3 then sleeping again. I just recommend putting sleep in the ptc method.
    Sleep in that sense will delay each frame by whatever your ms input was.


    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  15. #14
    supremejean's Avatar
    Join Date
    Jun 2012
    Gender
    female
    Posts
    32
    Reputation
    10
    Thanks
    8
    bool Hack=false;
    bool bHack=false;

    if( Hack && !bHack ){
    CommandOn;
    bHack=true;}
    else if( !Hack && bHack ){
    CommandOff;
    bHack=false;}

  16. #15
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    818
    Reputation
    125
    Thanks
    1,785
    My Mood
    Doh
    i gave you then simple answer, have a counter which increases each time present is called when the counter reaches a given value then parse the hacks, also when you turn a hack on set the global counter to above given value making it parse the hacks in the next present call... couldn't be any easier... and no sleep functions ect.. I never ran any hacks in present when i was coding, I always used a separate thread ..
    DJector.Lite
    Get the advantages of new injection technology, with 1 click easy to use injector, work for all platforms x86/x64

    Download

    D-Jector
    Get the most advanced and full featured injector around, works for any game and any platform x86/x64, nothing comes even close.
    Download

  17. The Following User Says Thank You to Departure For This Useful Post:

    [MPGH]Genesis (06-30-2013)

Page 1 of 2 12 LastLast

Similar Threads

  1. Low FPS Problem
    By Barcode in forum Combat Arms Help
    Replies: 6
    Last Post: 10-31-2011, 07:50 AM
  2. Hack works for 1 game and dll problem
    By Chicco in forum Combat Arms Hacks & Cheats
    Replies: 22
    Last Post: 05-23-2009, 01:51 AM
  3. Replies: 44
    Last Post: 09-17-2008, 08:56 PM
  4. [HELP] BF2 and vb6 problem
    By herowarz in forum Battlefield 2 Hacks & Cheats
    Replies: 5
    Last Post: 03-29-2008, 10:34 AM
  5. IRCD and WEB Problems
    By Dave84311 in forum News & Announcements
    Replies: 0
    Last Post: 02-18-2007, 06:53 PM