How do I stop a lag in game

Get help using Construct 2

Post » Tue Dec 15, 2015 11:33 am

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...
B
8
Posts: 17
Reputation: 324

Post » Tue Dec 15, 2015 11:41 am

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.
B
13
S
3
G
1
Posts: 71
Reputation: 998

Post » Tue Dec 15, 2015 2:19 pm

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.
B
8
Posts: 17
Reputation: 324

Post » 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
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,396
Reputation: 4,786

Post » Wed Dec 16, 2015 9:09 am

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.
B
8
Posts: 17
Reputation: 324

Post » Wed Dec 16, 2015 2:16 pm

@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.
B
13
S
3
G
1
Posts: 71
Reputation: 998

Post » Wed Dec 16, 2015 9:00 pm

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
B
8
Posts: 17
Reputation: 324


Return to How do I....?

Who is online

Users browsing this forum: joliemoc, VulcanSpawnWolf and 1 guest