• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

The function game_end() is disabled on Android and iOS

Andrey

Member
In the latest version 1.4.1788 there was a change to the function game_end(). Now it does not close the application on Android. This is described in the change report.

However, I have a question, how do I close the game programmatically in a mobile application? Some users (including myself) prefer to "exit the game".

Will there be alternatives to this function?

And is it worth expecting the same changes in GMS2?
 
  • Like
Reactions: HW.

Nocturne

Friendly Tyrant
Forum Staff
Admin
However, I have a question, how do I close the game programmatically in a mobile application? Some users (including myself) prefer to "exit the game".
You can't. Recent updates to Android disallow this, and it was never permitted on iOS.

Will there be alternatives to this function?
Yes. There will be a function to force the app into the background.

And is it worth expecting the same changes in GMS2?
Yes.

:)
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Also see: this 9-minute video on official Android Developers channel that discouraged this behaviour back in 2012. While Android had only finally outlawed this anti-pattern recently, other platforms weren't as nice - for example, on Windows Phone / Windows Store, your application could be rejected for having an Exit button or not allowing the user to safely back out of the application by pressing hardware Back button one or more times.
 
H

HW.

Guest
In the latest version 1.4.1788 there was a change to the function game_end(). Now it does not close the application on Android. This is described in the change report.

However, I have a question, how do I close the game programmatically in a mobile application? Some users (including myself) prefer to "exit the game".

Will there be alternatives to this function?

And is it worth expecting the same changes in GMS2?
That is my concern too as i have been doing that exit routine on Android for years just like doing it like on task manager on Windows lol. Just today after watching that YouTube video, i have the knowledge, omg. However, on the comments section of the youtube video there, someone also mentioned that 80-90percent of users including devs also didn't know about it, lol.

My games developed by GMS2 also using game_end();. I don't use exit button on gui, but I always insert it on backspace key press command (which is the backspace key press on Android is regarded as the physical "Back" button. If i don't use it, whenever i tap the back button, the game doesn't want to go into background! I hope YoYo team give us a solution for the alternative function to make the game going back to background safely, if not, how can the players end the game session?. And Does the engine/runner if already on background, not drain the battery/memory? Is it already minimalist already if no game_end?
Yes. There will be a function to force the app into the background.
Yes, that is very important, to be included when playing pressing the back button like YAL said:
allowing the user to safely back out of the application by pressing hardware Back button one or more times.
Thank you YoYo team for updating, and i can't wait for the 2.1.4 version of GMS to come soon along with those updates too. I read the 1788 release notes, it has already sdk 27 and ndk 16 support, oh Yes.... but we're looking forward to the new function for "game_end substitution to force app into background" on Android.

However, i have a question, if the game_end is ignored, then is it okay for the code to be included if i forget to remove the code? no crashes when compiled/played? or it does nothing like being commented // ? In the case if there is still not a new function to substitute, so the player only has one way to end game session by pressing the home button to exit which might still give the unsatisfying doubt feeling of the background app still draining memory or battery on his device as what most average users being taught by Windows environment for years lol?
 
S

Smarty

Guest
@Nocturne and I assume also @Mike :

So, to summarize, the latest beta ignores game_end(). But, pressing the hardware back button (which is triggers a backspace event in GM:S) does nothing and though we can give it an action, we can no longer use it to end the game. This means the user has to escape using the home button, and then optionally switch to the active app list and throw it out. That doesn't sound good.

Can we expect another beta update that includes the force-to-background before this all goes into stable? It doesn't sound like we want the ignored game_end() without its required counterpart.

In fact, why not simply make game_end do the force-to-background? That would be the least breaking change as everyone can keep relying on their existing use of game_end().
 
Last edited by a moderator:

gnysek

Member
@Nocturne and I assume also @MikeThis means the user has to escape using the home button
As game is fullscreen, and some phones doesn't have physical buttons, this may be hard. Swipe from top of screen should display button then, but I'm not 100% sure it does it on all phones, and users may not know that it's possible...
 
S

Smarty

Guest
As game is fullscreen, and some phones doesn't have physical buttons, this may be hard. Swipe from top of screen should display button then, but I'm not 100% sure it does it on all phones, and users may not know that it's possible...
Yes, it's an all together unacceptable solution, even without the virtual buttons. Making game_end() force the app to the background on mobile devices sounds like the best backward compatible solution to me.
 

RizbIT

Member
so now in 2018 can we still not use game_end() to exit for minimise and Android app?

it very strange as some apps the game_end() works!?

is it to do with build tools version or something?
 
H

HW.

Guest
I think that in 2018 we will be able, but when, - the question.
Priority is low: https://bugs.yoyogames.com/view.php?id=28925
I hope this problem will not be taken to the coming soon GMS 2.1.4 or any released stable version.

Please include the new function or do not release the 2.1.4 yet, YoYo team.

We do not want to wait for a longer time, as we know you don't update regularly in a short interval. I say this when it is not released yet, so you can include it.

Please include the solution and if done then you can release it, so that no more 2-4months of waiting again later (unless the new update is done every week)! Thanks.
 
H

HW.

Guest
Just read a good article by Google developer regarding this "game_end" case, might probably worth reading for you:

Who lives and who dies? Process priorities on Android

The 2016 post talks about the "app" in general, not specifically a "game". But, from what i observed in 2018, almost ALL top android games studios, the AAA, ranked 1-100 of worldwide (with 1M+~100M+ downloads) still use the end game (exit) on their games (not send to background). I don't know why. Any insight please?

But, i am sure we do know most players do really want: not to be "trapped" in an app especially a mobile game. Yeah, the phone is also used for other work related activities, social media, communication, etc, not just gaming.

Please include the solution on 2.1.4, send to background is better than nothing, or at least don't "kill" the game_end yet on Android, especially IF* (*out of my knowledge, note**) it doesn't give error on "Android" and was just on "iOS" (just guessing? cmiiw),

~from what i read on the Docs only iOS crash? ... Android fine?

With this function you can end the game (and the Game End Event will be triggered). This will not happen instantaneously, but rather at the end of the current step, so any code you have in the same step after this function has been called will still run. Please note that this function has the following restrictions:

  • It will report an error on the Windows UWP and iOS modules as it is against the conditions of their respective Marketplaces.
  • It will silently fail on the HTML5 module.
  • It will work on Windows (including Steam Workshop), Windows Phone, Android, Linux and Mac.
...docs .vs. 1788 release notes)

**Note: regarding 1788 change: on my android devices game_end never give any errors at all so far, up to 1.4.1763 (stable version i use so far) and on gms 2.1.3 so far, game_end on android is fine on my end, that's why i concern with the 1788 change that doesn't seem broken on android, being afraid of it to be killed too on 2.1.4 because players need it, players use it, players want it, if it is not broken of course. But if broken, i give up to make them happy, so it is okay to be replaced with a new one rather than nothing.

new one coming soon:
https://bugs.yoyogames.com/view.php?id=28925

Recent updates to Android disallow this
While Android had only finally outlawed this anti-pattern recently
@Nocturne @YellowAfterlife I am sorry, could you please take me (url link) to that official note about the updates of the new rule, please? from which of their blog channel/page, i missed the news :( recently in 2018?
 
Last edited by a moderator:
J

jackhigh24

Guest
@Andryey shouldn't you mark this thread solved if they have resolved it by changing game end to force to background instead now
 

Khenshiro

Member
https://bugs.yoyogames.com/view.php?id=28925

They indicate the problem as "fixed"
But "send to being a background task" is not "closing the application". So that's not "Fixed"!
To leave an app in the background is to use memory and energy unnecessarily ...

All my games have a menu to go out and use this function ... In short, they removed a basic function and more than useful because they are not able to solve a bug.

Given the importance of the "game_end ()" function, I think it really unacceptable.
 

FrostyCat

Redemption Seeker
https://bugs.yoyogames.com/view.php?id=28925

They indicate the problem as "fixed"
But "send to being a background task" is not "closing the application". So that's not "Fixed"!
To leave an app in the background is to use memory and energy unnecessarily ...

All my games have a menu to go out and use this function ... In short, they removed a basic function and more than useful because they are not able to solve a bug.

Given the importance of the "game_end ()" function, I think it really unacceptable.
I suggest that you read this post and this post from earlier in the topic. YoYo is forced to remove the functionality because closing down explicitly is now BANNED on the latest and upcoming versions of Android. Unlike desktop platforms, the OS controls when applications close down on iOS and Android, and a fully backgrounded task does not consume additional resources beyond OS upkeep.

If you insist on being the old dog that can't be taught new tricks, fine, but don't whine if this means Google Play will be unshelving your work. YoYo and the rest of us have every right not to force ourselves down to your level.
 
S

Sam (Deleted User)

Guest
I suggest that you read this post and this post from earlier in the topic. YoYo is forced to remove the functionality because closing down explicitly is now BANNED on the latest and upcoming versions of Android. Unlike desktop platforms, the OS controls when applications close down on iOS and Android, and a fully backgrounded task does not consume additional resources beyond OS upkeep.

If you insist on being the old dog that can't be taught new tricks, fine, but don't whine if this means Google Play will be unshelving your work. YoYo and the rest of us have every right not to force ourselves down to your level.
Posts like this shouldn't be allowed. While I agree with what you are trying to communicate. You are treating the user like a mindless animal. You do stuff like this a lot, and I would appreciate it if you toned things down a bit in the future before posting.

I'm not a staff member so the most I can do is ask.
 

Llama_Code

Member
Posts like this shouldn't be allowed. While I agree with what you are trying to communicate. You are treating the user like a mindless animal. You do stuff like this a lot, and I would appreciate it if you toned things down a bit in the future before posting.

I'm not a staff member so the most I can do is ask.
While @FrostyCat can tend to be a bit...well... frosty.... you have to admit it's sometimes frustrating when the answer is there for all to read and is ignored.

@Khenshiro's post comes off as if this change was the fault of YoYo Games, when clearly this is Google's doing and YoYo Games are just trying to be compliant with the latest standards. So yes, it IS fixed. It would also do you some good to learn just exactly how Linux operates vs a Windows environment. Apps in the background are more in stasis, and are not really running in the strictest sense, so they don't use any additional resources or battery. In fact, constantly closing and reopening apps will drain more battery than just leaving it in the background. This myth has unfortunately been perpetuated by the popularity of useless task killer apps.

The largest battery drains for phones are Wifi being on when no connection is available, bluetooth, weak cell signal, screen brightness to high, and in the case of Android unnecessary widgets with their constant updating and animations. For Wifi, BT, and Cell signal many people underestimate how much batter the constant scanning can use.
 

Khenshiro

Member
I suggest that you read this post and this post from earlier in the topic. YoYo is forced to remove the functionality because closing down explicitly is now BANNED on the latest and upcoming versions of Android. Unlike desktop platforms, the OS controls when applications close down on iOS and Android, and a fully backgrounded task does not consume additional resources beyond OS upkeep.

If you insist on being the old dog that can't be taught new tricks, fine, but don't whine if this means Google Play will be unshelving your work. YoYo and the rest of us have every right not to force ourselves down to your level.
Let's be clear: The reason explained by YoyoyGame in the note of the Version 1.4.1788: https://www.yoyogames.com/downloads/gm-studio/release-notes-studio.html is:
'following crash logs that indicated this was causing memory corruption and crashes in subsequent runs of your app'
In case you have not read it, the complete sentence is as follows:
'Changed game_end() to be ignored on Android and iOS, following crash logs that indicated this was causing memory corruption and crashes in subsequent runs of your app'

For the argument "to make it adapt to the Android futur versions", it could be more useful to find a solution for all those who have already developed several games and who use the function regularly instead of removing it without warning.

Also, you can find all the arguments you want, the possibility to exit program is fundamental.

I may be an "old dog" as you say. But even if put a program in background mode is for you a solution. this is not the case for me. Exit is Exit and not put on standby.
Ending up with a collection of awaking programs that have to be removed from the list one by one to permanently shut them down is not a good solution.

However I admit that this way of proceeding is a problem with Android and that YoYo Game is not responsible for it. For this reason, I apologize for my response that may have seemed aggressive. It's just that I'm upset to have to adapt my previous programs that worked very well with the feature as it existed and that ALL my games have option...


Also I do not use Windows Store yet to place my programs and I apologize, I am not aware of the regulation to this subject, but, I would like to know where you found the information that explains that Windows Store can reject a project because there is an exit button. This is an option that allows the user to safely exit a program ... so this information seems very contradictory.
But it's true, I'm an old dog who refuses to adapt to current "tricks" (well ... M. Reto Meier's explenations date from 2012 anyway...).


And finally, it's only about me but if this feature removal is also to align with iOs, then it's really sad.

PS: I am from the old school indeed but I like that I click on a button to exit a program, the program closes for good. I do not think that wanting it to continue in this way is abusive

Posts like this shouldn't be allowed. While I agree with what you are trying to communicate. You are treating the user like a mindless animal. You do stuff like this a lot, and I would appreciate it if you toned things down a bit in the future before posting.
I'm not a staff member so the most I can do is ask.
Thank you.
 
Last edited:
S

Sam (Deleted User)

Guest
You're welcome.

As they already explained it is being removed from the OS itself on Android, and on iOS it never worked to begin with from what I can tell, for the same reason, only on iOS there never was a real way to force an app to close to begin with.

YoYoGames is only responding to what they can't do anything about, by preventing crashes and preventing apps from being taken off stores. If you really need this feature, consider adjusting to the new functionality that makes the app go to background processes. I thought about making an extension that does this for you, but it would only work on older versions of Android that not everyone has anymore. That is, I can't do it even then, because they probably removed it from their SDK altogether by now. Even if it did work, you would have to publish your app on somewhere other than an appstore that doesn't allow such things.

Try to understand, it may be disappointing you need to make minor changes to your title screen, but there is nothing else that can be done. :(
 

Khenshiro

Member
Thank you, I understand and I still want to apologize for my little shot of anger but it must be admitted that this change is really annoying ...

Even if I find it aberration that it is a function which is not allowed for the programs distributed on the appstore, I will deal with it
 

zbox

Member
GMC Elder
But "send to being a background task" is not "closing the application". So that's not "Fixed"!
To leave an app in the background is to use memory and energy unnecessarily ...
This isn't how applications on mobile function though - The OS doesn't care whether the user told it to close or not, if it is not in the foreground and it needs the resources, it will take them regardless. So "closing" the application is a redundant way to think about it essentially.

Unused ram is useless ram!
 

Khenshiro

Member
I come back as the old dog that I am... Maybe it does not work like that on iOS because it suits them well that we do not know how to close their applications at Appel that we used to let programs run (even if not in priority) rather than close them.

After all ... When we install one of the programs downloaded on the paly store (i suppose it is de same thing on Appel store... I do not know, I do not use Appel materials ... tell me if i'm wrong), the first thing asked to us is the options we must accept to install the program ... Like geolocation, our media files access (pictures, videos, ...), possibility to send mails or other ...

A whole series of things that, it seems to me, are not necessary to play with a simple game ... (who will read the regulations and what imply these permissions?)

So, either I am very paranoid, or many people find their interests to be in this naivety but close an application does not cause a crash if no other program uses what has just closed.

So we can ask ourselves the question:
Does it not just be a way to force people to keep open applications without creating suspicions by claiming a technical cause to spread the story?

I accept to believe the applications in background does not take memory or resource (or very little), but nothing guarantees us that certain functions are not disabled. A kind of surveillance to study what people prefer, the places they frequent, ... connected on the net, any information can be sended without any realizing it... (Always because very few people really understand the implications of the permissions that are given when installing a program. And this is a very current sad reality.)

Certainly in order to know what to sell them and to encourage them to buy anything and everything Even if they do not need it ...

It is, in my opinion, purely commercial and a very great intrusion of people's private life...

You're will call me "paranoid", "idiot", "old man who does not want to adapt", and more...
But find just one real good reason that getting out of a game or application is a security problem or cash reason of the system ...

Seriously...

(I do not imply YoyoGames in what I just said of course)

Clearly, since the time that Android exists, if exit of an application caused so many problems, it would have been a long time since this possibility was removed.

Anyway...

@YoyoGames
A simple question (return to the main subject): When will the game_end () function updated be available?
 

zbox

Member
GMC Elder
So you want to be able to force kill your own app so that you can guarantee yourself it isn't spying on you... ?

Okham's razor suggests that Apple disallows programmatically closing the app so that users can only know one simple way to exit the UI - pressing the home button, and that behaviour is consistant, rather than finding the exit button in every single apps different UI. Not a mass conspiracy to take pictures of you using your phone ;)
 

Khenshiro

Member
So you want to be able to force kill your own app so that you can guarantee yourself it isn't spying on you... ?
it was not a joke ???

Ok, sorry ... I was not talking about my applications. I was talking about other we download and requires us permissions that have nothing to do with their uses.
it's still strange. No?

Also, the fact of not being able to close them completely, it is perhaps a trick on the part of Apple and now Android to make avreyone think is it normal and that one does not even ask the question.
What is the point of leaving an application open in the background without the user being aware?

So, not to allow to close simple application that people like us create under the pretext that it causes crashes or that on iOS it was never possible,
Is this not a way to hide a commercial reason and be certain that nobody will close an applicatoin which does not serve the user but which serve Appel or Android?

That's all I said ...

I know, it's paranoid but the question is legitimate...
 

Khenshiro

Member
But we do not give the choice to the users! The majority of users does not even realize that the applications are still there! ... Do you think that's normal? good for you!
I think it's abnormal and serious...
 

zbox

Member
GMC Elder
I think it's abnormal and serious...
Well... it isn't. If you're worried about this sort of stuff you should not have a phone at all. Worrying about closing apps is more of a "superficial" response. The real privacy invasions happen by you just carrying the phone around at all, closing apps to give you the sense that they won't operate any more does not help in a practical way. They still run processes in the background, not to mention your OS in the first place has unprecedented control over your data.

TL;DR, if you're worrying about closing apps, you're missing the much, much bigger picture.
 
G

Gabriel Amici

Guest
Ok, summing it up...? What is the conclusion of all this? Should I just use the game_end() function in Android's back button and just let iOS users clich the home button?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Ok, summing it up...? What is the conclusion of all this? Should I just use the game_end() function in Android's back button and just let iOS users clich the home button?
Yes, this is correct... Note that Apple don't permit you to close your app, and, tbh, I wouldn't even worry about using it on Android. People that use mobile don't generally worry about this kind of stuff and will force close the apps themselves when they want, although even that's not recommended.
 
G

Guest

Guest
People that use mobile don't generally worry about this kind of stuff and will force close the apps themselves when they want, although even that's not recommended.
That's what I thought, then the very first piece of feedback I got after distributing my game to a few people for testing was, "back button doesn't work?" ... I was very happy YYG had recently fixed the game_end() function, so I could just add a persistent object with the sole purpose of listening for the back button.

It's painful to watch people use their phones, sometimes. I'm like, "Wtf, you don't know how to swipe? Surely you know how to swipe. Okay. Yeah, no I guess not. Guess I'll tweak the drag-time microseconds a little more."

To shoot in my game, you swipe in a direction, and your avatar fires a bullet. You don't need to swipe the avatar, but people seem to instinctively want to do that. So, I changed the box in the tutorial to say "swipe anywhere on the screen to shoot." And then I watched the next new person play the tutorial, read the box, and shoot only by swiping the avatar.

So, so painful.
 
Last edited by a moderator:
S

Sam (Deleted User)

Guest
lol reading back on this thread i kinda overreacted to frosty cat considering some of the stuff i've posted recently.

Back on topic, I'm surprised this is still being talked about. I didn't read the new posts but shouldn't this be considered resolved by now?

Edit:

Recently buying mobile I just read and noticed the back button details and that is quite good to know actually, I'm glad I saw this topic.
 
Top