Skip to main content

Harness Compatibility

Joyride Methods

Joyride Methods

To ensure clear communication between Mini Game and Native Harness

Unity Project

  • Commit/backup all your changes in unity project

  • Download Joyride unity file archive. Unarchive it in the Assets folder of your unity project

  • Open command line in Assets/JoyrideUnityFiles folder

  • Run sh JoyrideUnityFiles.sh <is_photon_used>. Replace <is_photon_used> with 0 or 1.

  • It will copy joyride unity files into the current unity project and change some unity editor/project settings

  • If the last step runs successfully, save the new changes(except archive file) in the project after reviewing, else fix the issues in the last step.

Type of Methods

We have 25 methods which are spread across four verticals - Basic, Multiplayer, GameAI, and Tutorial

  • Basic - Methods used for communication between minigame and harness

  • Multiplayer - Methods used for handling synchronous multiplayer games (ignore in case of async games)

  • GameAI - Methods used for calling GameAI with different skill levels (optional)

  • Tutorials - Methods used for in game tutorials. (optional)

TypesMethodsBasicsMultiPlayerGameAiTutorial
Game StartgameConfigs
Restart
OnRestartCompletion
OnMatchFailed
StartGamePlay
OnGamePlayStarted
Game Score
calculateScore
JRUpdateScore
JRUpdateGameAIScore
getUseridToRankMap
getGamePlayStatsOptional
getStats
OnStatsReceived
Disconnection
CleanUp
OnDisconnected
OnGamePlayEnded
OnPlayerStatUpdated
OnGameAIGamePlayEnded
OnGameResultMessageReceivedOptional
ShowResultScreenOptional
Tutorial
LoadTutorial
OnTutorialLoaded
OnTutorialSkipped
OnTutorialCompleted
OtherPause
ResumeGame
MuteStatus
Appendix B - API

Mandatory to call under each vertical. Details of them are added in Appendix B - API

Method Implementation

  • Create a C# script in the format **JRGameName**. Replace GameName with the game name used in game ID

method

Example

If game id is Joyride.SuperStack, the script name should be JoyrideSuperStack.cs. It should subclass the JoyrideGame.cs class. Override abstract methods of JoyrideGame.cs

  • Search the below setting
gameConfigs["SolitaireGame.unity"] = new GameConfig("SolitaireGame.unity", "Solitaire.JoyrideSolitaire", ScreenOrientation.Portrait, false, 2);
  • Add equivalent for your game inside GameConfig.cs to populate a new entry in gameConfigs dictionary. Remember to use the scene's addressable name

  • Follow steps as in Appendix A - Addressable Setup when making addressable groups

  • Refer Appendix B - API Reference for detailed notes on methods and parameters passed

Harness Compatibility Testing

  • In the game project, Go To File > Build Settings . Select Android/iOS Platform and Click Switch Platform

  • In Player Settings, append TESTING to Scripting Define Symbols under Other Settings. This enables testing code

Note

Do not remove ‘SINGLE_GAME’. Undo same after testing is completed

  • If USING_PHOTON is not added in Scripting Define Symbols and GameArchType is RemoteEventBased, then Photon will be used for communication during testing. For this, append ‘USING_PHOTON’ to ‘Scripting Define Symbols’ under ‘Other Settings’

  • Copy the Photon folder from the downloaded joyride unity archive file into the Assets folder of unity project. Undo same after testing is completed

  • Delete content of ServerData Folder

  • Build a local bundle from the Tools/MyTool menu. It is assumed that an addressable group(set as default) is made

  • Copy ServerData folder’s content into Assets/StreamingAssets folder

  • Assign the json file name of generated addressable bundles into the testAddressableLocation variable of JoyrideGame.cs and Save it

  • To test multiple configurations of the game, change in-game parameters in either JoyrideGame.cs file(#region Testing) or use the pre-gamestart UI to change config parameters in run time. One important parameter is testSceneName, to which scene’s addressable name should be assigned

  • If the value of TestingPlayerCount is greater than 1, then copy the content of JRUnityIntegrationTestBase project in (TestingPlayerCount - 1) more folders. Value of TestingMyPosition should be different in each folder

  • Launch Unity from each of the JRUnityIntegrationTestBase project folder, and run your game(by running LoadingScene.unity) in each instance of unity editor

  • Take a pass on info/warning/error logs and UI in unity editor

Limitations

Running the unity project as an app on Android or iOS platforms is currently not supported