Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Timer trouble. need your help people. Test time

  1. #1

    Timer trouble. need your help people. Test time

    I have posted about this topic already, and ina few weeks I get a new G.card so hopefully this problem will go away.

    Dxtimer and all threaded timers are running at weird framerates. Here is a sample

    Interval of 0: realtime (only 1 that actually works)

    interval of 1-10: 64 FPS and not 1000-100, interval 11-20: 40FPS for entire range.

    On other machies the above values follow exact same pattern but the values start off different. i.e. 1-10: 92 FPS, 11-20 52FPS ....

    Weirder still, if I open dxdiag test page, it somehow rectifie the bug and the timer then runs at correct speed, after closing the page, back we go to ludicrous frame rate.

    The bug is also not present when delphi is actually loaded. If it is shut down, the exe does not run properly.

    I did not have this problem when i was using win 2000, only now that i use XP do i get the problem.

    Maybe it is a fault of my graphics card, without another system to compile the exe i have made it is impossible to conclude anything.

    This is where you lot come in. I have uploaded a test exe. I need some of you to download it, run the exe, record what speeds you are getting from it. I have set the interval to 1. If your system is playing it correctly the frame rate will be around 1000. On mine it is 64.

    Then, I need you to recompile the source code that is with the exe. upload the NEW exe that has been compiled by YOUR system. Make sure the exe has all files needed to run on ANY computer (travellers last exe only runs on computers with certain needed files...maybe something taken away at runtime?)

    Anyway, here is the file and souce code:


    http://www.uploading.com/?get=9I7D9Q66

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Timer trouble. need your help people. Test time

    Do you have a dual core or Hyperthreaded processor? I have heard of problems with timers on these processors. The normal GetTickCount apparantly runs reliably but the more detailed timers do not.

    I dont have a fix for it as I always use GetTickCount.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #3

    Timer trouble. need your help people. Test time

    Yea, you're almost always better off just using GetTickCount or QueryPerformanceCounter, but I dont know how accurate/fast/stable that is...
    My site: DelphiTuts.com (coming soon)...

    Download Font Studio 4.21 here.

  4. #4

    Timer trouble. need your help people. Test time

    well, tried that but doesn't seem to good for me with delphix. I mean, I should be able to use dxtimer. If this is an issue at compile time, there isnt a problem. If it is an issue depending on computer then we have a serious problem with people using the dxtimer

    I have a hyper threaded machine, but it is turned off, it still did it even when I was using a normal AMD athlon....so that isn't the problem. It is something to do with directx and XP...maybe also my g.card.

    Why would it work properly if delphi is running or dxdiag loaded up....its very strange?

    Any of you downloaded that program to see if it runs right on your system?

  5. #5

    Timer trouble. need your help people. Test time

    The problem is almost definately because of XP.

    I have now changed graphic cardand type, motherboard, processor...to cut it short everything. SP2 did not correct ther problem either.

    Someone needs to look into this properly because Windows 2000 has no such problems., I installed 2000 before installing xp again. 2000 runs with NO problems. The timers run correct, the idle loops and thus game run at the correct speed.

    The real weird thing is that if I am using an idle loop or realtime the problem STILL persists. something still makes the loop execute at less than 60 FPS (around 32 half of it)

    It is almost as if the timer problem is duplicated in other areas as well such as drawing in delphix.

    Whatever it is, someone needs to look hard at delphi, delphix because something is amiss here with xp for certain.

  6. #6

    Timer trouble. need your help people. Test time

    Well been hard at work trying to fully understand this. It turns out XP is not the problem so that only leaves Directx V 9 which I will check.

    I have changed: Motherboard, CPU, G Card, memory, OS, delphix , undelphix version. delphi version (from 4 to 7), service packs.

    Infact I have changed everything and still...timers running wrong, game running wrong EVEN in idleloops.

    It is a most bizarre thing and the only thing it can now possibly be is DX9.

    Opening Dxdiag in the background as I have said for 1 bizarre reason or another makes the game run correctly and all timers run correctly. I can hardly ask my user to do that every time they want to play the game right

    I will check DX7 and see what happens.

    edit:

    Win2000 with directx 7 didn't solve anything. Same thing. So something even more wrong than I first thought.

    I will now go back to win98 and test that but if all you guys have 0 probs, then I am stuck! I mean what the hell could it be? My monitor? That is thew only thing left to change!

  7. #7

    Timer trouble. need your help people. Test time

    ummm, I don't really know about the problem, but what I've seen the strange timer runnings was the Windows Timer... That thing has 64FPS, 32FPS, etc. Maybe there's a Windows Timer running there instead of a DXTimer somehow?

    Oh, yea, and vSync would only try to cap the FPS at standard vSync values, like 60, 70, 75, 85, 100, 120, 160. Don't think the "monitor" could interfere with the FPS in any diff way

  8. #8

    Timer trouble. need your help people. Test time

    DELETE THIS THREAD

  9. #9

    Timer trouble. need your help people. Test time

    The download link didn't work for me.

    But to me it sounds like you have a computer with two processors and your timer code is using something like RDTSC. When you have more than 1 app running, I guess WinXP will assign each to a single processor, but when your game is alone, but processors are used. The RDTSC uses the processor's time counter which could be different on each processor.

  10. #10

    Timer trouble. need your help people. Test time

    Bumped into an invalid link.

    I can say Hyper threaded processors have no problems with timers, or at least none that I have ever noticed.

    I doubt dual core cpus would have any problems either. I would like to see your code. Have you tried your code on any one else's machine?

    I doubt there is a fundamental error in timers so I suspect it is yourcode that may be to blame or your particular computer. Do you have problems running other games?
    The views expressed on this programme are bloody good ones. - Fred Dagg

Page 1 of 2 12 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
  •