Results 1 to 8 of 8

Thread: (Help! ^^ ) Fluide game if under 60 fps

  1. #1

    Exclamation (Help! ^^ ) Fluide game if under 60 fps

    Hello guys ^^

    I'm posting here because i'm currently developping a game named Dark Devotion that you can see here.

    The thing is that the game has tons of graphics and these graphics are stocked in video card RAM which makes the game FPS issue.

    For instance, laptops with gtx 960m have the game running at 45-50 fps.

    For most of my calculs I use : * ( 60 / FrameRate ) but it doesn't work with everyone and does not look really smooth...

    With low fps some things simply do not happen (hero may not touch enemy and much more...)

    My code has already been reviewed and seems pretty clean but each scene counts about 900 objects at the same time + 1100Mo of memory use.

    So i'm desperatly looking for a way to have the game running cleanly if under 60 fps.

    Thanks if you can ever help

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Heavy VRAM usage typically doesn't slow games down much, unless it maxes out the VRAM of the graphics card (if that happens, the framerate usually drops severely). At least that's usually the case with AAA games, in my experience. Perhaps Fusion games may behave differently.

    How much of that 1100mb is being stored in VRAM (as opposed to RAM) - Do you know? Either way, it shouldn't make much difference, since the 960M has 4gb, I believe, which is more than enough.

    It could be something else that is causing the bulk of the slowdown, such as fastloops, overlap checks or shaders. Have you tested to see where the most slowdown comes from? Test on the laptop with various parts of your game disabled and see what makes the most difference.

    Also, What is the CPU usage while the game is running (and how many cores does the CPU have?)

    I started a thread recently to collect some information about optimisation techniques. That might help you with general optimisation:

    It sounds like you should probably change some of your movement code though, to make it less dependent on framerate. If your game is breaking at 45fps, then that's a serious problem. No matter how well you optimise the game, someone is going to play it on a weak PC, and for them it's going to break.

    Are you using fastloop movement? If not, then perhaps you should look into it. With fastloop movement, you can make things move one pixel at a time, no matter the framerate. If the framerate is lower, and you need to move something 3 pixels, then you simply have to repeat the fastloop 3 times, but it's still one pixel per loop. And you can do an overlap check on each loop (ie. Move 1 pixel, check for overlap, move 1 more pixel, check for overlap, etc.) , which means that - in theory at least - your collisions will always register correctly, no matter how fast the player is moving.

  3. #3
    Its also worth noting that if you have the actives "inactivate if too far from window" is set to no it could affect the performance. The down side of setting yes is that you will have issues evaluating them when they are off screen.

    I did trial something which helped slightly when I had 1000's of actives set to "inactivate if too far from window" "no" I made the objects invisible when outside the bounds of the screen. However this only helped slightly (but maybe will help if the actives are large). Where as setting "inactivate if too far from window" to "yes" removed all slow down completely.

  4. #4

    Thanks a lot for your replies !

    @Volnaiskra :

    I do not know how to check the use of RAM, I already looked for a software to do so but wasn't able to find one :/ May try to check again.

    For the CPU it uses between 11 to 13% on my Intel Core i3 6100 3.7ghz.

    Code size, I tried to reduce at the maximum the loops and the code has already been reviewed, on PC that runs at 40fps, i can gain about 3 to 4 fps by disabling ALL of my code but that's no option xD

    For the movement I use the "Bouncy Ball" movement for nearly every move which works really good even if the framerate is low!

    I'm going to check the optimizations you recommand on the other post but I do not think this may be related to this!

    @danworth : I'm going to check that also, but i've tons of object that do not set in correct order if they have "inactivate if too far from window" to "yes"

    Gonna borrow my girlfriend's laptop to do more tests!

  5. #5
    Great project! Reading through this thread I would assume that your code is not the dealbreaker. What resolution has your game, how many assets are loaded per scene and how many layers and objects with pixel shaders are in there? also what shaders are used, some complex ones are really super expensive.

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Disabling all code saves only 3-4fps? Wow, you must be right about the code being efficient. The CPU usage also suggests that code is not the problem. That CPU only has two cores, which means that your game is only using 22-26% of a core (Fusion can usually only use one core).

    VRAM can be measured with a program like Aida64 or EVGA precisionX. But I don't think it'll teach us anything particularly helpful in this case.

    My guess is that the issue is shaders, or lots of large graphics with lots of animation. What are some of the typical Active Object sizes in your game? (dimensions, number of directions used, and number of animation frames).

    Are you familiar with the power-of-2 rule for images (images scale up to dimensions of 2,4,16,32,64,128,etc). If not then that will probably help you. Just google something like "clickteam DirectX power of 2 image"

  7. #7
    @Julian82 : Thanks! And congrats for your kickstarter
    Resolution : At beginning the game resolution was 1920x1080 but when I saw the performance issues I rescaled it to 1600x900
    Assets : Depending of the scene there is between 600 to 900 actives objects
    Layers : There is always 4 layers (one is darkness with multiply)
    Shaders : I use a lot of "Add" shaders, "Brightness and contrast" that applies to the entire scene (so the player can change the brightness which is an important feature for a dark game), some "Drop shadows" also. I've tried to remove it all long time ago and it didn't seem to change much but I can try again!

    @Volnaiskra : This CPU use is a great news then!
    My guess goes to the number of animations, we have dozens of armor, weapons and each one is about 900 frames <_> with 2 directions and 100x100 in size
    So you can realize how much it is, here is a screenshot :

    But there is only one armor, and 2 weapons loaded a time.
    I've tried to clone 200 times the armor with still only 1 armor created and it did not impact framerate (this may be obvious for you xD)

    Yes someone explained me the power of 2 thing! And we clearly are not optimized with this but we are way too far into the development to remake all the assets :/

    Anyway with hard work and multiplying my calculs by * int(60/framerate) here is what the game looks like at 19/20 fps :

  8. #8

    Your usage of shaders, as well as object-count, seems reasonable. Adding shaders to a lot of different actives is a huge performance drainer, but if I understood you correctly you only have one multiply layer plus one shader applied on the whole frame.
    How are your backdrops constructed? Is it large single frames, or a huge number of smaller tiles?

    Out of curiosity I set my game to 1600 x 900 for a comparison. I use a mixture of tiles from 32x32 to 512 x 512 to construct the scene. Larger rooms have a background count up to 2000. I have 2 layers with substract effect and one layer with multiply on it and for certain rooms I use a color deph shader applied to the whole frame. My game has about 5000 events of highly optimised code.

    On 1600 x 900 I get between 55 - 65 FPS on my i3 with integrated graphics. Deactivating all code gives me a gain of about 7 FPS, so like in your game, rendering the assets in HD seems to be the bottleneck here. There have been many optimization discussions on the forums lately. I think one thing to keep in mind is that Fusion games (in general) seem to struggle on higher resolutions, it may be a limitation of the engine's aged renderer, but I'm really no expert in that. Also many setups don't seem to use the dedicated graphics card by default to run Fusion games, as a Fusion game is basically recognized as a desktop app. Volnaiskra made some tests with his game suggesting that using "change resolution mode" gives you better results performance wise, but that seems to depend on your individual setup. My game uses windowed fullscreen and it actually runs better on integrated graphics than with a dedicated card (I've tested on an i7 with a middle class GTX )
    Last edited by Julian82; 19th May 2017 at 02:35 PM.

Similar Threads

  1. le scrolling n'est plus fluide parfois !!!!!
    By mig3 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 28th November 2010, 09:12 PM
  2. Mouvement d'une image non fluide
    By BibiCmoi in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th September 2009, 07:23 PM
  3. Stable et fluide partout?
    By Olivier in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 16th July 2008, 03:57 PM
  4. Stable et fluide partout?
    By Olivier in forum File Archive
    Replies: 0
    Last Post: 10th July 2008, 08:08 PM
  5. framerate fluide de MMF2
    By Phanoo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th July 2006, 02:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts