me and a friend made a small test for my multiplayer game. We noticed that the one who connects to the server has very low FPS, I have around 2-3 FPS, he got around 21 FPS. The one who is hosting the game runs the game at 60 FPS though. If client and server runs on the same machine it works fine.
We made some online games before and it always worked.
That’s the first time I use Zay-Es Net, so it might be that requests are sent all the time which causes this low FPS… I don’t really know…
Does someone has an idea what could be the cause here?
I had a look and my client never calls something like EntityData.getComponent().
However, me and another friend tried it again and this time for some reason it worked just fine (he got 1000+ frames). We didn’t need to change anything. It just worked. Maybe something was wrong with my pc or the one of my friend.
Nevertheless, thanks for your help @pspeed! If we know what was causing this massive lag we’re going to post it here.
Maybe you had a situation where the server does throw exception several times a second. This happened to me once and the server was not able to recover, it was some connectivity errors. But I sadly did not store those logs away
I’ll post it here if it happens again. In my case as well the FPS dropped extremely. And similar to you the client which caused the exceptions was on a physically different machine. The client on the same host like the server was not affected that dramatically but also had lags…
Throwing exceptions is expensive, so throwing a lot is a very bad situation. The exception (I can not find it in the code, so it is maybe on the ethereal side, I don’t know, stated something like “something really bad is happening”.
EDIT: After the client did a disconnect and then join again, the situation was solved.
Yes same for me, it works now, but the fact that this can happen is a reason to reproduce it to find the root cause. And I’m now not 100% sure anymore if we only did reconnect the client which caused the issue or also did re-create the server.
Whenever freaky wierd stuff i cant explain happens, a rebuild or restart IDE/OS usually solves it. It does happen from time to time. Nature of the beast, i guess…
I had this same problem, in my case it was because of EnitytData.getComponent() calls. Use entitysets on the client, don’t interact with EntityData directly.
And for looking at a single entity (like the player) that often has to happen on the client, then use the WatchedEntity. It’s like an entity set of one.