Frame lag problems in my game

Started by
4 comments, last by ursus 18 years, 11 months ago
I am programming a game in DirectX, and I am having a huge problem. For every about 20 lines of code I add, the framerate goes down about 3 FPS. I realize that the problem is that my algorithms aren't right, and right now, I have everything packed into the main gameframe loop. How exactly do professional programmers layout the games workings? I need suggestions for new algorithms... Thanks Edit: Forgot to mention...its a 2D game using 1 loaded bitmap (now you know how bad the problem is :(
---------------------------------The Shadow Sun - Want Your Writing Exposed?
Advertisement
Other than the following, there is not much you can do.
Remove all blank lines and comments from your code.
Put multiple statements on a single line.
Remove all whitespace from your code.
Use shorter variable names.















Just kidding.
Wow. had me going for a second AP.. haha

zealotgi, I suspect you may be freaking out over nothing. It sounds like you're working on a small project that, at this point, probably runs at an insane FPS 400-500+. You must understand that a drop in 3 FPS is extremely deceiving as it is non-linear. If you have a 3 FPS drop from 500 to 497 FPS, the amount of *actual* time that is spent computing is only one one-hundreth of a MILLISECOND longer.

Compare this to a drop from 60 FPS to 57 FPS. This is a difference of 1.5 milliseconds. Much much larger.

Hope this helps
there is a nice article by Robert Dunlop on this topic. you can find it here
Actually, it is a small demo, that i'm only getting 22 FPS out of, and it runs really choppy. Heres my specs, if it helps...

Windows XP Home Edition
2.4 GHZ
64 MB VRAM
512 MB RAM
Using Jim Adams Game Core from "Programming Role Playing Games" Book

I don't know, but it may be that the latter is the problem. I don't know how many of you have read this book, but for those of you who did, is this Game Core similar to professional Game Cores? If not, i'll be forced to look at Carmack's Q2 source :D
---------------------------------The Shadow Sun - Want Your Writing Exposed?
there may be something wrong with the loop perhaps. can you show us your engine itself?

This topic is closed to new replies.

Advertisement