Game Gets Laggy

My game gets laggy when I test my boss that shoots a lot of bullet. (My game is bullet hell) I don’t know if the reason of lagging is because of the specs of my pc or the gdevelop itself. Is there some tips you can give me to reduce lag?

Use minimal ForEach object. If you must use ForEach object, make it a subevent of a condition that filters the objects you iterate over.

Use minimal effects. They can take up a fair chunk o processing time.

Avoid sprite masks if you can.

Use minimal RayCasting. they’re a drain on the processor.

Break larger sprites into smaller pieces.

Debug your game to see where the performance hit occur


My bullets have glow effect and the characters have shake effect when shooting and gets hit. I spawn a lot of bullets. Do you think that’s why it’s kinda laggy? Most especially when I create a lot of bullet at once.

Edit: I try to remove the glow effect of the bullet and it makes it a lot smoother.

Effects have been known to cause a slowdown. You could test that by removing both those effects, and seeing if that makes a difference.

Ha, I got beaten to the draw :smiley:

1 Like

Instead of using the glow effect, could you use a light source behind it? Or even add the glow effect to the bullet image (as in the actual image file) in an art package?

Alternatively, make a “bullet” layer and keep its camera aligned with your main layer. Put the glow effect on that layer. I believe that’ll be less performance intensive than a unique effect on each bullet instance.