How do I stop a lag in game

0 favourites
  • 7 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hi every one,

    I have checked on this forum some answers about lagging in game. But my problem is a little bit different.

    Indeed when i start the game, sometimes the screen is shaken, just like if i have a collision problem. I'm sure the reason is not linked to the perfomances of the game because the frame rate is always the same : 50

    So i have checked the Player's collisionbox and the collisionbox of my floor. There are perfect because it's a square for both.

    I think it's the "scroll to" behavior

    could you help me please?

    Ps: Sorry for my english...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should provide an example capx - there could be many different reasons, but if you suppose it is the scroll to behavior, why don't you try disabling the scroll to behavior to see if the problem goes away... in case it does so, then there might be some logic problem etc. in the code for example.

  • Hi Striimix, thank you for you quick reply.

    You think the lag/shake can be caused by a logical mistake in the code? I read that can be caused by the Every Tick condition but when I change it, it's worst. I will provide quickly a capx file but it's really difficult because it is a big game, we've been working on it for 8 months. I think we have same conditions in different sheets.

    Do you think we have to group it in the same event sheet?

    I will try to remove the scroll to behavior.

    But I am really sure the performances are not the reason of this lag. Because I use my personnal computer and the config is really big : intel i7, geforce Titan, 32gb Ram and Crucial SSD.

  • Sometimes it is graphic drivers, firmware, etc. Just because you have good hardware doesn't mean that the driver handles all of your game code properly... although C2 should technically account for that.

    Other than that read: https://www.scirra.com/manual/134/performance-tips

  • [quote:1tahorb6]Post by gumshoe2029 » Tue Dec 15, 2015 9:46 pm

    Sometimes it is graphic drivers, firmware, etc. Just because you have good hardware doesn't mean that the driver handles all of your game code properly... although C2 should technically account for that.

    Other than that read: https://www.scirra.com/manual/134/performance-tips

    Hi gumshoe2029,

    Sorry but i am travelling so I can't reply quickly. I try everything. I disabled Particles / Scroll To / Checked collision boxes everything and It's Worst. I will upload a capx files this evening.

  • KnightStudio

    sometimes there might be things that look correct but the way C2 interprets it might be different - I've worked on a daily basis on game projects for about a year and a half with C2 and still continue to encounter and learn new things every now and than.

    Having game logic separated across several event sheets has not been a problem to me, so I doubt that would be the problem... are you triggering the shake effect with some camera zones..if those are overlapping / if there's a situation of having some duplicate events there might happen some camera stagger... I recently had a similar issue which I managed to solve by founding there was a left-over code from older camera system in one event sheet that was included.

  • Hi !

    I found where the problem was. I don't no why but the condition compare "X less or equal -Self.Width / 2" with the action Set X to Self.width / 2 for a tiledbackground do some lag on the background.

    Thanks every one for your help

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