Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DwaynePritchett · Jan 10, 2015 at 12:11 AM · c#networkingphoton

Photon Authoritative Using MasterClient

I want to make my game Server Authoritative a bit later on. I use PUN, and I am not that great with it. I plan on checking more into this on the PUN documentation later.

But, I was wondering, is there a simple way to have the server generate a fake client/player, that is the MasterClient always? I don't know how to do any back end things unfortunately. But, I don't want my game cheated to hell either.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by jpthek9 · Jan 10, 2015 at 01:06 AM

Here's a piece of advice: Design your networking system with a preset plan. After you finish it, it'll be a huge pain to go back and change it, much less design it based on a completely different framework.

So for an authoritative server, every client sends the authority inputs, and the server simulates everything. Photon can't do that, so your idea of using the master client as the authority is the next best option. You do the exact same thing - send the master client inputs. If it's a first person shooter, you can just send when i.e. 'W' is pressed then send when 'W' is unpressed. Then the master client plugs these booleans into your character control system, simulates it, then sends everyone the position of the simulated units after the input. There are some downsides to this method you should carefully consider.

  1. Easily hackable. If you're the master client, you control everyone's health, position, etc.

  2. This puts all the burden on 1 person's computer - the master client - so if he's gone or can't handle it, you'll have to somehow make someone else the master client

For most games, it's better to send position updates. The only situations you would use this kind of networking is in 1. synced physics simulation and 2. artificial intelligence control.

If you really want to make a non-hackable FPS in perfect sync, check out how Halo did it: http://www.pcworld.com/article/2859392/microsoft-to-opensource-cloud-framework-behind-halo-4-services.html. Actually, they're planning to make their system open-source but you'll probably not be able to use it with Photon.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by DwaynePritchett · Jan 10, 2015 at 04:28 AM

I understand. I have actually been designing with the change in mind. I have been designing it for functionality, but keeping in mind that I want to change it server authoritative later. You are right about it being difficult to change it later, I tried that route once over a year ago and broke it horribly. Which is how I got where I am today. My thing is, I want a "Dedicated" server to simulate a MasterClient. Player 0 if you will. So, a 16 player match would ignore his existence, and actually be a 17 player match. Anyways, I didn't know if there was any known/easy strategies for "faking" a master client player, where the master client is actually a server simulated client.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jpthek9 · Jan 10, 2015 at 04:56 PM 1
Share

Unfortunately, that's not possible with Photon's cloud servers, or at least, there are better options. For something like that, you'd need to buy your own computers to host your own servers over your own network or use something like RakNet that provides you authoritative servers. I'm sorry this is the case but the authoritative server model is something very limited to large game companies. The authority master client will work just as well and by the time hackers are a worry, it means that your game has gotten popular so you have some more resources to spend on extending the game. Just find the guy with the lowest ping and make him the master client.

avatar image DwaynePritchett · Jan 10, 2015 at 06:59 PM 0
Share

The authority master client will work just as well and by the time hackers are a worry, it means that your game has gotten popular so you have some more resources to spend on extending the game. Just find the guy with the lowest ping and make him the master client.

You took the words out of my mouth. This was my thoughts exactly. But, it is a shame Photon doesn't have an easy to use approach for this. I will cross the bridge if/when I get there I guess.

avatar image purpl3grape · Apr 28, 2018 at 04:55 PM 0
Share

Hi will there be client lag when getting inputs 'authorized' by the master client, and to send it back? - So when another player decides he wants to walk, will there be significant and noticeable delay when the user presses W to the character moving?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

This is giving an error for the other client and cannot hit other client. 1 Answer

Only do something if it has the same tag as the player 2 Answers

entity interpolation problems 0 Answers

battle game networking Question 0 Answers

Updating multiplayer map on joining 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges