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 PeterAldur · Jan 05, 2014 at 05:41 PM · servermultithreading

Unity based server, running each level in separate engine

I have an old game design, dating back to when I didn't even know about Unity. It was a client-server sandbox, where the grand world would be a graph of connected nodes, each node being a complete 2d interactive environment - just like unity scenes normally work.

Client would always be in single node and only that node would be loaded at any point in time, so here there is no problem. Server however would need to load and update every single node that any player is currently in.

This is where I'm unsure about what Unity can realistically allow me to do. Is it possible to create a server, that could run each scene nearly completely separately. This means in a separate instance of actual game engine, with its own update loop and physics worker, running on it's own thread so it can scale with any number of server cores.

I am aware of the hacks where scenes are loaded into another layer and the other method, where each scene is offset in world coordinates. Unfortunately this is not scalable, the first method would be limited to no more than ~20 players at once and the second one would eventually die out of performance, since everything including physics would run on single update thread (unless Unity's game loop supports multithreading in some fashion I'm unaware of?)

I thought for a while about running multiple instances of unity engine itself and use one of inter-process communication to let the levels communicate with world server. But that appears to have one big problem - assets. I'd have to load them for each unity engine instance, wouldn't I? Or is there a way to share a single memory area (unmanaged?) where unity could store and retrieve, for example, prefabs?

Any other solutions that are applicable here?

Will unity ever support such server solution out of the box?

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 nastasache · Jan 06, 2014 at 09:16 AM 0
Share

I didn't tried and I am not sure, but maybe few instances of Unity game, each running a game server with different scene, may communicate by RPCs to update each other worlds. As shared resources between game instances, I have to try under Linux to see if is possible to use hard links or symbolic links.

avatar image PeterAldur · Jan 06, 2014 at 01:24 PM 0
Share

The perfect solution here would be, if Unity could allow saving prefabs and other read-only assets into a memory mapped file storage. This could allow reading them directly, because once created, that data does not have to change (on runtime at least), it only needs to be read, a basic pointer is enough and GC is unnecessary. Such data could be reused by as many unity instances as necessary and average server instance would get smaller by orders of magnitude, making this whole crazy idea quite feasible.

0 Replies

· Add your reply
  • Sort: 

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

19 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

Related Questions

Unity networking tutorial? 6 Answers

FileStream on separate Thread seems to block the main thread 1 Answer

Game data sync with server 0 Answers

Unity, server for game 2 Answers

'Online Game' - Same Wifi 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