Masterserver forgetting about active gameservers? Timeouts?

Hi there.

I managed to write a little bit of code which lets my program register itself as a gameserver to the masterserver.

Then , when I run the same program on another computer, it can poll the hostlist and my registered server appears in the list of servers.

I have set the application to also run in background, but actually it shouldn’t be an issue because the programs always run in foreground on each pc.
I also disabled all screensavers and power management.

NOW LOOK WHAT HAPPENS !!!

Well, If I let my first pc register itself as a gameserver, then it works perfectly to start other instances of the program on other PCs and let them poll the hostlist.
The server is nicely shown.

But… If I let my gameserver on for a longer time (like you would expect from a waiting gameserver) then after a certain time the gameserver just dissapears from the hostlist. I did not change anything on the pc which hosts the server.

So what could be happening?

Can a registerserver timeout ?

Does the masterserver at UT maybe have this limitation ?

Do I have to regularly make a certain call tonot expire the host registration?

For the moment I didn’t time it, but the servername lasted certainly half an hour (maybe a full hour even), but then just dissapeared.

Any help on this subject is highly appreciated.

Kind regards,

Bart

I’ve had a bug filed for this quite a while ago. Larus had set up a beta-masterserver for a while, on which this problem did not occur for me. Since that beta-masterserver seems to no longer exist, I would assume (anybody correct me, if I’m wrong), that this has now gone online.

Unfortunately, this issue seems to be worse than before now on the official masterserver. At least, I’m not getting my list of servers about half the time. A workaround is simply re-registering every few minutes (or even seconds). That does fix it for me, but I don’t know if the master server will like it a lot if everyone does that.

Since this never happened to me on the beta-masterserver, and it does happen to me all the time on the official masterserver, my guess would be that this has to do with many people using the same masterserver. That would also explain why this problem has become worse. I don’t think that has anything to do with another master server version - I guess it might just gradually become worse the more people use the official master server.

That’s just an assumption, of course. What I might be trying is simply setting up my own master server. If it never happens there (since I’ll be the only one using my own master server), my assumptions can be considered “q.e.d.” :wink:

Sunny regards,
Jashan

Jashan,

Tnx for fast reply.

I would allready be happy if it isn’t my code which does this.

Maybe I should indeed try to run my own masterserver too.

Any idea if you still have that beta masterserver code ?

Regards,

Bart

No (I don’t know if that code ever went outside of UT), but if my assumption is correct that this problem is “load-related”, I guess the version really doesn’t matter…

On Game Development Software: Build a Multiplayer Game | Unity it still says 0.1.0, so I think that’s still the most current version available…

Sunny regards,
Jashan

Lars, could you please tell us what could cause this ?

Is masterserver @ unity under too heavy load ?

How much load can this thing handle ?

Would be quite important to know, because if we host our own masterserver, then it sure will have to be at least a little stable.

At this moment its a crucial part of networking in unity, so its important for us to know how stable it is.

Kind regards,

Bart

There is some logic in the master server which removes unresponsive servers. This way the list will not contains servers which are no longer running but didn’t disconnect from the master server cleanly. I think this is failing so that active servers are incorrectly being removed.

If this is an issue for you at the moment you could force send regular host updates like Jashan suggested as a temporary workaround.

There was a beta version of the server running with some changes which addresses this and improves the handling of server registrations but it will not be published until it has undergone proper beta testing, this will happen along with the next release of Unity. We need to confirm the new version is rock stable (there are also some other changes) and solves the issue.

I don’t think this is load related or at least the master server hasn’t been under any particular heavy load lately, compared to past few months. The current version should be able to handle some thousands of concurrent users. The current usage hasn’t been anywhere near approaching the limit but. There is room for optimizations if needed and you could always run your own server if you except some humongous amount of traffic.

So what to do now ?

It is not a huge problem for me now, but If I make a game which uses it, we would expect it to be stable.

I don’t know if its a good idea to register the host every time again and again. What will happen if my gameserver has allready 2 atached clients who are playing, but because players can join an existing game, he re-registers himself to the masterserver every 2 minutes ?
Would the clients which were connected still be connected? Would that affect anything ?

If I read your explanation correcty, then running our own masterserver will most probably not fix this problem?

If I recall well, then a next release of unity is not skeduled in the nearby future, so how long would we still have to work with this bug (if it is a bug) ?

I just want to try to know how serious it is for people who want to release a game for example next month.

Kind regards,

Bart

PS. That PING class that got added in 2.0.2 is SUPERB !

Hi Larus,

thanks for clearing this up! So do you think it’s ok to re-register every few seconds (let’s say every 10 seconds or so)? In my latest testing, I noticed that when I do it every few seconds, I can connect pretty much all the time. If I set it in the minute range, I can’t connect quite often (this is in a testing environment where I start the server, wait til it’s connected, start the clients, test, shut everything down, maybe change some code - next iteration).

I guess it sometimes might be a problem when the server is restarted too quickly after it has been shutdown.

Sunny regards,
Jashan

Jashan,

I suppose your game doesn’t allow other people to log in while they game is running ?
That way you could maybe implement it, but actually, this is not a nice solution to the problem.

If a gameserver registers itself as a gameserver to the masterserver, then the masterserver simply should not remove it, point …

I didn’t yet look at the code of the masterserver itself lately (did it once some months ago) but I remember that it is not THAT big.

I really hope that somebody will simply try to fix this. Looking for workarounds is maybe nice, but certainly not the solution.

So, Larus, is anything possible to check for this wrong behaviour? Networking is very important factor in online games (at least its something where unity should be very good at), but I don’t think that players who host a game on their clientmachine would be happy to see that they don’t appear or dissapear from the hosts list. And at the current rate it just happens too much not to get noticed.

Kind regards,

Bart

Another question I really would like to ask is the following.

The masterserver source code is provided with makefiles for VC, Xcode and Linux stuff.

But the problem is I would like to test out with my own masterserver on a windows machine (to test with).

Could it be possible to also put a compiled .exe masterserver on the download page please ?

I can guess a lot of coders in here don’t have VC.
I am a delphi programmer and I make quite a lot of .exe files, but I have no VC to compile the masterserver .Exe.

If you could put it online somewhere, then other people could benefit from it too and you save the hassle to have to find a VC to compile it.

I hope that this could be done ?

Kind regards,

Bart

People can log in at any time as the server is designed for massive amounts of players. And so far, I never had problems with re-registering. I guess all it does is overwrite the entry in the internal database with the same values that already were in there, so it shouldn’t break anything, even when people are logging in or off at the same time (or when people stay logged in).

If I can compile this under my Visual Studio 2008, I could probably send you the exe. I haven’t tried that, yet, and may not get to do it before next weekend, but that would be an option… I’m not sure I installed the C++ stuff and I’m not even sure VS2008 is compatible at all with VS2003 when it comes to C++ stuff, since I’m using this only for C# / .NET stuff.

A downloadable exe would be appreciated in any case :wink:

Reregistering only updates the server registration if the server is already registered. This happens automatically every time some field has changed, like the current player count of the server. It’s perfectly safe to manually re-register frequently. The only reason it isn’t done every 10 seconds or at regular intervals by default is to conserve bandwidth. It won’t affect the current connected clients at all.

As I said before, just set up a regular registration interval when you want your server to be visible to clients. Then unregister when its not supposed to be visible. Then there will be no problem, its just a bit more traffic for the master server to handle but at the moment it is OK, and this is only temporary until the new version is put into production. As I have understood the problem, then this only occurs when a server registers and is inactive for a long while (some hours or at least more than 10 minutes). Therefore this should only be a problem for dedicated servers which might run with no players connected for long periods of time.

You should be able to compile the project with an express edition of VS C++, probably better to use the 2005 edition. They are free to download. Maybe we could provide an installer/binary file on the source code download page, I’ll look into it.

Okay,

I’ll try to implement interval re-registering.

As to what concerns the .exe version of the masterserver. I really hope that you (Jashan) could compile it and it would be even better if Larus would put it online on the same page as the masterserver source download. Its just an added service for the customers…

Kind regards,

Bart

Jashan,

At what rate should I then best do my registerhosts ?

You seem to have experience with this .

Well, at the moment, I’m going at a rate of 10 seconds (or maybe even 5), but less frequent may do, too. I just had some serious trouble last weekend and thus put it to a high frequency without checking if that’s really needed. Best is to simply try different settings… All I know for now is that after I increased the frequency to this level, I never had problems again. Sometimes connection is immediately there, sometimes it feels like it takes 1/2 second, but I could connect each time with no exceptions (as far as I remember).

Of course, keep in mind: There might still be some other reason why this may not work. For instance, a few times I simply was too quick so that the server hadn’t really registered with the MasterServer, yet, when I tried to connect with the client. The server or your network might also behave “oddly” causing the MasterServer to drop the connection (not sure what this might be, but it could be a possible cause). Finally, I had a few cases when a client couldn’t connect, but once I had restarted the client, it suddenly worked (without re-registering the server).

Hi Jashan,

I am currently developing a multiplayer game aswell, and i had similar problems.
Sometimes i started a server on one machine, and refreshed the list on my second machine which showed the created game. But after a few seconds the server disappeared from the List.

Another thing was, which is more frequent, i tested the game with a collegue of mine through the internet, and the web player files are hosted on my dedicated server.

When i start a server he can join the game without a problem, but when he creates a server and i want to join, i can click on the join button all the time but it just doesn’t connect. I have based the program on the networking example. I Just don’t know what this problem could be.

So can this be related to this problem aswell. I am still trying to figure it out.
Reading through the forum , i figured you seem to have a lot of experience with the unity networking, so maybe you have had some similar problems.

Any ideas or help would be appreciated.

Mike

As far as I know, the webplayer starts the server automatically connects itself to itself.

So it makes no sense to connect to yourself if you are allready connected automatically I think

Hi,

I use the web player for easy testing purposes for multiplayer games.
Here is the a simple test i did.

http://www.valendhar.de/valendhardw.html

It just a simple testing application, to test some features and the GUI still has some problems with the text fields i still need to figure out, so don’t mind it.

You can create a game with a name and description. Then it changes to a test scene , with just a simple chatting feature. Another player can then join the game through the available game list.

Testing it with a friend i could start a game and he could join. But i couldn’t join his created game.

And sometimes it happened that a create game vanished from the list. So i thought that it may have something to do with the master server problems discussed in this thread.

Any help would be appreciated.

Mike

just tried with 2 PCs and they can nicely connect and chat here