Jump to content
  • Advertisement
Sign in to follow this  
shane1985

My Computer or the Code?

This topic is 4787 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'm working on a side scroller, and am running into some problems. I just added a parallax scroll effect for the background layer, but it seems like it's not running well. I'm almost positive that it's the code, but can't for the life of me figure out what's going on. Here's a download of the game. Use the arrow keys to move, space to jump, and F1 to exit (left shift also fires, but you don't really need that) Anyway, when I'm playing the game, it regularly skips, and the framerate drops to somewhere in the mid 50s. Also, the background layer scrolls fine most of the time, but every once in a while it looks like it vibrating. Does anyone else experience these problems with it? Also, since I'm assuming that you will, does anyone have any ideas about what the problem could be? Thanks! -Shane

Share this post


Link to post
Share on other sites
Advertisement
Are you using double buffering?
did you take measures to keep a steady motion regardless of frame rate?

it may also be V-Sync issues.

Share this post


Link to post
Share on other sites
its a good start..

The background scrolls fine its runs at a steady 61 fps for me that is until I shoot something and the explsion effect happpens it will drop to about 27 fps and thats nice an chopy .

im on a:
pentium4 2.4ghz
ATI 9700 pro

Share this post


Link to post
Share on other sites
Yep, it's written in OpenGL, and I use OGL's double buffering mechanisms.
Also, I have taken measures to keep it steady.
I was referring to this article to implement some of these ideas.

Share this post


Link to post
Share on other sites
Well, I figured out that the scrolling issue was definitely caused by forgetting to turn Vsync on, so it must have been tearing.

As for the major slowdowns with the particle effects, I don't know why it would drop to 27 fps, especially on your computer, which is faster than mine.

On my computer I don't really have any problems with the particle effects specifically; it's more just running around where I get intermittent skips.

Share this post


Link to post
Share on other sites
Is it using the extension ARB_point_sprite ? I've heard of it causing some pretty nasty slowdowns on ATI cards.

Share this post


Link to post
Share on other sites
I don't think its a problem with opengl .. mine crawls to a halt .. its more than likely your game code, do you have some long running loops staling the frame rate ? are you creating destroying and destroying objects every frame ? the slow downs do not seem graphically related by any means , only because the drop in framerate seems linear, like a bad memory leak.

Also on another note, I don't understand how you could go that far writing a game and not noticing a problem that big ? That baffles me, seems to be a common recurring theme on this board.

Share this post


Link to post
Share on other sites
Well, first of all - try this version.

I removed the particle effects here, and fixed another problem that I found.
Also, it works better if Vsync is enabled (I'll have to add that in my game code then).

Btw, the problem only recently started to occur in this magnitude and I believe I have already solved the one you are alluding to. My question was mainly aimed at the momentary skips which have occurred throughout development.

<Edit>
Does anyone have any suggestions about how to better render the particle effects? Right now they are just textured quads with no optimizations whatsoever.

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!