Author Topic: Make a dedicated authoritative unity Server?  (Read 2634 times)

Rexima

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 78
    • View Profile
Make a dedicated authoritative unity Server?
« on: August 16, 2017, 07:34:45 PM »
Hey,

i plan to make Transport tycoon and i can't let the player be host and send all vehicles to the gameserver and the gameserver relays it to other players.

I need to make a authoritative unity server, where the unity instance is the server and hoster.
So if I want to create a vehicle, the server is creating it and send every data to other players.

I made an quick test with 5000 Objects that are created on my pc and I had an outbound at 1Mbit to the gameserver(From the zip)(hosted on my datacenter with 1Gbs Up and Down).

So I would be Hard limited, if other players who host a game on their pc with a lower bandwidth.
So I decided to make an authoritative gameserver with unity logic.

And here is the question, how can I make in unity, that the gameserver is also the Hoster?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Make a dedicated authoritative unity Server?
« Reply #1 on: August 21, 2017, 06:35:05 PM »
So the reason you're thinking of making an authoritative game server is because you believe you were using too much bandwidth with 5000 objects in a client-authoritative mode? That seems like flawed reasoning to me. The bandwidth will be the same either the player is sending the data or the server. The same amount of data needs to travel between the clients. Furthermore, reducing bandwidth with optimizations such as limiting RFCs only to when something changes is a much more effective way of reducing traffic in general.

That said, if you insist on going with the Unity executable server, there's nothing much to it. TNet works the same either way. You'll have to code a headless client -- and unfortunately I can't be of much assistance there. All I can note is that it'll be just like hosting your server from within your game using TNServerInstance.Start.