Optimization Question - Drawing many meshes/sprites

@Elias Glad you got it figured out. Don’t worry about the embarrassing part, I’ve done things like that many times. No matter how many times I go over the code, I can’t see the problem. I have to just give up, wait a day or 2, then look at the code again before I see what’s wrong. It’s like your mind gets stuck in the error and you just don’t see it. Waiting seems to break the cycle.

nice job figuring it out, like dave said don’t worry about it, there’s been times when i got stuck on an issue and thought i dont even know how to code or i should just give up on trying to make games

you say it’s “almost” 60 fps, one thing i do is keep track of how many objects im drawing on the screen, do you know how many you have on the screen at once?

@dave1707 Thanks! You’re right, waiting and sometimes re-writing a piece of codes often fixes these issues.

@skar Thanks! Yes and no. I do count how many objects and of what type are on the island. However, players can basically customise it however they want. Some types of objects are more expensive to draw than others (shaders, particle effects, sounds, …). I’ve created a test environment with some areas that are worst case scenarios and others that should be closer to what players typically experience. Hitting 60 FPS is the goal. However, I’ll probably keep the game at 30 FPS anyway for most devices as battery consumption is much higher otherwise.