Game Framework provides support for interactions and handling of users based on their choices and preferences. Facebook support is documented separately.
Number of Times Played
It is important to be aware of and react to the number of times that a user has played your game. You can do things like reward repeat users, or selectively prompt for a rating when you know the user has used your game many times (and so likely likes it and will give a good rating).
GameManager holds the following counters that you can access and react upon:
- TimesGamePlayed – the number of times the game has been played. Updated by GameManager on startup.
- TimesLevelsPlayed – the number of times levels have been played. Updated by LevelManager in the GameOver phase.
- TimesPlayedForRatingPrompt – a counter similar to TimesGamesPlayed used for displaying a rating prompt. The difference between this and TimesGamesPlayed is that this can be reset if the user choses a ‘Remind me later option’.
There are 4 components that work with the above to conditionally show one of two gameobjects based upon the either the number or a modulus of the number of games / levels played. These are EnableBasedUponNumberOfGamesPlayed, EnableBasedUponNumberOfLevelsPlayed, EnableBasedUponModulusOfGamesPlayed and EnableBasedUponModulusOfLevelsPlayed. You can use these for showing different content as discussed.
There are also various other components that allow you to show or enable things one time only (such as the first play) that can be useful for tutorials and instructions. These include EnableGameObjectOnce, EnableComponentOnce and RunOnce from the GameObjects section, SetBoolOnce and SetTriggerOnce from the Animation section and ShowDialogOnce from the UI section.
The GameOver dialog supports prompting for a rating and allows you to specify number of plays the rating prompt is be displayed. Automatic handling of ‘Remind me later’ and not prompting again if they give a rating is included.
Rating / Feedback
The GameFeedback class provides methods for prompting the the user for ratings. There are various scenarios to consider such as if the user triggered the rating flow themselves, and whether we can make an assumption about them liking our game based upon something such as the number of times played. Game Framework supports these scenarios with slightly different interactions tailored to getting optimal ratings through the following methods:
- GameFeedbackUnsureIfTheyLike should be called as a direct result of the users actions when you are uncertain they like the game. e.g. a static rate button.
- GameFeedbackAssumeTheyLike should be called when invoked as a direct result of the users actions when if you assume the user likes the game. e.g. a rate button shown only after a certain number of plays.
- GameFeedbackAssumeTheyLikeOptional should be called if you assume the user likes the game and when not invoked as a direct result of their actions. e.g. shown automatically after a set number of plays.
You can customise the text in all of the displayed dialogs (see the localisation section for details). The rating page as setup in the GameManager component can also be displayed by calling the GameFeedback OpenRatingPage() method directly.
The ShowGameFeedback component contains methods that call through to the GameFeedback methods discussed above. You can add this component so that you can easily hook up event handlers from UI Buttons or other sources.
When requesting feedback, consider using this in combination with the components mentioned above in ‘Number of Times Played’ so that you only prompt at suitable intervals.
If you have any thoughts or suggestions on improvements or additions to the social features then please let us know!