Question For Very Experienced Mobile developers.

Discussion and feedback on Construct 2

Post » Sun Apr 05, 2015 10:57 pm

Wise choice to develop for desktop. Mobile can be a painful, heartwrenching journey :)

Nesteris wrote:... but now I have two people saying two different things.


Hehe, well not necessarily. I was talking more about the logic side of it. To say that "Every Tick" on its own is a 'bad' event is misleading, as it implies that merely executing some logic every frame can cause slowdown. What's true is that using Every Tick for intensive graphical operations could be a bad idea, which is where he may have extracted that rule-of-thumb.

TiAm wrote:Rotating objects frequently (rotate behavior or setting angle every tick) is one that doesn't show up in that list, but it can really slow things down, especially if you are rotating large objects.


This is interesting. I was under the impression that mobile GPUs would be pretty good at elemental operations like translation, scaling, rotation, etc. Did you experience this on CocoonJS as well? I'll have to test it.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Mon Apr 06, 2015 3:20 am

80bit wrote:
TiAm wrote:Rotating objects frequently (rotate behavior or setting angle every tick) is one that doesn't show up in that list, but it can really slow things down, especially if you are rotating large objects.


so Nate goes and makes a game where almost *every* object constantly rotates... :mrgreen:


Really don't think it matters on desktops. Maybe if you had thousands of objects, but even then, I don't think offscreen objects are drawn at all, so I assume having them rotate wouldn't matter.

Dalal wrote:I was under the impression that mobile GPUs would be pretty good at elemental operations like translation, scaling, rotation, etc. Did you experience this on CocoonJS as well? I'll have to test it.


I've haven't used Canvas+ much. I basically went into development figuring that CJS Canvas+ could break at any time since it's not officially supported anymore, so I couldn't place my faith in it. Also, I wanted my game to be able to run on lower-end devices, even with crosswalk. A masochist, I know... :roll:

Anyway, I'm certainly not saying you can't do rotation on mobile, just that, in my limited testing, it's much more expensive than translation and scaling. I didn't totally geek out and dive into why since I'd like to actually get my game finished... :mrgreen:
Last edited by TiAm on Tue Apr 07, 2015 5:45 pm, edited 1 time in total.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Apr 06, 2015 4:39 am

yeah, on desktop its not really an issue. Mobile / Wii U is out of the question though. I donno how much the rotation had a factor in that. Dev kits back with Nintendo now anyway and wasnt much i could do since it required the rotation at its core :D
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Apr 07, 2015 10:31 am

Dalal wrote:@Nesteris,
Also, CocoonJS is the best export option when it comes to performance, there's no doubt about it. Because it's a "non-browser engine", Ashley doesn't like to promote it, otherwise users complain about Construct 2 being flawed when there are compatibility issues. The truth is that CocoonJS is WAY better performance-wise than Crosswalk, especially when it comes to twitch-based action games with lots of movement in them. So forget compatibility. If you are developing strictly for mobile, and CocoonJS works for you, then develop to export through it, and you'll get much higher quality results than Crosswalk.


CocoonJS is not just Canvas+. We also offer a similar solution to Crosswalk (WebView+) or even to PhoneGap (WebView).

The term CocoonJS has been related to Canvas+ for a long time and it is completely understandable, but please, from now on, we would much appreciate if you could specify that your comments are about CocoonJS Canvas+ or WebView+ or WebView. We know it is a complicated change of mindset, but CocoonJS is no longer just Canvas+ so this distinction will help us better identify what technology you are referring to. Thank you very much! :)
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Tue Apr 07, 2015 6:53 pm

@ludei,

Will start saying CJS Canvas+ from now on. Sorry about that!
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Wed Apr 08, 2015 3:54 am

Dalal wrote:@Nesteris,

Actually I wouldn't worry at all about most Every Tick events. The biggest source of slowdown on mobile is related to graphics, not logic. Unless you've got some hardcore physics calculations happening, forget optimization and just make sure your code is organized and pleasing to the eye. Setting A equal to B every tick has practically zero impact on performance. Ashley has addressed this on his blog. If you haven't already, read it and feel relieved.

https://www.scirra.com/blog/83/optimisa ... -your-time

The best advice is to periodically export the game and check its performance on mobile. That way, if you made a change that breaks performance, you can re-evaluate your approach.


:shock:

Worse advice you can give to a mobile dev.

Don't you see this forum is constantly filled by complaints of poor performance? 99% of the time its because mobile devs failed to optimize their games ground up.

Even for the PC, it's best practice to always optimize your game and design it around extracting peak efficiency. This is especially true for mobiles, even if your game runs 60 fps. If its efficient, it runs 60 fps while using less CPU cycles, resulting in less "battery draining" or "overheating devices".

ps. Setting A = B every tic doesn't matter much, but repeat those wasteful events enough, it becomes bloated, poorly optimized and then it truly matters.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Wed Apr 08, 2015 6:12 am

@Silverforce +1 i could not think of what to reply with here but that post puts it pretty perfectly.
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Wed Apr 08, 2015 6:34 pm

Silverforce wrote: :shock:

Worse advice you can give to a mobile dev.

Don't you see this forum is constantly filled by complaints of poor performance? 99% of the time its because mobile devs failed to optimize their games ground up.

Even for the PC, it's best practice to always optimize your game and design it around extracting peak efficiency. This is especially true for mobiles, even if your game runs 60 fps. If its efficient, it runs 60 fps while using less CPU cycles, resulting in less "battery draining" or "overheating devices".

ps. Setting A = B every tic doesn't matter much, but repeat those wasteful events enough, it becomes bloated, poorly optimized and then it truly matters.

It wasn't my intention to say that optimization on the whole should be ignored. My response was towards this tendency of "blindly optimizing" the game logic, which causes folks to spend eons tweaking their events, without taking care to develop a genuine understanding of what truly makes games performant.

The way I see it, there are two extremes in high-level development, both which fail to capture reality: The first ignores optimization altogether, thinking the framework will handle it all. The second is obsessive compulsive, and convolutes the code in the name of optimization and peak performance, ignoring so much of what the framework is already doing behind the scenes to make it easier for developers.

Obviously, there's a wiser approach that strikes a balance and gives peace of mind, allowing you to use your framework the way it was intended to be used for code clarity and organization, and yet get desirable performance out of your game. It doesn't do away with optimization, but uses genuine knowledge (as opposed to simplistic philosophy) to decide what to spend time on, and what things to let the framework handle as it already does so well.

In the spirit of discovering this wiser approach, we could say that villainizing 'Every Tick' events solely on the basis of them being 'Every Tick' events is blind optimization of logic, which in this case ignores Construct 2's already well-optimized logic engine and steals some emphasis away from real performance culprits, notably graphics intensive operations. You could spend a week hacking 10 events into a single efficient one, but the wisdom of reducing readability and maintainability for the few percentage points of performance you gain would be questionable. To quote Ashley from the "Optimisation: don't waste your time" blog post:

Our profiling has shown it's not unusual for even a fairly complex game to spend 10% of the time on the logic, and 90% of the time on rendering - even when hardware accelerated! In other words, if you're not getting 60 FPS, the #1 thing to do is think about how to speed up the drawing of the game. That might mean having fewer sprites on-screen, avoiding heavy particle effects, and so on. Remember your events and behaviors are part of the logic, which only takes 10% of the time. So even if you went to extreme pains and managed to get all your events and behaviors to run ten times faster overall, which is typically an impossible goal, you will just be reducing that 10% to 1%. The overall performance will just be a few percent better for hours and hours of work, and you could probably have got the same speed-up by reducing the rate of one of your particle effects.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Wed Apr 08, 2015 7:47 pm

I'm a computer engineer with a specialty in analysis of algorithms 8-)

In my experience, the optimization of a mobile game is a critical point because not everyone will have the last device

Take a look at Ashley's topics about optimization, they are an excelent summary

Just keep in mind that there is always room for better performance
B
93
S
31
G
11
Posts: 654
Reputation: 11,832

Post » Thu Apr 09, 2015 6:40 am

Dalal wrote:To quote Ashley from the "Optimisation: don't waste your time" blog post:

Our profiling has shown it's not unusual for even a fairly complex game to spend 10% of the time on the logic, and 90% of the time on rendering - even when hardware accelerated! In other words, if you're not getting 60 FPS, the #1 thing to do is think about how to speed up the drawing of the game.


If you want to use that quote, you have to get specifics, define a "fairly complex" game.

Any mobile gamedev who has used C2 on a large project knows its limitations: JS suffers a performance penalty especially on mobiles. It's also single threaded which is not good for mobile CPUs which are often made up of 4 weaker cores (imagine only ever using up to 25% of a mobile device's capability!).

Optimizations is key for mobile devs. Ignore it at your peril, then come back and make a post about why "C2 sucks for mobiles" or "C2 performance on mobiles blows donkey"... like the many threads we have on these forums on a daily basis.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests