This demo utilizes PlayFab for player account authentication, an Azure Function App as the backend, and Azure Tables for storage.

Key features of the demo, which are commonly found in popular RPGs, include unlocking new characters using character tokens, purchasing tokens, setting up combat layouts, simulating server-based combat, and rewarding the player.

Server Logic:

  • When a player creates an account, PlayFab triggers the Initialize Azure Function, which creates a new table for the player and assigns them four characters.
  • Upon login, PlayFab calls the GetPlayerData Azure Function, retrieving all the characters the player owns.
  • When a client attempts to unlock a new character, the server verifies if the player has enough character tokens. If they do, the server deducts the appropriate amount from the player's database and grants the new character.
  • Players can purchase character tokens, and the server sends the available purchase packages. The client can simulate scenarios like "Bad Credit" or "Invalid Package ID," and the server will respond accordingly. For valid transactions, the purchased amount is added to the player's database.
  • Players can choose their combat layout and initiate combat. The server saves the layout and responds with a seed for the combat.
  • After combat, the client calculates character experience gains and levels. The server simulates the combat using the same seed and responds with rewards such as character experience, level-ups, player points, and free character tokens.




Leave a comment

Log in with itch.io to leave a comment.