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
2
Question by stoilkov · Jul 05, 2012 at 03:51 AM · networkingmultiplayernetworkrpc

RPC custom server best practice

Hi to all,

We are currently kicking off our first unity project and I want to know what the best practice for networking would be. The game ( and hopefully games) involves no state synchronization for game objects, simple RPCs are sufficient, as it is a board game. We want to use an authoritative server, which has some simple logic like login, chat and the actual game with logic. For the networking I identified three options:

  • Use Unity networking for both server and client. I really don't like this option, for obvious reasons - we will be bound to Unity on the server. I want us to use our own server technology, as i want us to have full control and be able to easily bind "external" things like DB connections, control scaling, load balancing, etc.

  • Use TCP Sockets in Unity and code our own protocol and server. This is my preferred way to do it. The only negative point is that we have to implement low level in Unity. As we are new to Unity, but have a lot of experience with webservices, load-balancing, etc., it might not be a bad idea to do the heavy lifting on the server side. Which brings me to the third option:

  • Use Unity Networking in client and implement connection and RPC protocol on our custom server. This option will be great, as unity code will be kept very simple. Implementing the Unity network protocols should actually be no problem for us, but unfortunately i cannot find any documentation on the subject. I only know that unity uses raknet, but they also don't have any protocol documentation.

So my questions are: Which would is the best practice for networking not involving state synchronization? Is Unity's networking protocol reliable? If so, is this protocol documented somewhere?

Any inputs on the matter will be greatly appreciated.

Regards, Emilian

Comment
Add comment · Show 2
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 mark03468 · Jul 10, 2012 at 08:56 AM 0
Share

$$anonymous$$y suggestion : •Use Unity networking for both server and client.

Separating Server and Client into 2 projects will be find.

RPC is reliable but don't use it in Update function.

avatar image stoilkov · Jul 15, 2012 at 07:19 AM 0
Share

Hi $$anonymous$$ark,

thanks for your suggestion.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by asafsitner · Jul 16, 2012 at 06:21 AM

Unity's network is a closed box.

If all you do is shovel messages between the server and clients, I suggest you either

a) write your custom server

b) use one of the many excellent third-party server solutions available such as SmartFox or ElectroTank. This Google doc holds every known third-party server solution with integration to Unity, I believe.

In any of these ways you'll get rid of the need to run a Unity build as your server, which is good for numerous reasons, not the least of those the facts that from tests I've conducted Unity can't handle more than 100 concurrent users and is limited to sending 5Mb of traffic per second.

As a nice bonus you'll also free yourself some system resources.

Comment
Add comment · Show 2 · 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 stoilkov · Jul 16, 2012 at 10:54 AM 0
Share

Hi and thanks for your reply. I think solutions like SmartFox are too expensive for what our current projects require as functionality. What i would like to find out is, what underlying protocol Unity is using for it's networking, so i can replace a Unity server, which as you said is not a good idea, with a custom server we program. The benefit would be, that we can use our own server without having to code extra on the client side. With "close box" you probably mean that the exact specifications of the protocol are not public and we would have to reverse engineer?

avatar image asafsitner · Jul 16, 2012 at 03:42 PM 0
Share

Exactly so, I'm afraid.

I suppose looking at the RakNet official documentation could help, but I don't know how the folks at Unity wrapped it up.

Writing your own solution may prove the easiest way.

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

6 People are following this question.

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

Related Questions

Multiplayer issue - players view others as themselves with same material 1 Answer

How To Deal With Lingering Prefabs in Multiplayer Scene ? 0 Answers

When connected to a server, can other players access my static variables and/or public variables? 2 Answers

How to use an RPC to send an animation over the network? 2 Answers

Multiplayer - Selected character to Network.guid? 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