• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Android Optimizing A Game

D

discocar

Guest
Hey guys,

so I was wondering if the amount of rooms a game has effects performance or if it just effects the file size?

I currently have one room where all the sprites and stuff happens. But I want to add another game mode so will add another room which has the sprites and everything but was wondering if it would effect the game overall?

Any tips also on making sure the game doesn't drain battery and it runs well?

Thanks!
 

obscene

Member
Number of rooms has nothing to do with performance whatsoever. Make all you want.

Add show_debug_overlay(true) to the start of your game and that will tell you if you need to optimize your drawing. Then run the debugger profiler to see what's hogging processing power.
 

JacPete

Member
When you start a new room and got the same graphics in it, you got no performance loose. If you got other sprites and tiles inside of the new room, the new data would also stored into the ram. So no problem with adding new rooms to an game. Also no problem with new graphics, i love to show off different worlds and enemies inside my games. Just use the code: draw_texture_flush(); at the beginning of your loading screens and you throw the old level assets out of the ram.
 

JacPete

Member
Also use the texture group option, otherwise you would load any graphic into the game without any big logic behind it.
 
A

Andy

Guest
From what I understand, you should be fine using multiple rooms. You would be storing data on how to build the room in memory either way. Data stored in memory probably won't be a major performance issue. Processing the data in an efficient way is what you should worry about.
 
T

Taddio

Guest
Also use the texture group option, otherwise you would load any graphic into the game without any big logic behind it.
This. Avoiding texture swaps and drawing non-moving/non-animated things every step would not hurt at all.

Also, have you read this?
 
D

discocar

Guest
One more question what about Room Size does that have an effect and I am assuming that event actions and script on sprites is what would cause a lot of high cpu usage? Thanks
 

NightFrost

Member
If by room size you mean the numbers you put into room editor then no, they don't have effect. If you mean in general the amount of stuff you pack into the room, then yes, those are directly related as that's more code to run and stuff to draw.
 

RangerX

Member
One more question what about Room Size does that have an effect and I am assuming that event actions and script on sprites is what would cause a lot of high cpu usage? Thanks
A room is just a canvas, a set of coordinates or a grid if you'd like. Its just for you to understand what is where. The room itself takes quite nothing.
Now, what will take CPU is reading code. The therefore, the more code you make the machine read every step, the more work for the CPU. It's that simple.
 
D

discocar

Guest
Okay thanks, so what fps should I be hitting?

when I run debugger it shows at the bottom the frame rate is 1200 to 1600 is that normal?
 
Last edited by a moderator:

RangerX

Member
You can't state it just like that. There's always context to a framerate.
Let's say you want your room to run at 60fps. This means you need AT LEAST 60 real engine fps.
Now, if you're a good computer and you do barely over 60, you game probably would run like crap on an average or poor PC.

The best is to find a crappy computer and test your game on it. Optimise your game so runs fine on the toaster and you're good to go.
 
Top