I beg you for advice, and what I could do to optimize the Android game.
since my game is almost over, I’m trying it out on my smartphone now. however game lags, when a player moves game lags every few meters (pictorially explained).
so lags is happening only when the player is moving.
the game’s resolution is 640x360, I’m just not sure which settings from the image below are the most optimal.
if I choose the second option: nearest. then it suggests that I need to turn off the smoothing option for all images. can this option affect the operation of the game?
does FPS should be 60 for maximum or ?
otherwise the size of my PNG images are mostly a couple of kb, or even less than 1kb for all objects
like enemys, buildings etc…
so I don’t know what I can do to stop lags in game.
Just an observation - you’ve got 2 repeat for each enemy in that screen shot. If you have a number of repeat blocks, they could contribute to lag. I suggest that you filter the objects you are repeating over first, and then repeat over that subset of objects.
Take for example that raycast check. You are raycasting for all enemies, every frame. But the raycast distance is only 650 pixels, and all that gets done is object variable Alerte is set to 1. Ideally you should only do the raycast on enemies who are within 650 pixels of the player and have an object variable Alerte that is not 1. So do a normal event with these conditions, then have the raycast as a subevent.
Secondly, you should try to group events with the same conditions and use subevents on them. So from this :
to this :
I’m just using this as an example. The difference that would make is probably negligable. But with more processor hungry conditions, it has an accumulative affect. By reducing the number of conditions, it may help speed up the game.
Thank you for the explanation. I’ll make those corrections.
please can you tell me how i should write raycast ?
How to do only the raycast on enemies who are within 650 pixels of the player ?
purely out of curiosity, I deleted everything from the raycast.
after that i did the export for Android.
but game again lags without raycast.
therefore raycast is not a problem…
i have done a screen record, please see:
when I move, occasionally lags in the same way like before
That’s not lag. A lag is a slow down or a pause in the display. What’s in the video appears to be a bit jerky, like it’s correcting or taken a jump in camera movement.
How are you moving the player - platformer behaviour, or a set number of pixels per frame?
Try different devices and try different exports, but don’t try duplicate topics.
The game Vai Julietta had a similar issue, I believe. Check if/how it was fixed.
i can share my files. but you need to test it on Android smartphone.
because my game has only problems on smartphone.
as on computer works normally.
if you can test it on smartphone, please tell me
and i will send you download link
Unfortunately, I’m unable to notice any issue on my own mobile phone.
It’s very smooth, both as apk and in network preview.
@IttaloXD
Hi!
Did you eventually find the culprit to the performance issue you were having with your Vai Julietta game? I suspect @bundyboy is having the same problem.