Floating frame-rate

This forum is currently in read-only mode.
  • I'm getting floating frame-rate on one of my projects I've been working on. The FPS in unlimited frame-rate mode would be around 80fps at start and after some time it will drop down to around 30fps and get back at 80fps after some period of time.

    The 80fps as max unlimited frame-rate is also worrying but I can get past it. (My machine runs at 3.0GHz with 2GB RAM, so I guess it's powerful enough to run at higher frame-rate than that.)

    I have found that removing positional audio and two groups of events improve frame-rate a bit (goes up to 100fps), but frame-rate was still floating. Removing particles didn't make any change and I make no use of effects.

    CAP-only ZIP (80KB):

    http://www.mediafire.com/download.php?wjignjjvtzj

    (when frame-rate drops? Do the following - go to the left, pick-up the gun located at top of the building, go to the right, keep going to the right and the frame-rate will drop at some point)

  • There's any number of reasons for a floating frame rate (background apps, etc), but I'm interested to know what people's thoughts are too. I have a new computer with barely anything on it except construct and a few graphics apps, yet a blank .cap at unlimited has the frame rate float anywhere from 1000-500fps. I know, I need a new graphics card. Part of it is aero, but even turning that off, tho it improves the frame rate, it still varies quite a bit.

    Edit: forgot to mention I get about 3000fps if I make a very very small app, so it shouldn't be any background processes using the cpu that are affecting it that much (and I tried to turn them all off).

  • Hi Arima,

    Thanks for your input.

    I think I'd be happy if my laptop (which I consider to be of average power) was giving me an empty CAP with a floating frame-rate between 1000fps-5000fps. Empty CAP on my laptop runs at fixed 432fps unlimited frame-rate.

    That's also a reason I think the floating frame-rate in my case is not solely caused by background processes. Further, I think the change from 100fps to 30fps is rather dramatic and seriously I have no idea what causes it.

    Anyone tried attached CAP? I tested it on several PC's, most of which were old 1.4-2.0 GHz PC's. The game is not playable on older 1.4GHz, but it's playable on high-end machines. Not sure how to optimize this.

    Cheers

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I tried the .cap and had a quick look at the events, I'm not sure what's causing it. The way to find out what causes a slowdown is to back up your .cap and delete things until the framerate jumps back up.

    My best guess is you use hundreds of sprites instead of a tiled background for the floor. You really really really really should use the tiled background objects instead of tiling hundreds of instances of sprite! With hundreds of sprites, every tick anything requesting a collision check (like the platform movement, which requires several every tick) has to iterate collision tests over hundreds of objects. With a tiled background, it makes one collision check, and then it's done the whole tiled background area.

    If it's not that, though, then you should try the removal approach.

  • Your best guess is actually the right one. Replacing just one layer of the floor (which consists of 313 sprites) improved frame-rate from 80fps to 160fps. I have no idea how I ignored the floor sprite tiling I've been doing.

    However, frame-rate still floats on my laptop, but it never goes below 60fps (which is my refresh rate), so that's fine. It might be completely due to my laptop, though; I recall having floating frame-rate problems with some commercial 3D games in the past. Will have to test this on other computers, now when the game runs at greater FPS.

    Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)