Wednesday, March 8, 2017

Google Cloud Platform with Unity

Leave a Comment

I was thinking of Google Cloud Platform (GCP) as the backend for Unity.

Can someone guide me to develop the GCP flow as authoritative, like if a request comes for deducting X gems to convert into the amount, then GCP get gems conversion rate from metadata, calculates the amount and increments amount in the user gamestate, also returns the new total balance as a callback [Remember: metadata/gamestate is saved in MongoDB (JSON)]

As i worked with AWS servers, so i want to know how to do it in GCP.

Any help regarding this will be appreciated

2 Answers

Answers 1

If you're looking to run a server in the Google Cloud, you must remember that Unity is just a piece of software, with full access to C#. This means you can utilize the entirety of the .NET framework, Mono, .NET Core, or whatever other C# libraries to accomplish whatever task you wish.

The simplest method of getting a server running, as I've seen it done before, is to use NodeJS. NodeJS is pretty fast, and I had a friend have working multiplayer using NodeJS alone. This means that you can get a backend working without much effort, ASSUMING you do not have to also have a website pulling data off of this. This would be where I'd start with that endeavour.

If you want to stick to C#, there's another alternative called ASP.Net Core. Microsoft recently released something called .NET Core, which means that you can run .NET (sort of) code on Linux, Mac, etc. Either way, with C#, you're going to be needing to make post requests via Unity to the web server, and process the returned JSON.

And finally, if you want to stick to C#, but not use ASP.Net core, you can always just use sockets, or write your entire web server from scratch using a technology of your choice.

But, the most important thing you should take away from this is that Unity is capable of running C# code as software itself, outside of the game. All .NET code is accessible, for example, if .NET is installed on the machine. This means you could, theoretically, set it up with Mono, and use Mono instead. Unity is just an engine processing graphics, physics, and input entirely for you, with a layer that exposes C# scripting for you (where C# is an intermediate language).

Best of luck.

Answers 2

You're basically asking "how to cloud host my game server" here which is an extremely complex question.

The process is exactly the same as you did with AWS in the google infrastructure.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment