question

brendan avatar image
brendan asked

When would I need a server?

Brendan Vanous
started a topic on Fri, 02 January 2015 at 3:45 PM

Question from a developer:

I see that you offer server hosting. Why would I want to use that if I can run everything on your servers and Photon Cloud?

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Fri, 02 January 2015 at 3:45 PM

Some games require complex, latency-sensitive, state-based logic to be run on an authoritative server ? basically, something that has higher requirements than what you can manage with Photon Realtime using webhooks and PlayFab?s hosted Cloud Script. Dedicated servers for first (or third) person shooters are good examples of this ? you need the server to be authoritative about many complex decisions which must take into account things like player position, and you can?t afford to wait on the round-trip of a web API call. To allow for that, we offer hosting of your own custom server logic and we help you to optimize your costs by offering physical server hosting. If you?d like more info on getting started using server hosting in PlayFab, please reach out to us at devrel@playfab.com.


5 Comments
Brendan Vanous said on Fri, 02 January 2015 at 3:45 PM

Some games require complex, latency-sensitive, state-based logic to be run on an authoritative server ? basically, something that has higher requirements than what you can manage with Photon Realtime using webhooks and PlayFab?s hosted Cloud Script. Dedicated servers for first (or third) person shooters are good examples of this ? you need the server to be authoritative about many complex decisions which must take into account things like player position, and you can?t afford to wait on the round-trip of a web API call. To allow for that, we offer hosting of your own custom server logic and we help you to optimize your costs by offering physical server hosting. If you?d like more info on getting started using server hosting in PlayFab, please reach out to us at devrel@playfab.com.


steamcore said on Sat, 03 January 2015 at 3:34 AM

What about logic for things like currency building, etc? For instance you have a basic feature allowing VC to regenerate. How and where would we add more sophisticated logic to transactions, say for instance being able to buy other objects that regenerate VC quicker, add a higher number to the VC regeneration threshold, etc.? How and where would our logic tie in with Playfab?


Brendan Vanous said on Sat, 03 January 2015 at 1:21 PM

It's going to depend on the specifics of your needs. For your specific scenario, the regenerating VC is a basic system that regenerates at a set rate, to a set limit. For separate logic which enables exceeding either, you could add that via our Cloud Script fairly easily. What you would do is add a method that you call when you need to query the inventory (or just the VC balance) which checks if the player has the items which modify the regeneration rate and/or limit, and adjusts the balance as needed based on the elapsed time since the last query.


steamcore said on Sat, 03 January 2015 at 10:45 PM

I feel totally out of my depth. I am developing in Unity and I have things set pretty well client side, but then discovered playfab and wanted to give it a try. Of course it makes sense that all client originated data is treated as suspicious, (I mean duh), but I didn't plan on that. I really don't know how I'm going to move this logic to a server. I mean, when I think of offloading this economy logic onto a server, I think of stripping down the game, creating a version of it that only handles the economy, and running it on your server. Is that how this is even done?

This is a real bummer for me because I have a really fun to play multiplayer game with good art due to the fact I'm a 3D artists as my day job, I picked up Unity last October and have had these dreams of releasing my game stoked by the ease of learning Unity. But now that I have a working game (multiplayer with PUN) I can't figure out even the first thing about using Playfab to add currencies, inventories, etc. I don't even recognize the language that is being used to make these calls. I don't even know what a call is.

Aren't there prefab modules I can plug into my game that I can reverse engineer (like i did with the rest of my game and Unity)?


Brendan Vanous said on Sun, 04 January 2015 at 3:18 PM

The best thing to do is simply break down each of the features, and we can talk through how you would want to do the implementation. For commerce specifically, all the pieces which should run on a server are already part of our service - validation of receipts (where you have to use Apple or Google's storefrone), real-money purchasing via other providers, and a full virtual economy system with Catalogs and Stores which securely transact the player's virtual currency for in-game items. So none of that would require any server-side code on your part, unless you want to have something specific to your game. And even then, you could just have that coded up in some simple JavaScript which we host.

Our main documentation shows the API calls being made directly, using HTTP (usually people refer to this as a Web API or even just "RESTful"). But we have SDKs for multiple languages and frameworks, including Unity. We'll be releasing more sample code soon, but right now, we do have the PlayFab AngryBots sample in our GitHub, and a set of videos on YouTube walking through the implementation.

If you have questions about how you might want to break the logic up and what parts are already taken care of by our services, feel free to drop us a line at devrel@playfab.com with the details.

10 |1200

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

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.