Me and mobile optimization just don't get along 😤

folks, help me out before i face desk out of sheer frustration:

Works ok on a desktop, but laggy as hell on a mobile device (including ipad).

Funny thing is i had everything disabled except pathfinding on a local network wifi preview and the result is just as bad. i did use YSort alot as well the pathfinding object. Not sure if it is an issue with the sprites.

apparently me and mobile just cannot get along even when i was working on voss :sweat:

This info will help
http://wiki.compilgames.net/doku.php/gdevelop5/tutorials/how-to-debug-poor-performance

The criterias listed on the wiki had been considered and put into place. whatever that is causing mobile lag is baffling. Looking at the profiler, the events that were takes up 60+% of the pool actually ran amongst the fastest at 0.02-0.05 ms. The entire map ran at about 4.7ms on average.

pathfinder object is not activated until path is found. pathfinding grid is 64 (that is way more optimized than it should be, de-facto is about 20+ i believe).

edit: it’s 0.02-0.05, not 0.2-0.5, lmao!

Forgot to add that Pathfinder obstacle is disabled if my toon is more than 512 pixels and YSort behaviour at 256 pixels away. Whatever that is causing the lag is something else.

I had all my events grouped, disabling everything from datetimesystem to collision behaviour still causes serious lag time.

edit: made a sweep of the events and etc. again, render time is about an average of 1-1.9 ms.

As an interesting point of note: I suspected it may have something to do with Layer Effects for “Night” shade, which i use for my day night cycle (all of which including my datetimesystem i may release on the forums in the future), which is necessary since GDevelop5 doesn’t have “Subtract” for Light Sprites.

But disabling the effect as well as the datetimesystem which activates at certain hours still causes the lag on mobile devices. :sleepy:

I also have lags at the start of my game for ~4 seconds on a smartphone. Sometime I will delete things and see if it gets better.
But I have another question…
It looks like GD html5 games on Itch can not run in landscape mode on iPhones. Not in Safari and also not in Chrome. So I think it’s an iOS problem/restriction and impossible to fix?
Also in the Instagram internal browser it does not work and so it’s impossible to link my game in the bio or chat.

The map is at already at bare minimum. Most of the sprites and tiles you see are either tiled or reused assets, package is relatively small overall. There’s still stuff that will go in there, a Hospital, Stores, an ATM and etc. Fortunately i wanted to test it out before i proceed. Looks like i will have to abandon the gig if i can’t find a way to solve this issue.

Not true. See my gig here:

It’s running on landscape, has no lag, but suffers from a different problem: video textures. it crashes and constantly reloads when accessed via a mobile device. Problem is still unsolved even with the latest GD builds. As such i am no longer updating/working on it.

What you want to do is at your itch.io project page:
Under Frame options → check Mobile friendly → then select “Landscape” as orientation.

The only downside with IPhone is that it doesn’t support ogg, so you can only use mp3 which doesn’t loop as seamlessly.

Sorry, can’t help with that. no interest in any of that IG/FB stuff.

I had that already set it in itch.
I don’t know, 3 of 3 of my iPhone testers said it’s not working.
I think the difference is on iOS you have to turn the Phone and on Android it always runs in Landscape if Landscape is set, even if you keep it in portrait.
A tester says your game goes in landscape but mine does not.
So maybe the Viewport dimensions is the problem?
I use in GD 1280x720 and on itch 1076x563.

If anyone here has an iPhone, maybe can test it.

Some years ago I would have told you to use crosswalk, but it is discontinued. It basically ran your js apps like cordova but instead of relaying on the phone constreuctor dependant webview it used a special mobile optimized version of chromium (the same as on pc) that was way faster when you used new technologies like WebGL or WebAssembly like GDevelop does.

I can take a look, but the link you provided is passworded.

sorry, not sure how all that is relevant. was that all for me or jack?

Either way, i am guessing the lag is probably how the engine deals with sprite size (the bigger it is, the less efficient it handles them) - mine isn’t all that big and are quite sparing and compact, though the entire map size is relatively huge (post 1080p scale wise).

Anyways, looks like this gig is dead in the water. seems like everything have to be 3d these days to avoid bs like this … in perfect honesty, something i am not all that keen of.

Another frustrating thing to add … optimizations put into place were practically useless. it hardly made a difference when seen from the profiler.

[quote]So maybe the Viewport dimensions is the problem?
I use in GD 1280x720 and on itch 1076x563.[/quote]

That should not be an issue as far as i know. as the voss link showed.

you provided the wrong link. update the link and i will take a look from both the IPhone and IPad.

Thank you.
Hm the link is correct and works for me without login on desktop and mobile.
I have removed the password now.
https://jackii.itch.io/test2

alright, i’ve got good news and bad news.

the good news is that you game definitely loaded and played fine on 2 iphones, one old and one new (IPhone X and Iphone 7). dimensions wise are all a-ok, loaded and played fine as landscape orientation. Those who claimed that it didn’t played as landscape probably didn’t even bother checking it.

the bad news is: the play button does not work at all on an IPad. note: my ipad is the older model, not the latest ones, if that helps. Either way, it loaded as landscape just fine on the IPad.

edit: both tests were made via safari. ps: don’t bother with chrome, y’all should just refuse to use it. those idiots at google just can’t help throwing ads down your throat. hence my exclusively use of apple products, as i do not wished to be shoved walls of ads when i paid for something (wink wink —> android!).

ok, i think i see what your concern is. honestly, i don’t think there’s a need to lock your game in landscape orientation, so long as your game loads fine and isn’t cutoff by a portrait shift, it shouldn’t be an issue – yours does not, so it’s fine.

i am pretty sure it’s doable via html5 (i have stuff on my Iphones and ipad that is exclusively landscape locked) though i have no idea how to do it.

1 Like

folks, please stop derailing my thread. i have an issue that needs resolving. it was alot of work putting the prototype together (yes, i made most of the assets you see there - from tiles to music). it isn’t fun seeing your own handiwork flushed into oblivion.

To give you an idea of the things that are difficult or not supported on phones because of course they are less powerful than a computer.

  • Large images over 2048px not supported (But you don’t seem to have any)
  • Large audio files. (But you have audio files that are not too large)
  • Many events that are repeated multiple times. (CPU always overbusy)
  • The shaders/effects layer (I think that’s it, try to delete them to see if they work better then you will find a better solution to replace them. The graphic engine used for effects is maybe not very optimised)
  • Collision and distance checks.
  • Physics.

I think the problem really comes from the shaders/effects layer.

1 Like

how’s it goin bro, thanks for checking it out. Yes, i also suspect it has something to do with the shaders/effects layer. I am going to take the entire thing apart this coming weekend and see if i can do stuff another way.

I do have another concern but i am probably wrong about: the way GDevelop handles a sprite/tile. i am wondering if they all link to a graphical asset if they are all the same or consider a sprite/tile a singular object to load? If linkage is not present, it would jam up the RAM.

Well…irregardless i have no idea if it is a concern. Looking at the Task Manager with a GDevelop playtest console open seems to suggest mem/cpu usage is normal.

On the lighter side of note:
GDevelop is fantastic for JRPGs! The prototype was an unfinished RPGMaker MV project from way back 2015. I just got sick of writing plugins that keeps clashing with the core engine and with each other (aliasing the plugin is sheer bs, no matter what anyone says - been there, done that.) and the insane amount of modding i had to slough through.

1 Like

Each time you load a file in GD this file will be loaded independently of others files.
Where is no spritesheet or atlas map.
All files you’ve imported are loaded one by one.

1 Like

Alright, thanks and got it. That would mean that maps have to be smaller. Going to have lots of stuff to tinker with this weekend.