-1

I would like to create a multiplayer game (players are in the same room) where each player has an Android smartphone and they are all connected to a Cast device (such as chromecast) which is connected to a TV (where the game is screened). Each smartphone acts as a remote controller and the TV acts as the screen for every player.

Below I present two (im)possible solutions. Please let me know if the first solution is possible (and how to implement it) and if you know the answer to the second question.

1) Scenario 1:

Is it possible to run the game on one smartphone and render the image to a Cast device, while having the other players (on other smartphones) connected to the first smartphone (giving inputs to the game)? Is there a way to synchronize the players (such as the GameManager API) in this Remote Display App scenario? (Similar question)

2) Scenario 2:

If the first solution is not possible, please let me know your thoughts on the following scenario. The game is running as a Receiver Application (hosted on Google's server and being accessed by the Cast device) and it is possible to use the GameManager API. Each smartphone is a Sender Application that sends game actions and other messages. This is the situation presented in Google examples. In this situation, does the game have to be written in JavaScript, such as SpellCast in the latter link?

Thank you for any help!

Community
  • 1
  • 1
jose
  • 220
  • 1
  • 12
  • 1
    What have you done so far? Can post your code? Try checking the [sample apps](https://developers.google.com/cast/docs/downloads) for reference. – Mr.Rebot Jul 15 '16 at 15:48
  • I haven't coded. I didn't want to start implementing stuff without proper research. And I am glad I did. I did check the sample apps, as I mentioned in my question. I posted my question also on the Google Developers forum and they replied saying that it is impossible to mix the GameManager API with a Remote Display app at this time. Since my partner decided to go with Unity for the graphical part, I am taking care of the game managing using GMS (Google Play Services), which has a plugin for Unity – jose Jul 19 '16 at 14:36

2 Answers2

1

After more research, here is the answer to my questions:

1) It is possible to use the Remote Display App for Multiplayer Real-time Games, but you can't use the GameManager API. Use Google Play Services instead. You can also try Google Firebase, or even try other platforms such as Photon, AppWarp, NextPeer, etc.

2) If you use the GameManager API you have to write your app/game in JavaScript, HTML5 and/or CSS. This has to do with the app running on chromecast. I don't know if they are looking into increasing the flexibility on this any time soon...

jose
  • 220
  • 1
  • 12
1

If you want to use RemoteDisplay APIs, then only one device can be connected to the Cast device directly and the other devices need to communicate with the first connected device using any mechanism that is more suitable for your game/application. If, on the other hand, you use the Cast SDK and the usual HTML based cast applications, then you can definitely have multiple devices connected to the cast device simultaneously, and they can communicate with each other, if desired, through your cast receiver. The second approach definitely needs a custom receiver but the first approach uses the RemoteDisplay receiver.

The advantage of the first option is the better performance; if you go with the second option, you won't be able to do anything close to a near smooth animation but for, say, a score board presentation of things that do not have much animation in them, that can work.

Ali Naddaf
  • 16,951
  • 2
  • 21
  • 28