Edward's Tech Site

this site made with Next.js 13, see the code

FORAY: Jul 31, 2024 - csharp
Get to know Beamable and get a Beamable microservice running online
  • background
    • for a project, I will be using Beamable to host C# microserices for online games and gamification sites
  • goals of this foray
    • get to know the Beamable platform, its ecosystem, common tools, what it's mostly used with, etc.
    • get back up to speed in C#, it's been a number of years
      • preferably in .NET Core with VSCode (i.e. without Visual Studio)
    • get a Beamable microservice running online
  • infos
    • Beamable
      • cloud-based platform and gaming SDK
      • allows you to integrate live services into your games
      • features
        • live services integration
          • leaderboards
          • cloud saves
          • player data storage
          • player authentication
        • in-game economy
          • in-game stores
          • currencies
          • virtual goods
          • monetization
        • social features
          • player profiles
          • friends lists
          • multiplayer matchmaking
        • analytics
          • player behavior
          • game performance
        • content management
          • updates
          • live events
        • cloud infrastructure
          • use as backend
        • ease of integration
          • has SDKs designed to be easily integrated into games developed with e.g. Unity
      • how it works
        • integrate the Beamble SDK into your game
          • most commonly games that use Beambale are built with Unity
        • use Beambles backend services via the SDK
        • use the Dashboard to manage game settings
  • signing up
  • background info on the two SDKs they have
    • Unity
      • 2005 created
      • company: Unity Technologies
      • 2D and 3D games
      • language: C#
      • user-friendly interface
      • a game development engine and IDE that developers install on their computers
      • free version: Unity Personal
      • ../unity.comhttps://unity.com
      • better for beginners: C# is most definitely easier to learn than C++
    • Unreal Engine
      • 1998 created
      • company: Epic Game
      • languages: C++ and Blueprints Visual Scripting
      • "most users found that Unreal Engine has a slight edge over Unity in the quality of its visual effects"
  • site
    • Solutions
      • LiveOps Portal
        • build and deploy content error-free without engineering
      • Serverless Game Backend
        • you don't need to manage or even be aware of the servers
        • can author and debug code using the same tools, editors, and IDEs you’re used to
      • Unity SDK
        • Everything is connected and just works
        • One-Click Publishing
      • Unreal SDK
        • SDK will make full use of Blueprints to enable low-code implementation
        • can have a functioning account in Beamable with zero lines of code
        • don’t have to learn Beamable-exclusive things to get started and become productive
      • Beamable private cloud
        • local version of Beamable
        • request a quote
      • decentralized
        • taking the decentralized “Private Cloud” edition of Beamable, and integrating it with a node-based blockchain architecture that will enable thousands of node operators to contribute services back to commercial game developers
        • Beamable containers allow flexible microservices to be executed, which can include custom C# game logic
        • routers are API gateways that link games to the containers capable of delivering the appropriate quality of service (QoS) they need
        • validators are a decentralized network of nodes that check the containers to confirm that they deliver the workloads they report
        • Distributed Actor System
          • allows for workloads to operate closer to where users are
        • Microservices
          • can run anywhere on the internet (your own developer workstation, hyperscalers, edge nodes, etc.) and bind to the Beamable Network
        • Live Marketplace
          • allows developers to easily adopt packaged Microservices, and deploy them to their environments in an adhoc manner
      • Web3 integration
        • Web3
          • decentralized web
          • a new iteration of the internet that leverages blockchain technology
          • enables peer-to-peer interactions without intermediaries
          • decentralized applications (dApps)
          • cryptocurrencies
          • smart contracts
          • promotes user control over data and digital assets (instead of being in the hands of large corporations)
          • gained prominence after 2015
            • accelerating around 2020 as blockchain technology matured
      • Migrate from Microsoft Azure Playfab
        • PlayFab = 0.56% market share
        • Beamable = 0.02%
        • take control of your scheduling, testing, and operating Live Events
        • drive engagement and ARPDAU (Average Revenue Per Daily Active User)
        • Daily Active Users (DAU) at one million
        • Optimized for Unity
          • offers the unique ability to write C# client and server code in a unified developer workflow eliminating the need for complex game server integrations
          • never leave Unity again
      • Co-Dev and implementation
        • expert backend developers can add Beamable to your Unity or Unreal project
    • Pricing
      • Free up to 100k API calls per month
      • MAU = Monthly Active Users
      • free tier
        • Beamable is free to use for game development up to 100,000 API calls per month
        • this should be plenty for any individual developer to conduct a full feature analysis of Beamable and decide if it will work for a commercial project
        • single developer license
        • three instances of a microservice to learn about our serverless game tech
        • Discord support
        • as you scale your game development and you cross the monthly API amount
          • our customer success team will reach out to move you up to
            • Indie, Dev, or higher tiers based on your needs
    • Marketplace
      • connecting live services modules that easily snap together like building blocks–game developers can easily compose powerful online games with all of the monetization
      • ca. 20 microservices to use
    • Resources
  • Documentation
    • Microservices
    • using Beamable C# microservices with React
      • adding HTML sign-in
        • auth can be done wholly without C#MS, just using Beamable as the authority for player authentication
        • this example is JQuery, need to convert to React
        • sample HTML sign-in does not persist the auth data (the tokens)
          • so use standard webapp storage mechanisms to store the access token (which has a 10 day time to live) and the refresh token (which is good indefinitely)
      • C# microservices
      • Some key concepts for using the Beamable REST API directly:
        • every request needs to know which Beamable realm it is operating in; this is expressed in the X-BEAM-SCOPE header, which is a dotted pair of your numeric customer ID (CID) and the realm's project ID (PID). As an example, the header for my dev realm looks like X-BEAM-SCOPE: 1434605640884224.DE_1434605640884225
        • the vast majority of requests need to know who is invoking them; this is expressed via the Authorization header in the form of a bearer token (the access token, a UUID); an example from my dev realm, a guest account: Authorization: Bearer b9e9dcec-7435-471f-94d6-6ab1412371b2
        • all Beamable REST API routes respond with JSON
      • explore the OpenAPI spec for the REST API at
      • the way Beamable handles identity credentials
        • founded upon a mobile-first philosophy
        • players are expected to play for a while with frictionless, anonymous accounts before they opt into registering email/password or 3rd party credentials
        • the pattern is:
          • create a new account with the "guest" grant type, and store the access_token
            • as long as the device still has their access_token and refresh_token, they can keep playing anonymously forever
          • when/if the player feels like it, use the POST /basic/accounts/register route to attach email/password, or PUT /basic/accounts/me to add third-party credentials
          • if the player's access token is nearing its ten day expiration, you can use the "refresh_token" grant type to get a new access token from the refresh token
  • Tutorials
    • nnn