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 GEWLAR · Mar 20, 2014 at 07:45 AM · networkingonlineauthoritative server

Multiple Server-Instances on one pc

I'm programming an online Game with some friends.

Server structure idea:

We have a Login/Lobby Server, Players Login on this Server. This we can do with php Scripts and a database. (This already works fine)

Then they start a Game. A new Server-Instance gets created for them on a Server-PC. The Lobby Server sends them a RPC and they connect to the new GameServer-Instace. But I don't want to have one PC for every Game. So I need to start multiple Server-Instances on one PC.

After they finished their Game the reconnect to the Login/Lobby-Server and the GameServer sends the result of this Game back to the LobbyServer

Now my question: How can we create multiple Server-Instances on one Server ? Is this even possible with Unity's Networking ?

Picture of our NetworkStructure-idea alt text

tl;dr I need multiple Game-Servers on one PC. How can I do that ?

Edit: Working on a Diagramm of our Network-idea.

netzwerkstruktur.png (54.9 kB)
Comment
Add comment · Show 1
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 Bunny83 · Mar 20, 2014 at 09:08 AM 0
Share

Your diagram is missing some fundamental topological things. Are your servers all in the same network? To which PCs a client can / should connect to? Do you use a NAPT router? If you have a NAPT router then all client-server communication will go through the router.

How do you start a game server instance on another PC? Do you have some kind of service daemon running on the machines?

You should draw a more clear border what's intern and where's the connection to the web.

1 Reply

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

Answer by Bunny83 · Mar 20, 2014 at 07:52 AM

Just start your server multiple times and make sure you use a different port for each instance.

Comment
Add comment · Show 12 · 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 GEWLAR · Mar 20, 2014 at 07:57 AM 0
Share

This is one idea we're working at already. But how can we have it, that the Player doesn't need to open every Port ?

avatar image Bunny83 · Mar 20, 2014 at 08:26 AM 0
Share

The player doesn't need to open any ports, only the server host. You said you have a PC which should run the server instances. To make the servers available from outside you have to port-forward all ports you might use to the host PC.

For example, Valve uses this port range: UDP 27000 to 27015

One PC can't bind the same port twice at the same time.

avatar image GEWLAR · Mar 20, 2014 at 08:36 AM 0
Share

How can I forward Ports with Unity ?

avatar image Dep · Mar 20, 2014 at 08:39 AM 0
Share

But the same port can be used for multiple servers if you setup a master-server that forwards all packets to the correct $$anonymous$$achine/Process.

$$anonymous$$ind of like having a second router. No reason to do that unless you plan on hosting a massive game or loads of servers.

avatar image GEWLAR · Mar 20, 2014 at 08:47 AM 0
Share

At the moment our biggest problem is to send the port data to the single Server-Instances. We don't know how to send the GameData to the GameServer.

Show more comments

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

22 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

Related Questions

Authoritative server basics Unity 5.2 0 Answers

system login and registration unity 0 Answers

How to implement online multiplayer in a simple 1v1 game? 2 Answers

Multiplayer Game Disconnects 1 Answer

Player Controls Multiple Pieces Online 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