Intro
Nostra has some standardization to make it more efficient for game developers, publishers, and players. Game Requirements are mandatory while integrating your game into Nostra.
Game requirements
Your game must meet the following requirements:
- The game code's HTML tag or * selectors do not have CSS. It must be a class or ID-level CSS.
- The Game Events are as follows:
| Events | Description | Endless games | Level-based games |
|---|---|---|---|
| game_load | Loads 100% of the game. | Yes | Yes |
| game_start | The player starts a new game. Fire only once per game session. |
Yes | Yes |
| game_level | The player starts a level. Applicable only to level-based games. |
No | Yes |
| level_completed | The player wins a level. | No | Yes |
| game_end | The game ends for the player. | Yes | Yes |
| game_replay | The player replays the game. | Yes | Yes |
| rewarded_ad | The player opts for a rewarded ad. | Yes | Yes |
| game_milestone | The player achieves a milestone in the game. | Yes | Yes |
| game_life_end | The player loses a life in a game session. | Yes | Yes |
| ingame_transactions | The player buys virtual assets in the game. | Yes | Yes |
- The game must expose the following global methods:
| Methods | Description | Endless games | Level-based games |
|---|---|---|---|
| pauseEvent() | Pauses the game. | Yes | Yes |
| resumeEvent() | Resumes the game. | Yes | Yes |
| replayGameEvent() | Replays the game or a level. | Yes | Yes |
| nextLevelEvent() | Moves to the next level in the game. Applicable only to level-based games. |
No | Yes |
| gotoHomeEvent() | Navigates to the home screen of the game. | Yes (If the home page is available.) | Yes (If the home page is available.) |
| gotoLevel(levelNo) | Moves to the level which is passed as a parameter. Applicable only to level-based games. |
No | Yes |
| enableSound(bool) | Mutes or unmutes the game sound based on the boolean value passed as a parameter. True means unmute, and false means mute. |
Yes | Yes |
| getLoadingPerc() | Returns the game load status in percentage. | Yes | Yes |
| progressBar(percentage) | Shows the custom progress bar on the loading screen. Pass the percentage as a parameter while calling this function. Do not define this method at the window level. Call the method as follows: if(window.progressBar){ progressBar(percentage) } |
No | No |
| gameEndEvent() | navigate to either game end screen or game win screen according to the game behaviour and QA ask, to verify UI elements without completing the game. | Yes | Yes |
| setWindowTopMargin(height) | Adds a top margin to the game canvas for including the navigation bar. | Yes | Yes |
- Every game should have a viewport meta added in the head tag of index.html to improve the user experience across different devices.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> - The game supports the 20:9 aspect ratio and appears full-screen for portrait and Landscape orientation.
- The images are in PNG format and compressed using Tiny Png.
- No unused files are in the game codebase.
- The game audio files are in OGG or WebM format.
- No additional game or engine-specific loading screens and logos are in the game. Once the Nostra's loading screen reaches 100%, players should be redirected to the homepage immediately without facing an additional waiting screen.
Game Performance
-
Following guidelines impacts game performance and must be considered before Nostra Integration:
-
The maximum allotted RAM usage for games in Glance SDK is 100MB. Therefore, the game should not use more than 50 MB RAM; Nostra does not enable any game above it for low-end Android and Android-Go devices due to performance issues.
-
The game's size should not be more than 25MB. Lesser memory games work better.
-
You can use Android Profiler and Meminfo to gauge and optimize game memory usage. Perform the memory test on a 3 GB Device on the Android WebView after integrating the ad slots in the game.
-
After the integration, make sure you refer to the Integration QA Checklist to confirm if all the integrations are done.