Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 45

Thread: DELPHIX Problems. Need help with multiple problems

  1. #11

    DELPHIX Problems. Need help with multiple problems

    Yeah the problem is that my player sprites are moving around the screen fast, I tried 60 fps but the movement is jittery... and then with vsync we have the problem of it refreshing at monitors rate and I have yet to fully understand how I can achieve time based movement when I have a timer that is constantly changing depending on ppls monitor refreshes I will send you a small sample of what I mean, you will probably then be able to tell me if I have done something wrong?

    Your help has been great btw.

    I have looked at queryperformancecounter. Is this the best way of making my own timer? What is the best way for compatibility, reliabilty and speed?

    TEST TO SEE SPRITE JITTER: http://www.uploading.com/?get=5TJ8Y0P0

    Above is a file/source that I have quickly put together to demonstrate the jitter at 60 fps. This is the maximum speed the the sprite roams the screen but the jitter is unnacceptable. Maybe I have done something wrong?

    -----
    edit: actually moving on I have devised a nice way to get around this. I can just say Player1.x:=Player1.x + (1/Refresh rate of monitor) * 600 (where 600 is the amount of pixels to be moved a second).

    This should mean the speeds involved when vsync is ON will always be the same does it not?

  2. #12

    DELPHIX Problems. Need help with multiple problems

    I've tested your game, but it apears to move as it should and without jittering. (Though extremely fast)

    The movement of sprites has nothing to do with refreshrates. Only with time.
    Code:
    at game start up, get time
    while your game is running 
    begin
      calculate elapsed time for current frame 
      save newly retrieved frametime
    
      Player1.x:= Player1.x * elapsed time
    end;
    This way it does not make a difference if someone is using 60hz, 85 or 100. Nor does it matter if a user has a 3ghz or a 700mhz processor. His sprite will always move at the same speed.

  3. #13

    DELPHIX Problems. Need help with multiple problems

    Thanks for all your help, sorry for being such a nuisance I gave that test prog to my firnd and cousin, they say it runs like a broken pocket watch so I can only assume your successs with it is because you are using non XP or an NT based machine.

    Regardless your help has been invaluble, thanks. And you prob aint seen the last of me yet

  4. #14

    DELPHIX Problems. Need help with multiple problems

    Thanks for all your help
    No problem

    I gave that test prog to my firnd and cousin, they say it runs like a broken pocket watch so I can only assume your successs with it is because you are using non XP or an NT based machine.
    I am running xp sp 1, on a 3ghz pc with 1gig ram and a gforce 6800gt 256mb gfx card

  5. #15

    DELPHIX Problems. Need help with multiple problems

    Quote Originally Posted by Traveler
    Thanks for all your help
    No problem

    I gave that test prog to my firnd and cousin, they say it runs like a broken pocket watch so I can only assume your successs with it is because you are using non XP or an NT based machine.
    I am running xp sp 1, on a 3ghz pc with 1gig ram and a gforce 6800gt 256mb gfx card
    Then must be something else..something I am missing Is yours based on NT technology? (not sure if xp can be, i remember win2000 being nt or not).

    Something weird with them timers but doesnt matter now cause its staying on realtime from now on Envious of your G.card I am getting the 6600GT 256 AGP 8* soon It is the thing I really need updating hardware wise At moment I am still using a geforce 2 MMX 400 64MB

  6. #16

    DELPHIX Problems. Need help with multiple problems

    The demo as is runs at 32FPS

    XP 3Ghz, Nvidia 7800GS.

    Get rid of the interval and I get about 2400 FPS

    Getting rid of the dxtimer interval (set to 17) and setting option dowaitvblank. Made it the demo very smooth (85 FPS) - but way to fast.

    I never liked the sprite engine. I have always made my own. Much more control.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  7. #17

    DELPHIX Problems. Need help with multiple problems

    Then must be something else..something I am missing Is yours based on NT technology? (not sure if xp can be, i remember win2000 being nt or not).
    XP is nt based.

    Perhaps your gfx card drivers are the problem. I remember a couple threads about slowdowns due to an nvidia driver update. That was a couple months ago so it might not be relevant, but then, you never know.

  8. #18

    DELPHIX Problems. Need help with multiple problems

    I would believe that was the cause except that it runs way lower than 60 fps (when set to 17 interval) on my cousins and mates machines, 1 of which uses a radeon 9200 .

    I have no idea why it would happen but I have ruled out the problem occuring within delphi becasue you recompiled and sent me back the exe. Its very strange. Not just the dxtimer as said...all threaded ones like the one by carlos barbosa.

    While I am here though, How do I centre text taht is written on dxdraw.surface.canvas?

    When I want to centre labels I just say

    MainFm.Points_Label.left:=(mainFm.width-MainFm.Points_Label.width) div 2;

    I was wondering weather there is an equivelent? I notice TextWidth but it isnt the actual pixel width just the no. of chars?

  9. #19

    DELPHIX Problems. Need help with multiple problems

    I was wondering weather there is an equivelent? I notice TextWidth but it isnt the actual pixel width just the no. of chars?
    Not that I know of. You can't easily calculate the lenght of the text unless you take specific fonttypes, like courier (new), where you know the length of each character is always the same.

  10. #20

    DELPHIX Problems. Need help with multiple problems

    I was wrong! textWidth does give its precise pixel length so now I just say

    ((Dxdraw1.width div 2) - (textwidth(Player2Name+': '+inttostr( points2 ) ) div 2) etc nice.

    That avatar of yours is freaking me out by the way

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

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