My project is so lag

I have a problem with my GDevelop game, the problem is that I have a very basic game that does not have more than 40 events, and I have a very powerful computer, but when I start the game, the game runs well but it jerks, I have optimized as the official Gdevelop website told me but it was of no use, since nothing it says is a bother to the game’s performance, any solution?

Hello, RedaV. Welcome!

The number of events in a project doesn’t necessarily have to do with how well your game performs. For example, it’s possible to make a game perform poorly by using just a few events that constantly create instances with physics behavior.

I think that to make it easier for people on the forum to help you, it would be interesting if you could better explain the type of game you created, how it works and at what point it starts to lag.

Hi Rasterisko, thanks for your help.

My game is a 2D Tower Defense with my own sprites that were made in the gdevelop drawing system (except one that was made in a drawing program), the game is unfinished and I reviewed code by code and placing the “Run once” but the game keeps going the same.

It works fine but when executing an event the game freezes for a couple of seconds.

For example, when an enemy enters the exit, the game freezes for about 2 seconds and then its life is reduced.

I hope you can find any errors in this and if not, tell me and I’ll tell you more details, thanks again.

Knowing that there are specific moments in your game that have freezes, I believe this will make it easier for you to fix it. Just go to these related events and check them out.

Can you share the related events when the Enemy enters the exit?

Wath do you mean with “share the related events”

Take a screenshot using Snipping Tool or PrtScrn button on your keyboard with the events sheet window, and paste it here

1 Like

There is all of code, the sprites name are in spanish but that not is a problem.

All your creation events (and more) are without trigger once

I know, that is because i put “trigger once” in so much events, but the game kept going the same

While it probably works in Gdevelop, the actions should perhaps be reversed, as it doesn’t make much sense to first delete the instance and then calculate the life based on a variable from that instance that has already been deleted. But I don’t think that’s going to solve the freeze…

Thank to everyone to try help me, now i know wath is the problem, in some texts i put a font wath i havve in download carpet, and that was wath produce the lag

1 Like