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
1
Question by Bamboy · Feb 03, 2014 at 08:00 PM · networkingserverprojectclientadvice

Dedicated Server In Seperate Project

We are making a multiplayer game and are concerned about dedicated server performance.

What would the best client-server setup be? It is important that the server handle most or all gameplay interactions to minimize hackability.

Would it be worth it to have the 'Client' and 'Server' be in separate projects so that each has highest performance? Particularly the server rendering as little as possible? How do you sync network view ids, RPCs, and other information between different unity projects?

We realize that there are many different ways to do networking and just want to get some advice on what people think are the best methods.

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
4
Best Answer

Answer by asafsitner · Feb 03, 2014 at 08:25 PM

The way we setup our servers for Fields of War, we had the server and the client in different projects, both for performance and security reasons (hacking, cheating, sensitive information etc.)

We had a problem with synchronizing NetworkViewID initially, because if you have a NetworkView in the scene, it will get a unique SceneID.
We ended up not having any NetworkView component that does state snchronization pre-made in the scene, and instead we instantiate all of them at run-time.
The server tells the clients what to instantiate, and which ViewID it should have, it is also the only place where any 'real' data values are kept, such as weapons damage, players health etc.

This way we have maximum authority and security on the server side, and much more focused and small game/server builds.
For instance, the navigation mesh exists only on the server, as clients do not perform any AI calculations while no actual mesh data is kept on the server side, only collision data.

TL;DR - I'd say it's worth it to separate development of the server and client, especially when security and performance matter. It's not that big a headache.

Comment
Add comment · Show 4 · 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 Bamboy · Feb 03, 2014 at 08:54 PM 0
Share

Thanks for your reply, it was helpful.. but how do you actually go about syncing RPCs and such? Do the RPCs from one project get sent to the same class name in the other project?

avatar image asafsitner · Feb 03, 2014 at 10:04 PM 0
Share

Yes! As long as the signature is the same, RPCs get called correctly between projects.
One more thing to remember is that you must have an RPC declared in the class in order to send it, even if it does nothing on the sender's side.

So if, for instance, the client needs to send a request for the server to do something, they have to declare the method with the proper parameter list and tag it as RPC even though the method doesn't actually ever gets called on the client side.

avatar image Bamboy · Feb 03, 2014 at 10:34 PM 0
Share

Awesome! Thank you so much for your help. I appreciate it. :D

avatar image Darth Lordi · Apr 16, 2014 at 11:11 AM 1
Share

Thanks asafsitner. I have been looking for days on how to do this and not a single tutorial I have seen mentions it. You are my hero of the day.

avatar image
0

Answer by Assault · Feb 05, 2018 at 07:53 AM

Thought this was a solution to my problem, but then i realized this answer is not applicable to UNET, but to the legacy network solution in Unity,

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

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

21 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

Related Questions

Unity networking tutorial? 6 Answers

Building Client and Server apps from single project 1 Answer

Network Connection Works Locally, but not Publicly 0 Answers

Network RCP between client server projects 0 Answers

I don't know difference between interpolation and non-interpolation 0 Answers


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