which option is right for performance

Discussion and feedback on Construct 2

Post » Sat Sep 17, 2016 5:11 am

which will be faster
1) Every tick or every 0.30 second
if every tick is faster, if i use it more than 10 time does it effect performance

2) Layout size is 640x960
I want to make a sprite to cover whole layout with black colour or any colour
then my options are
    a) make sprite 640x960
    b) make sprite 50x50 pixle and scale it to layout
    c) make tile background and cover layout

3) image quality or sharpness suppose i have character size 100x100 pixle then my options are
    a) I should create 100x100 pixle
    b) I should create 200x200 pixle and then scale it down 50%
Image
B
63
S
38
G
42
Posts: 625
Reputation: 30,363

Post » Sat Sep 17, 2016 5:52 am

luckyrawatlucky wrote:which will be faster
1) Every tick or every 0.30 second
if every tick is faster, if i use it more than 10 time does it effect performance

2) Layout size is 640x960
I want to make a sprite to cover whole layout with black colour or any colour
then my options are
    a) make sprite 640x960
    b) make sprite 50x50 pixle and scale it to layout
    c) make tile background and cover layout

3) image quality or sharpness suppose i have character size 100x100 pixle then my options are
    a) I should create 100x100 pixle
    b) I should create 200x200 pixle and then scale it down 50%


Every 0.3 seconds will obviously have a lesser impact on performances but keep it for the things that don't need to be recalculated every tick

If it is a single color I'd go for option D, changing the layer background property

For 3 a larger image will use more memory but will look better on bigger screens so it's a trade off

Just my opinions
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Sat Sep 17, 2016 7:15 am

@Ashley please look here and give some advise


I have noticed today one thing that effecting performance

1) In my game i have 19 global variables i check performance on debug mode its saying 20 fps
when i remove all global variables then it become 40 fps
2) I have 3 layers in my game If i delete 2 layers then it become from 20 fps to 50 fps ( I do not delete Gbl variables here)
3) when i delete all global variables + 2 Layers then my speed is 60 fps

It means layers & global variables effecting frames

===================
I have also tried
take a new project entirely blank project
just added 2 extra layers
speed become 40-45 fps

i just created a global variable and copy paste it 15 times
i have notice here every single variable effect frames
create global variable 1 by 1
it decreasing speed
Image
B
63
S
38
G
42
Posts: 625
Reputation: 30,363

Post » Sat Sep 17, 2016 7:53 am

If you follow these then you game should run fine.

mobile-optimization-tutorial-version2_t181811
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Sat Sep 17, 2016 8:19 am

PixelPower wrote:If you follow these then you game should run fine.

mobile-optimization-tutorial-version2_t181811



but what about a blank project shoing low frame rates >>>

I had take a new project entirely blank project
just added 2 extra layers
Result : ==>>> 40-45 fps

i just created a global variable and copy paste it 15 times
i have notice here every single variable effect frames
create global variable 1 by 1
it decreasing speed
Image
B
63
S
38
G
42
Posts: 625
Reputation: 30,363

Post » Sat Sep 17, 2016 8:23 am

the debugger on the inspect tab uses quite a lot of performances by itself, and increase the load of other things like groups, you should try a spritefont set to fps every seconds instead and see if the fps is still very low.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Sat Sep 17, 2016 10:55 am

luckyrawatlucky wrote:
PixelPower wrote:If you follow these then you game should run fine.

mobile-optimization-tutorial-version2_t181811



but what about a blank project shoing low frame rates >>>

I had take a new project entirely blank project
just added 2 extra layers
Result : ==>>> 40-45 fps

i just created a global variable and copy paste it 15 times
i have notice here every single variable effect frames
create global variable 1 by 1
it decreasing speed


Ok I really never used the debugger for feedback , just actual testing of how the game runs when I play it. The reason is the debugger can say the game is running 10fps but when you play the game its running silky smooth leading up to the point that its the debugger using up precious resources or miscalculating .
If each global variable decreased game speed , my games would run terrible. Did you do a device test yet or just the debugger? I have a hard time figuring out how your game is moving slowly with hardly anything in it.
Look at this video
https://www.youtube.com/watch?v=wa8uEh_UemI

Try your game on the device and test actual performance rather than relying on debugger too heavily.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 681
Reputation: 16,613

Post » Sat Sep 17, 2016 11:05 am

true, the debugger is a very useful tool but nothing beats actual testing on device, when the testing goes wrong though, use the debugger to see if there is nothing too heavy on the cpu or that could be optimised.

I don't recommand using the debugger on a mobile though, the fps can get a big hit for no reasons.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Mon Sep 19, 2016 3:36 am

Suggest you use an in-game text to show the FPS and cpu usage.

Such as:

Every 0.5 seconds -> Text [Set Text] FPS & " " & cpuutilisation

It'll update the info 2 times per second.

CPU Utilisation is an approximate though it is very accurate in my experience. It's a ration from 0.0 to 0.99, representing 0 to 99% load on the main logic thread.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,609

Post » Mon Sep 19, 2016 10:43 am

Answer your own performance questions with measurements

In most of the cases your described, it will likely have no measurable impact on performance and therefore be a waste of time. Other concerns like image quality and memory use will be more important.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228


Return to Construct 2 General

Who is online

Users browsing this forum: blackhornet, Bobbyneal100, DomenicS, Giggle Software and 6 guests