0 votes

Hi, I'm making a 2d puzzle game for mobile, where there is a grid with cells, this grid for each level is drawn at run time, example at level 1 the grid is 5x5, at level 2 the grid is 10x10. Each cell is a node that has a label, an image, a TouchScreenButton, an AnimationPlayer, and 2 panels. The grid is one panel. The problem is that the larger the grid, the slower the game. The fps drops dramatically. Example in android device:

Grid 5x5 = fps 49-50
Grid 10x10 = fps 12-13
Grid 18x18 = fps 3-4

Please I need help, I don't know how to solve this problem

in Engine by (12 points)

Hi,
Maybe something is looping in a node to slow down the game?
Hard to say without any code. If you could upload your game, someone to take a look.

I have no loops that run automatically, that is, nothing that runs in _process or _input functions in the scenes where it fails none of those methods are overwritten. The strangest thing is that I did a test replacing the cell scenes, with only labels, so, when I created the board the problem didn't happen, I also tried replacing the cells with another scene that represents level buttons, and the problem didn't happen either, I don't really know what happens. I don't know if it's because of the size of the script that has 143 lines

here my cell scene and Grid Scene

could be.. mine is 460 lines, but has timers firing off things.
Like I said. Hard to say without seeing it.

I think I found the error and it's with the StyleBoxFlat property in CustomStyles, for some reason when you activate this property in a label or panel, it affects the performance of the app in android when you add more than one, in these threads they talk about that:

Polygon2D is extremely slow compared to Sprite rendering
Huge performence drop in Android when using ScrollContainer

Nice one.. well done.

Mark as solved?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.