Jump to content
  • Advertisement
Sign in to follow this  
zealotgi

Frame lag problems in my game

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :(

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
there may be something wrong with the loop perhaps. can you show us your engine itself?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!