• Advertisement
Sign in to follow this  

My Computer or the Code?

This topic is 4606 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
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
it was for sure the particles that were slowing it down...... this version is fine..

Share this post


Link to post
Share on other sites
Well, I believe there was also a problem in the renderer - something not related to the particles.

Oddly enough, one of my friends just tried it out and explained the exact same problem CodeMonger had......only he was using the new version.

So I have no idea if his problem is related or not.

Share this post


Link to post
Share on other sites
Hey you know what's funky is that if you keep the guy at the begining of the level and jump holding up and left arrow key , you seem to land in mid air (instead of falling to ground), around the height of the second platform level .. aslo you can jump higher again doing the same thing.

Share this post


Link to post
Share on other sites
Ah, crap :)

Yeah I see that now - there are still some problems with the state graph / collision detection systems.

Thanks for pointing that out though.

Share this post


Link to post
Share on other sites
I've got 60 fps on an Athlon xp 2800+ with a GeforceFX 5600 and 256 MB ddr400
The fx5600 sux I know... :p But at least it's slightly fast.

Share this post


Link to post
Share on other sites
Why would it work well on some computers/video cards and not others?

I know extensions could cause something like that, but I don't use any in that program.

Any ideas?

Share this post


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

  • Advertisement