Simple game with timing issues atm

This is a discussion on Simple game with timing issues atm within the Game Programming forums, part of the General Programming Boards category; I've written a simple 2D game (its a scrolling shooter that uses allegro), although ive got a few timing problems. ...

  1. #1
    Registered User Swarvy's Avatar
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    195

    Question Simple game with timing issues atm

    I've written a simple 2D game (its a scrolling shooter that uses allegro), although ive got a few timing problems. On vista, the game apparently runs way too quick (i say apparently cos i havent seen this myself, just what ive been told from friends), but on other systems (XP systems), it either runs fine, or too slow (I think that the structure of the program makes the game quite CPU intensive - for each enemy ship, laser beam etc it generates a new object and saves a pointer to that object in a vector). Anyway, I've given the main elements of the source code of the game, havent given all of it, because that would be completely unnecessary (the game is still a work in progress, but I plan to post the full source code, and if possible, any binaries and resources in the game sticky on here when its done), but I was hoping that someone could just give me some tips about how I can get it to run faster on low end machines, and how to get the timing more regular across different OS types.
    Attached Files Attached Files
    Last edited by Swarvy; 08-06-2009 at 01:14 PM.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Everything should move based on a time delta that you calculate per frame. QueryPerformanceCounter() and QueryPerformanceFrequency() should do the trick on Windows platforms.

    There is a bug on AMD multi-cores with these functions but it should be fixed as of SP2 and certainly by SP3.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2D RPG Online Game Project. 30% Complete. To be released and marketed.
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 10-28-2006, 12:48 AM
  2. Open GL - glTranslate + Game Timing
    By Tonto in forum Game Programming
    Replies: 9
    Last Post: 10-24-2006, 03:20 AM
  3. Major game issues
    By VOX in forum Game Programming
    Replies: 0
    Last Post: 01-18-2005, 07:40 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Simple driving game
    By VirtualAce in forum Game Programming
    Replies: 6
    Last Post: 07-06-2004, 09:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21