Artpunk's Recent Forum Activity

  • Well I took a pretty massive step forward with performance of my game on my old iP5 today. Check this out.

    iPhone5 now getting 55 - 60fps and around ~50% CPU usage.

    Improved from 40 - 50fps and 80 - 90%+ CPU usage.

    This improvement was made by swapping from building in Intel XDK to PhoneGap Build (using WKWebView).

    Boy did that make a difference!!!

    I spent most of yesterday and this morning trying to improve performance on my iPhone doing things like reducing the number of events in my game (mainly culling disabled events that were early attempts that didnt work etc), and trying to improve how I was using tilemaps... and these changes made incremental improvements, but nothing to write home about. But exporting with WKWebView ticked, and building in PhoneGap eclipsed any small optimizations I had made!

    One thing though, it didn't improve the load time for the levels, well perhaps a fractional improvement. But I still get a lag of ~4 seconds when going from a menu screen to a game level. A problem that doesn't happen on my Android test devices.

    Anyway... after getting this performance result I feel confident to continue on with building my game, knowing I should be able to get solid performance even on an older iPhone5..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi thanks for the reply. Yes I was stupidly testing mostly on my current phone. I knew the iP5 would be weaker than my Nexus5X but I didnt think it would as weak as that... live and learn.

    Thanks for the tips. I'm pretty certain I can get the number of events in my game down. With collisions, below is a screen shot showing collisions in the debugger. Is 5643 (209 p/tick) high? Could that be causing a problem? This reading was taken at the same point in the game as shown in the previously posted screen shots.

    Ashly, re what you said about the CPU measurements not matching. The screenshot showing 95% CPU usage was taken on the iP5 running the game as an app (built in XDK). I never mentioned CPU usage in my initial post (first post of thread). I only mentioned the FPS for iP5 (40-50fps). When you quoted me as saying 47%, which part of previous post(s) were you referring to. Let me know and Ill try to clarify. Thnx

  • Here are some screen shots I took on my two test devices. This is with the games running as apps built in XDK (not testing locally in a browser).

    Nexus 5X: 60fps, roughly 50% CPU usage (Is that good? I dont know how good that is).

    This is smooth game-play, snappy menus etc. V happy with this performance.

    iPhone5: fluctuates between 40-50fps, CPU usage fluctuates between 80 - 90+% (looks pretty high right?).

    Another problem with the iPhone not reflected by these numbers is that each level in the game takes a long time to load. 4-5 seconds compared to about 0.5 - 1 second on the Nexus. The game-play is 'playable' but not great. But I really want to fix the lag with levels loading. Thats a problem.

    I did an additional test. I had a suspicion that it could be the way I was using tilemaps in my game. Each level has 5 layers dedicated to tilemaps. I built the levels that way because I wanted to layer the background to have a foreground, midground and background. And I have two layers for collision tilemaps, one being solids and one having the jumpThru behaviour.

    So I wondered if all these tilemeaps might be causing slow performance on the iPhone, so I deleted out the layers with artwork in them (highlighted red in the image below) and just left the two collision layers (which are invisible in the screen shot).

    This seemed to have a small effect on FPS (45 - 55fps) and CPU utilization (80 - 88%). But it improved the load times of each level a lot! The levels now load in about 1 second without those additional tilemaps.

    So if I want my game to run nicely on lower end iPhones, Im going to have to improve the way I make my backgrounds and use tilemaps differently. Otherwise it will only be people with decent phones that can run my game

    ... Id like to test on an iPhone6... and Id also like to know how many people use iPhone5 and below globally...

  • Well. When I preview locally, The CPU usage is the following :

    Nexus 5X: 50 - 52%

    iPhone5: 55 - 58%

    Im not looking at the debugger to get those values though, rather I am running an event that displays FPS and CPU Usage on the screen every tick while the game is running as recommended in the manual: just setting a text object top say (fps & " FPS, " & round(cpuutilisation * 100) & "% CPU (" & renderer & ")"

    I find that if I look at the CPU usage and FPS with the debugger open I get very different values, I think thats due to the debugger itself using system resources right? So I am working on the assumption that when testing locally you get a better measure of FPS and CPU usage by using the event above.

    Also, the same event tells me the FPS and CPU usage for my game when running as an app on my two test devices. And I get different values again in that case. Ill post some screen caps to illustrate.

  • I am quoting those values from the Profiler tab in the Debugger.

    So those values are when previewing my game in browser over local network. I just thought the values there might be indicate a reason for reduced performance in the game on iP5 when built in XDK and installed as an app. Hope that makes sense... I'm muddling my way through a bit. This is my first game.

  • Silhouettes?

  • Im testing a prototype of my game on both Android and iOS. The devices Im using to test are a Nexus 5X and an iPhone5. I have tested by building in Intel XDK, then installing the apk and ipa files on each phone.

    So the Nexus is more powerful and gives a comfortable 60fps, while the iPhone5 spends most of its time between 40 - 50fps.

    On the iPhone5 game-play is not too bad (certainly still playable), but I notice a real lag when starting a new level, when a new layout is loading up. I would like to improve this if I can. On the Nexus everything is snappy and runs really well, game play is fine and there is no lag between levels.

    I am wondering what this lower performance on the iPhone could be caused by. If its something I can optimize and hopefully improve, or if its simply due to the hardware: an older phone not being able to run the game very well (even though its a pretty simple game).

    When I go back to previewing over local network to use the deubugger, if I look at the 'Profile' tab in the debugger, I can see that the iPhone has a higher value for 'draw calls' than the Nexus. Could this higher reading for 'draw calls' be pointing to a reason why the game is running slower on iPhone?

    The readings for the debugger Profile tab look like this for each device:

    Nexus 5X

    Events: ~25%

    Engine: ~12%

    Draw Calls: ~10%

    iPhone5:

    Events: ~17%

    Engine: ~10%

    Draw Calls: 20%

    Do these readings seem high? For events and draw calls? This is my first game so Im not sure.

    The game is a simple platformer with tilemap backgrounds. I am trying to follow the recommendations in the manual for optimizing for mobile:

    -there are not many objects in the layout (47 total at the point in the game where the above readings are taken).

    -no fancy effects

    -no big images (its all tilemaps and small sprites).

  • Will you need to solve this issue in more apps?

    Well I am currently working on my first game. But once i get this one finished I have a million ideas falling out of my head for future games, so I'll probably be battling with these kinds of issues in the future. Hopefully the status bar issue is resolved for me now though. But if you made a plugin that gave a bit more control: allowing the nav bar to be visible at all times for eg, that could be useful?

  • Ive just been playing with hiding the status bar in the latest XDK. I had some help from another user. Checkout this thread: How do I Remove Android status bar, using Intel XDK

  • What works for me in my current project is to have a splash screen layout in my C2 project. I dont use the XDK splash screen plugin. Rather the first layout to load in my project is the splash screen I made in C2 with company logo etc on it. From there the next layout the player sees is the main menu.

  • Hi, yes I always have the 'Hide status bar' option ticked in Cordova export. It doesn't seem to do anything tbh.

    Well... the problem for me with using the 'fullscreen' option in XDK is that makes both the status bar AND the nav bar hidden and inaccessible. What I was initially aiming for was to have the status bar hidden, but the nav bar visible at all times during game play to provide an easy way to quit out of the game. So the 'Fullscreen' option didn't allow that.

    The method above works for me:

    -'fullscreen' unticked in XDK - this makes nav bar and status bar both visible during game play

    -Add status bar plugin in XDK. Call 'StatusBar.hide' in C2 - this causes both the nav bar and the status bar to initially be hidden during game play BUT they both become visible when the player touches the edge of the screen.. allowing an easy way to quit from the game via the nav bar. This isn't exactly what I was trying to achieve but it's close enough that i'm happy with it.

  • Hey thanks for the reply. I got this figured out with help from another user in this thread

    What worked for me was to leave the Full Screen option deselected in Intel XDK, and then add the StatusBar plugin (again in Intel XDK), and then enter an event in my C2 project to say: On start of layout -> Browser, call javascript: "StatusBar.hide()".

    This causes the statusbar and navbar to be hidden while game is running, but you can still access navbar by touching the edge of screen. So that was pretty close to what I was trying to achieve, so Im happy with that.

    Ill check your game out

Artpunk's avatar

Artpunk

Member since 10 Apr, 2014

Twitter
Artpunk has 5 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies