Hello, I’m writing a simple mmo, and i quite like the serialization on the unities transport layer, plus it allows me to do game logic. However, can someone tell me what’s the max connections i can have, it’s not defined anywhere
"
The final step of network configuration is topology definition. Network topology defines how many connections allowed and what connection configuration will used:
HostTopology topology = new HostTopology(config, 10);
"
I’m also concerned about performance, since unity is single threaded i’m quite sure i won’t be able to handle many connections at all. What would be a good suggestion for a simple mmo server.
Afaik, unities corroutines aren’t multi threaded, i’d have to use C#'s multi threading i guess.
As i said, the maximum number of connections is 65k, which is the number of 16bit ip’s. Meaning i can’t have two connections from the same ip? Either way, i’d like to have more than 65k people connected…
Saw that thread already, but i don’t think it’s answered there on how to do it. How do i add another connection based on the same ip (i guess different port)?
Actually, this is not correct. Infact, 65535 seems to be the limit for Unet.
Quote from Alex:
“>Connection descriptor is an int? Why limit yourself to only 2,147,483,647 connections?
inside connection described as uint16_t ~65535 connection… We decided to leave int in C# API for the reason do not bore people with casting. If you will over limit this value you will receive error.”
Not quite sure that comment got it to work. Yeah, that’s the problem, i need to figure out how to make a different “connection” for a different person behind the same ip i believe
More than 60k for sure.
Yes, they won’t take much bandwidth or cpu power, but it’d be a hassle to authenticate them each time they make a move, so i won’t be opening and closing so many connections as well.
If it’s not a realtime game. I don’t think UDP sockets is the way to go. And all you would have to do is to supply a token or something to the game server.
int myReiliableChannelId = config.AddChannel(QosType.Reliable);
It’s using tcp, not utp.
I can’t really assign tokens,
NetworkTransport.AddHost(topology,port,extra_ip); I would have to know how to add a connection depending on a different client and no one has managed to explain that so far…
Well, if you need more than 60k players on one connection. I think you will face more design issues and that the connection limit is the least of your problems. Let alone atracting that amount of players. Currently the number 10 game on steam has 45k players playing it. And GrantTheftAuto 5 currently has 55k. I don’t see why you don’t offload to multiple servers.
True, but it’s a simple game really, not much data to be processed at all. I guess i’ll write architecture to distribute the load, but again i would like to at least theoretically solve the issue of the nr. of connections
If you are only using reliable communication and not alot of data. Go for TCP IP. And if you are planning to beat GrandTheftAutos player count. Well, I guess just use more than ONE server? That poor server will have a lot to do managing 60k connections.
True, but it’s a simple game really, not much data to be processed at all. I guess i’ll write architecture to distribute the load, but again i would like to at least theoretically solve the issue of the nr. of connections
The problem is that the transport layer offers some nice serialization and has a nice interface, kinda not sure if i should go for C#'s tcp