Discussion about game on mobile

Discussion and feedback on Construct 2

Post » Tue Dec 04, 2012 1:51 pm

I open this topic in hope that people who made/are making game on mobile devices share their experience together.

Let me start first, I just finish building a simple game on mobile devices. Targeting tablets.

The game is a 2 player vs game, which each player control a character, collecting "coins"; harassing opponents while doing it.

Behavior use in this game:
1) 8 directional movement (just for using the solid behavior)
2) Touch, for controls
3) Bullet movement for a lot of stuffs.
4) Solid behavior

Thoughts at this stage (I am testing on friends device now)
1) It is hard to work with multi-touch on construct 2 (or I just suck).

Week was spent on this forum just to find a better way of working with it, without much help from the community sadly. (Thats why to those few who help, I am extremely thankful.)


2) Supporting multiple screen size is a pain in the @ss.

I created two type of layout, 4:3 and 16:10. So that I could accommodate this two main aspect ratio (the game load by choosing the layout ratio that are nearest to the expect ratio, [I haven't test if I've successfully implemented it])

2) The performance across different device is really obvious!
I own an ipad 2 and a huawei U8800, and which it ran 50-60 at my ipad2, it is unplayable on my phone. (not unexpected).
But! Galaxy SII seems to handle the game okay (playable but unenjoyable)
Galaxy Tab(7 inch 1st gen),
Galaxy Tab 10.1(1st gen), was sloow,
Asus Eepad(Not transformer) handles it slow too (but faster than tab 7.)
still waiting on result on tab 2 7inch.

This makes me wonder, what game can be made for mobile game? is the only way of doing it is either - game that can play in low FPS?
                          - very very very simple game? (because my game is very simple and it don't work)

But how does those game on ios and android that are so much more sophisticate works...?


Discussion on performance:
1) Recently, I heard someone say 8 directional kills performance on mobile device.
I need the 8 directional behavior for my player to react to solid, but I did switch the option from "8 direction" to "up and down". I think my ipad run 5fps quicker. Or was this just placebo effect i don't know.

2)Is invisible object on the layer slow performance?
I am not sure about this but I "destroy" everything on layers that are not using, and only spawn them when needed.
This decrease the object count from 100 to 70. Not sure if it affects performance though.


Please do pardon my poor english. =)
ZhaoYun2012-12-04 13:51:43
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Tue Dec 04, 2012 7:33 pm

1 - I made multitouch easier to work with by placing a sprite at each touch location and checking for collisions with those.

2 - That's a problem not specific to construct 2. I set positions of the ui based upon the viewport edges expressions, then resize the browser window in preview to make sure it looks good at lots of different ratios.

3 - different devices have different amounts of processing power and optimization for HTML5. The same device, if the carriers would allow people to upgrade the operating system, often could run HTML5 faster. It something developers, not just c2 developers, have do deal with. Some devices just can't handle it.

Previewing on a device over lan generally results in the game running slower than if you actually export to HTML5 and upload it to a server, though, as the preview code has a lot of checks in it that the exported code doesn't have. Also have you tried cocoonjs or appmobi's directcanvas? Those can accelerate mobile games as well.

4 - I haven't tried it, but if it does, you can easily recreate it in events. You might want to make a test to check if it does or not.

5 - Invisible objects can slow the performance of the game, as though they are not rendered, they are still processed by the game's code and taken into account when doing things like checking for collisions.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue Dec 04, 2012 9:47 pm

I haven't developed far enough, but Arima's point 1 is super important. When dealing with any long term touch your far better off using a sprite. Even at 1x1.

Sprite with Drag and Drop behaviour.(don't put this D&D into a folder for sorting)
On Touch -> dragbox set position to touch.x touch.y

if your only doing a button then no worries.

Anyways that's my experience :
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Tue Dec 04, 2012 10:36 pm

I'm developing a simple-fun arcade game for the kindle fire.

1. If you are using cocoonjs, do not use too many tiled backgrounds! After trial and error, i found out that was the biggest performance hinder. Not sure if CocoonJS needs to optimize tiled backgrounds.

2. The accelerometer is not working on the kindle fire, using cocoonjs. I get no data out of it. I checked all the expressions, and the only one that fires is touch.
B
50
S
11
G
7
Posts: 274
Reputation: 8,146

Post » Tue Dec 04, 2012 11:48 pm

[QUOTE=PixelPalette]
1. If you are using cocoonjs, do not use too many tiled backgrounds! After trial and error, i found out that was the biggest performance hinder. Not sure if CocoonJS needs to optimize tiled backgrounds.
[/QUOTE]

This defies everything I've read about mobile device development, surprising to hear!

I have many single tile sprites imported as tileable background objects rather than sprites objects in an attempt to plan for a mobile platform.

Can @ashley or @ludei weigh in? That a single tileable background object is or is not more resource intensive than a single sprite object?
B
9
Posts: 59
Reputation: 997

Post » Wed Dec 05, 2012 6:20 am

[QUOTE=Greg]
This defies everything I've read about mobile device development, surprising to hear!
[/QUOTE]

I only meant it using the kindle fire with cocoonjs. Sprites are technically slower then tiled background, but this is not the case it seems on the first gen, kindle.

I have to just bite the bullet and sacrifice some textures for performance. Or, Ash could do a native android/ios exporter... ;)
PixelPalette2012-12-05 06:20:37
B
50
S
11
G
7
Posts: 274
Reputation: 8,146

Post » Wed Dec 05, 2012 10:20 am

@Arima @jaderyu
I use cocoonjs, it was simply the fastest.

As some of you may know, I was obsessing about creating a touch control for 2 player.
I've tried:
1)Drag and drop behaviour as the control thumb-> but I ditch the idea because it needs the player regrab the stick everytime it was let go.
2)Trigger. ->It works but for the trigger, I created 40 instance for 2 players! Not to mention that it doesn't move perfectly, the object count just.. wow.

So, I end up with
Touch.xat(0)and touch,yat is within "a range"----set playerbox movement from "self.x,self.y to touch.xat(0), touch.yat(0).

Then repeat it for touch.xat(1),(2),(3) up to (5).
It works perfectly, at least I haven't have any nasty surprise.


I adjusted to aspect ratio the same way as Arima said. Viewportright(0)/viewportbottom(0). and compare if it is nearer to 3:4 or 10:16, and load the layout accordingly.

But somehow it works on some phone but not on others. I am suspecting that, while dimension of phone is calculated in portrait, it was calculated in landscape in tablet.

That's why I made abit of modification on my code. Just haven't test it out.

Another issue that I was encountering is, in some devices, when your game stretches, it was blocked by the phone's status bar.
In other word, the game scale, and stretches UNDER the status bar, instead of UPTO the status bar.

I don't see myself solving the problem.


P.S.:
Today I try out my game on tab 2 7.0, it is slow, looks like a design overhaul is needed. SAD.
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Wed Dec 05, 2012 10:21 am

@PixelPalette
Thanks for sharing~!
This is exactly the type of information I was hoping for when I started this post XDDZhaoYun2012-12-05 10:22:18
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Wed Dec 05, 2012 12:48 pm

Turns out that I was not aware that I could make my game frame rate independent!

I was also surprised to know that movies actually have their frame rate set at 24 fps!

After making my game frame rate independent, I'm sure it is playable from most of the tablets on the market.


But now I wonder, is viewportright and viewportbottom really able to "read" the resolution of the device?

Or there is other expression for that(resolution of devices)?
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Thu Dec 06, 2012 6:36 am

I'm a little biased towards making iOS games instead of Android because of problem number 2.

I was a little disappointed when I heard the iPhone 5 would have a different screen size and hence different aspect ratio. But trying games with the wider screen out, I realized how much better it was.

With Android, I would just stretch it xD
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest