question

Andrea Tomei avatar image
Andrea Tomei asked

Ethereum integration and custom microservices

Hello, I'm developing a multiplayer game made in UE4 that needs to interact with the Ethereum blockchain. Since I'm new at backend development I can't figure out if I need to make a backend from scratch or I can use Playfab as a base.

What I need in particular is:

1) Making Playfab interact with an external application (maybe located on an Azure VM). That application would be an Ethereum node.

2) Extends Playfab functionalities with microservices tailored to my needs (e.g. a system that manage the association of equipments to each character, or another system that tracks the progression and the quests, etc.). I can't figure out how far I can go with the customizations.

Thanks for any help

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

You can use Azure Functions Cloud Script or hosted custom game servers to interact with any external service, as well as add any custom functionality you need. The caution I would give with Cloud Script is that it is time-limited in synchronous execution, so if the responses are not within one second, you'll want to use queued functions, so that they can run for several minutes if needed.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

As far as I can see from your description, PlayFab should meet your requirement. For Q2, PlayFab is able to maintain the equipment, inventory items and characters. You may store the progression and quests in many methods on PlayFab. For the commerce, you may refer to: https://docs.microsoft.com/en-us/gaming/playfab/features/commerce/. In terms of Player’s data, you may check: https://docs.microsoft.com/en-us/gaming/playfab/features/data/

I am not sure if the multiplayer needs dedicated host servers. If so, please refer to: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/. Basically PlayFab Multiplayer Server is customized on your own, which is integrated with PlayFab GSDK. You may implement Ethereum API or any other external SDK there.

In addition, if it only requires some server logic, you may consider using Azure Function, which is hosted on head-less servers. You may implement external SDK in your script. For simple server-side logic handling, Cloud Script is enough, meanwhile it doesn’t support importing external library as it is based on JavaScript V8 engine. Azure function will be more powerful and flexible.

Please feel free to tell us if you have any other questions.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andrea Tomei avatar image
Andrea Tomei answered

@Brendan

@SethDu

Thanks for the answers!

I have two other questions:

1) Is it possible to keep PlayFab equipment system in sync with an external database? In my case the real database is the Ethereum blockchain but in order to make use of the PlayFab Equipment System I think I should somehow have a copy of the main database and replicating it in the PlayFab catalogue. Anytime an item changes owner on an external marketplace (that I don't control) the ethereum database is updated, then also the equipment database on PlayFab should reflect that change. Alternatively, in the case that weren't possible, I would need to make a different inventory and equipment service that directly use Ethereum as its underlying layer. Could this custom service be smoothly integrated in PlayFab economic system?

2) And you are correct in your surmise, I also need to host a cluster of Unreal dedicated game servers, one for each match. They should be set up and shut down when a match start and end. I'd also need an orchestrating service to create and destroy VMs on demand. Can I do that directly with PlayFab Multiplayer Servers or I need Azure tools like Kubernetes?

Thank you again for your invaluable help :)

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

1) it is quite complicated to maintain an external catalog and inventory. PlayFab Catalog can only be modified by PlayFab Admin API or Game Manager.

However, I believe "Inventory" of PlayFab is the feature you are talking about. Anyway, you many consider implement PlayFab SDK on your database to make that change. Inventory items can be simply modified via Server/Admin API.

2) Yes, I believe PlayFab Multiplayer Server 2.0 can fulfill your needs. You may get started with the link I have attached in the previous answer.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.