question

TheL0w3R avatar image
TheL0w3R asked

About where to write and manage my game logic. [CONFUSED]

Hi, I know this question may look a bit silly but I'm pretty confused...

I'm developing a card turnbased game, so I found Photon Turnbased.

Then I found PlayFab and I've built the Account system inside my game client, the users can nos create accounts and login from the client..

The question is, where do I write the game logic? Should I use PlayFab Cloud Scripts? If yes.. Why do I need photon then?

I also saw that I'm able to upload a custom server.. Is that the best way to make it?

I tried to read documentation but I didin't really found what I was searching for.

Hope you understood me and thanks for helping again!!

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

It really depends upon your needs. If the game is fully asynchronous - I take a turn, then sometime later another player takes a turn, you could just use Cloud Script to validate each player's turn to prevent cheating. If it's a realtime game, where the players are playing together at the same time, you'll need to use either Photon Cloud or write your own custom game server, which we can host for you. Custom game servers are for if you need a lot of processing power and super-short latency on decision-making, such as in a first person shooter. For most card games, you could use Photon Cloud and use Cloud Script to validate player moves (again, to prevent cheating).

10 |1200

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

TheL0w3R avatar image
TheL0w3R answered

But where is the Photon Cloud? I can't find it :/

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 find it in the add-ons tab for your title. There are also links on the Photon add-ons page, for additional documentation and a sample project showing usage.

10 |1200

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

TheL0w3R avatar image
TheL0w3R answered

Yeah, I read all of that stuff, I'm using PUN inside unity (is that right?) but I can't access LoadBalancing..

I understand that I need to write a JS script and upload it to the PlayFab Cloud but with Photon is not the same.. I don't see any way to upload my Photon Cloud script as in PlayFab..

I might be missing something obvious..

Thanks again!

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

PUN isn't the same as the Photon Realtime or Photon Turnbased services. To use those, you would need to download the specific SDK for the one you're using from Exit Games. And there's no concept of a "script" in Photon Cloud. You can trigger Cloud Script calls from Photon Cloud actions though, if that's what you need. There's info on that in the Using Photon with PlayFab tutorial, here: https://api.playfab.com/docs/using-photon-with-playfab/.

10 |1200

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

TheL0w3R avatar image
TheL0w3R answered

Oh, i tought that PUN was the integration of Realtime, Turnbased and so in Unity.. Thanks you so much for answering!!

Now I understand the docs!! :D

10 |1200

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

TheL0w3R avatar image
TheL0w3R answered

I have another question.

I'm thinking about building my own server, how much it costs if I host it on PlayFab?

And what specs will the computer that hosts my server have?

 

Thanks again!!

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

The specs are actually whatever you need, and the costs are easy to calculate. Here's the Amazon AWS pricing page:

https://aws.amazon.com/ec2/pricing/

What we provide are EC2 Windows On-Demand instances, and the price is as shown in the AWS pricing, plus 10% to cover our costs. Right now, we provide a free t2.medium server for title developers experimenting with custom game servers. When you need to move to more than one server and/or a larger server instance, let us know at devrel@playfab.com and we can get that set up for you. We'll have the ability for you to select this and choose your instance type in the Game Manager in a future update.

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.