Frame lag problems in my game
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 :(
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.
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement