Search Unity

Showcase Multiplayer with Visual Scripting - Playfab, Photon, and Unity Game Services

Discussion in 'Visual Scripting' started by CameronDWills, Jul 5, 2022.

  1. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90

    Store link: https://assetstore.unity.com/packag...ting/multiplayer-with-visual-scripting-226003

    Making online multiplayer games is HARD, but it doesn't have to be.

    With this asset, you'll be able to add online multiplayer features to your game quickly and easily without ever needing to write a line of code.

    This asset contains custom scripts that allow you to use popular multiplayer services with Visual Scripting, such as Playfab, Photon, and the newly released Unity Game Services!

    Also included are some demo implementations that show you exactly how you can use the nodes together to create multiplayer features such as:

    • Allowing users to register/sign-in to your came with account credentials
    • Saving data in the cloud like user progress, levels, stats, currency, etc
    • Running custom scripts in the cloud for anti-cheat server-side logic
    • Saving and loading custom variables from the cloud so you can update your game over-the-air
    • Matchmaking to automatically connect players, or form lobbies with passwords for private matches.
    • Handle in-game currency, inventories, and purchases
    • + Many more features and demos coming!
    Integrate Unity Game Services with Visual Scripting:
    • Authentication - Allows your users to register, login, and connect to your game.
    • Remote Config - Allows you to save and load variables in the cloud which you can use to update your game settings without releasing a new version.
    • Cloud Save - Stores your players data in the cloud, allowing cross platform play
    • Cloud Code - Lets you run custom game logic on a remote server to prevent cheating
    • Economy - Manages your in-game currency, items, inventories, and purchases
    • Lobbies - Allows your players to create and join lobbies, public or private, to connect players
    • Relay - Integrates with Lobbies and Netcode for GameObjects to facilitate online play
    • Netcode for GameObjects - Allows players to stay synced and send/receive data over the network for online play.
    • + more integrations coming soon!
    Integrate Playfab with Visual Scripting:

    Playfab is a service from Microsoft that allows you to use many network features in your game easily with the Playfab SDK and platform. Some of these features include login and registration, storing player data, game data, cloud scripting, friendslist, leaderboards, and more.

    This asset includes scripts which allow you to access and use all of these features with Visual Scripting. Demo implementations are also included so you can get started right away.

    Integrate Photon PUN with Visual Scripting:

    Photon PUN is a service similar to Unity's Netcode for GameObjects which allows your players to connect, stay in sync, and send/receive data between eachother for online play. A Playfab authentication integration is included in this asset, which allows you to use Playfab to authenticate your users to Photon to prevent application abuse.

    This asset includes scripts which allow you to access and use all of these features with Visual Scripting. Demo implementations are also included so you can get started right away.

    This asset is a must-have for beginners interested in adding multiplayer features to their game and those interested in learning how to implement advanced features with Visual Scripting.

    I'll be updating this asset with even more implementation demos and features soon!
     
    Last edited: Aug 1, 2022
  2. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
    Just released a new update:
    July 30 | 1.1 Updates
    Unity Game Services: Authentication

    • Added a 'DeleteUserAccount' node that erases the users account from UGS. This functionality is a requirement for iOS applications.
    • Added a 'ClearSessionToken' node which clears the saved UGS account information from the device. Important: If the user doesn't have any third party accounts linked to their anonymous account, then they'll have no way to login or recover their account.
    Unity Game Services: Cloud Code
    • Updated the CloudCode node to allow for parameter inputs. This allows you to pass data to your Cloud Code Javascript as a list (even indexes are parameter names, odd indexes are parameter values)
    • Added the ability to trigger VS custom events when Cloud Code scripts are completed, returning their result via the custom event argument
    • Added a 'CloudCodeResultArgs' struct which allows you to parse the data returned by Cloud Code nodes custom event arguments
    Unity Game Services: Economy
    • Added 'UpdatePlayersItem' node that lets you update a players inventory items InstanceData as a list, with even indexes being the key and odd indexes being the value
    • Added 'DeletePlayersItem' node that lets you delete an item from a players inventory by the itemID
    • Added a 'DeserializeInstanceData' node which outputs the saved InstanceData of a players inventory item as a string/object dictionary
    • Added 'GetPlayerInventory' nodes to return all of a players inventory items, or a items that contain any ID's in a defined list
    Unity Game Services: Lobbies
    • Added a ConnectionPayload script to show a very basic implementation for passing data through Lobbies
    • Updated the 'DeleteLobby' and 'LeaveLobby' nodes so that it stops the lobby heartbeat and stops listening to connection callbacks
    • Updated the 'CreateLobbyWithRelay' node to output the LobbyCode as a VS custom event argument if the lobby is marked as private. Useful for displaying the lobby code to the user so they can share it with other players to join the private lobby
    • Added a 'JoinLobbyByCodeWithRelay' node that allows a user to join a private lobby using the lobby code
    Asset Bug Fixes
    • Fixed a serialization error with one of the demo script graphs
    • Added the full UGS implementation demo state graph to the demo scene UGS gameobject
    • Added the missing 'WaitForTaskToComplete' subgraph, which is useful for waiting for UGS tasks (or any other 'task' function) to complete before proceeding since Visual Scripting can't use async functions.
     
  3. TimHermelink

    TimHermelink

    Joined:
    Jan 20, 2022
    Posts:
    14
    Hi, is there also a solution for using LAN related connections?
    LAN is basically hosting a server on a wifi router.
    It is free of cost and usefull for testing multiplayer
    So, can you do this in visual scripting?

    Thanks.
     
  4. CameronDWills

    CameronDWills

    Joined:
    Feb 26, 2021
    Posts:
    90
    This asset uses the Unity Transport, and I'm pretty sure you can configure it to support a LAN About Unity Transport | Unity Transport | 1.3.0 (unity3d.com)

    The logic you'd program with visual scripting would be identical