playMaker

Author Topic: Choosing strategy: need help  (Read 2209 times)

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Choosing strategy: need help
« on: August 09, 2017, 12:30:24 PM »
Hey! Technically, it's not a playmaker only question, but I hope it's  good place to take some advises.

I'm willing to make a kind of network rock-paper-scissors game. Main logic should be like this:
1) player can create/login account on the server
2) choose another player from the online list and send him (send to server )his "strike"
3) second player got message, he got striked and send own "move" back
4) server match it and send both of them results: who is winner/loser

Do I need some unet/photon solutions, or it's better to have a php/mysql web database and clients connect directly to it?

Maybe the server should be on php too, but I'm not good with code, so I'm willing to keep all the logic in the unity (it will be more complex, than just match rocks with paper). Is it a good decision to make a "server" that will connect to the same database and looking if he need some job to do? Or maybe I'm missing some simple, obvious solutions?
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Choosing strategy: need help
« Reply #1 on: August 10, 2017, 02:59:56 AM »
Hi,

I would not recommend using a custom solution, it would means pinging your server manually every seconds or so which is sub optimal at best...

Photon has a already working demo scene for exactly this game, I would check it out.

If you are not good with code, doing php mysql will be just as hard as doing code inside Unity if not even harder. It's possible to so it all within Unity clients application, but for sure if your backend needs user auth, keeping track of complex scores, etc, then you'll need a backend but for this I would go for existing solutions like playfab which works well wth Photon.

https://playfab.com/add-ons/photon/
https://playfab.com/


so here's the run down:

1) you'll need Playfab or else to auth your users and manage their accounts, Photon doesn't provide any of this, only the ability to request auth
2,3) check out the demo provided by photon, all the logic for this is there already.
4) this is not done on the server, but on the clients, again all this is provided in the demos as a starting point.

Bye,

 Jean

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Choosing strategy: need help
« Reply #2 on: August 10, 2017, 07:57:50 AM »
Thanks for your input! Playfab looks like a good solution.

But I'm afraid of calculations on a client machines. Isn't an authoritative server is better and secure option? Unfortunately, I can't find anything about making authoritative server on photon. Is it not suitable for this?
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Choosing strategy: need help
« Reply #3 on: August 10, 2017, 08:10:38 AM »
Nevertheless, I found documentation about quite similar games and technics on photon and will read it carefully. Thanks!

https://doc.photonengine.com/en-us/pun/current/manuals-and-demos/rockpaperscissors-demo

https://doc.photonengine.com/en-us/realtime/current/tutorials/memory-demo/
« Last Edit: August 10, 2017, 08:15:08 AM by pigglet »
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Choosing strategy: need help
« Reply #4 on: August 11, 2017, 02:51:14 AM »
Hi,

 you have to weight how much budget you have against how likely your game is going to get hacked.

 yes server side is in theory more secure, but what prevents somehow to hack your server instead of your client side code, if you run your own server without full expertize and experience, It's !guaranteed! you'll be hacked big time and have your server used as a host for streaming bad content and you could end up in real trouble with very real consequences.

 So yes, if you are an expert and have budget to hire proper server side coders and webmasters, it's better, but it's unlikely, that's why Photon is providing this "serverless" solution where you can do it all within the client and forget about the server side nightmares all hosts have. It has some limitations but the benefits for indies and small studios totally outweights the cons.

calculations on clients is marginal actually, if your game gets very successful, you'll actually end up with problem for your servers spec that won' be able to handle traffic and volume of processes, while on your client side code will not be stressed more because you have thousands of Players, yes? So the more your game will become successful the more it will cost you on the server side while it won't affect at all your client side, 2 players or 1 millions player won't change anything per device.
 
so, Photon server exists and it's free actually, but you end with having to pay for the servers that will run your photon servers!!! it's not for indies and beginners, it's for advanced experts with a proper budget.

Bye,

 Jean

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Choosing strategy: need help
« Reply #5 on: August 11, 2017, 03:10:38 PM »
Am I understand right: there is no playmaker actions for Playfab yet, so I need to make it myself?
Disregard that! Found the playfab topic on the forum


Although, I see actions for PUN at ecosystem and I see 10$ asset on unity store with Easy PUN Setup for Playmaker. Do I need both? Are they different?
« Last Edit: August 11, 2017, 03:24:55 PM by pigglet »
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Choosing strategy: need help
« Reply #6 on: August 11, 2017, 03:32:44 PM »
Hi,
You do not need both,
i never bought the one on the asset store, but the one on the ecosystem are working fine :)

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Choosing strategy: need help
« Reply #7 on: August 11, 2017, 03:38:42 PM »
Great, thanks!
indie developer of multiplayer adult fighting
http://nakedfighter3d.com