_images/communityhub_icon.png

Community Hub

Community Hub is a global term. It represents all the elements (UI panels, technologies, features…) which help bring players together. We want to spread these concepts across all our games, websites, communication channels… in order to make the players enjoy a better experience through all the Asmodee galaxy.

Setup

CommunityHubLauncher is a required component of CoreApplication.

_images/communityhub_1.jpg

note: If you don’t want to benefit from the Community Hub in your game, simply keep the autoLaunch to false.

You can also manually call LaunchCommunityHub and StopCommunityHub methods.

Starting the Community Hub results in adding a CommunityHub component to the CoreApplication and add a CommunityHubLayout as a child.

Monitor Online Status

CommunityHub helps with monitoring the online status of your game.

  • Network Reachability
public bool IsNetworkReachable;
public event Action<bool> networkReachabilityDidChange;
  • Public Scope Token
public bool HasPublicScopeToken;
public event Action<bool> publicScopeTokenDidChange;
  • Private Scope Token
public bool HasPrivateScopeToken;
public event Action<bool> privateScopeTokenDidChange;
  • Scalable Server Session
public bool IsConnectedToScalableServer;
public event Action<bool> scalableServerConnectionDidChange;

Require Online Status

You can also request for a specific online status. The SDK will try to meet your requirements, eventually prompt the SSO to the player, then call you back.

CoreApplication.Instance.CommunityHub.RequireOnlineStatus(typeof(InternetConnectionWithPrivateScopeTokenRequiredStatus),
  () =>
  {
    // Success
  },
  () =>
  {
    // Failure
  });

Available status are:

  • InternetConnectionStatus
  • InternetConnectionWithPublicScopeTokenStatus
  • InternetConnectionWithPrivateScopeTokenOptionalStatus
  • InternetConnectionWithPrivateScopeTokenRequiredStatus will prompt the SSO
  • InternetConnectionWithScalableServerConnectionOptionalStatus
  • InternetConnectionWithScalableServerConnectionRequiredStatus will prompt the SSO

You can provide your own status by subclassing RequiredOnlineStatus.

Community Hub Content

The Community Hub can handle a set of CommunityHubContent. Provide a 2D panel and let the system automatically layout the window.

LoginBannerContent content = new LoginBannerContent();
CommunityHub hub = CoreApplication.Instance.CommunityHub;
hub.AddContent(content);
...
hub.RemoveContent(content);

Layout

Your game will run on a diversity of devices, and displayed on screen which differs in size and aspect ratio. We tried to address this variety in a way that will fit most games.

_images/communityhublayout_1.jpg

We rely highly on Preferences to detect the current configuration.

A content can be either a header or a tab. Headers are stacked from to top right corner of the screen, they are displayed as is. Tabs are resized to fit the green part presented below. If several tabs are available, a tab bar appears to choose the current one.

Red: CommunityHubContent.Layout.Header, Green: CommunityHubContent.Layout.Tab

  • Small Display Mode
_images/communityhublayout_2.jpg
  • Regular / Big Display Mode
_images/communityhublayout_3.jpg

Refer to AutoLayoutRectTransform to prevent your game’s user interface from being overlapped.

Provided content

In the Unity SDK we begin to provide applicative components to help with sharing common features across all games:

Skinning

All the prefabs are referenced through a CommunityHubSkin scriptable object. You can make you own version and provide it to the CommunityHubLauncher component. If you don’t provide a skin file the SDK default on CommunityHubDefaultSkin.asset.

Make your own content

You may consider using this system to display your own custom Community Hub Content. For example, if you want to display a game log, or a quick rules reference, it could be integrated this way.