So I'm trying to set up the MMORoom for my game and I tested the server script with 49 simulated NPCs and my initial game object... The game is lagging pretty bad with just these 50 objects... How would I able to fix this so I can get many more players in the room?
Thanks!
Spawned 50 Networked Objects and already lagging.
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawned 50 Networked Objects and already lagging.
Are you testing locally or over the internet?
When you say that it is lagging are you sure it's not the client machine being too busy? What's the Unity CPU usage?
Also what's the total CPU usage?
thanks
When you say that it is lagging are you sure it's not the client machine being too busy? What's the Unity CPU usage?
Also what's the total CPU usage?
thanks
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawned 50 Networked Objects and already lagging.
I am testing locally. I am using one client (The Unity Editor) and spawning 49 other "NPC"s with the server scripts. I am using the MMORoom but allowing a really large AoI in order to see everyone. I'm not sure on the CPU usage. I did not check that.
Re: Spawned 50 Networked Objects and already lagging.
Well, that sound like the problem. There's no real difference between a regular Room and a MMORoom if you make a too large AoI.
The very purpose of the MMORoom is to filter out some of the users so that the client is not overwhelmed with messages and rendering too many players.
Now, in Unity I'd expect 50 player models to be rendered without problems, but maybe there's something else going on.
You should probably check with the unity profiler and see what is causing the lag. Also another problem is how often are you sending position updates. You have to keep in mind that the network is limited to 15-20 updates per second. Especially when you run on the internet. Locally it can be pushed higher, although it can tax the client performance.
cheers
The very purpose of the MMORoom is to filter out some of the users so that the client is not overwhelmed with messages and rendering too many players.
Now, in Unity I'd expect 50 player models to be rendered without problems, but maybe there's something else going on.
You should probably check with the unity profiler and see what is causing the lag. Also another problem is how often are you sending position updates. You have to keep in mind that the network is limited to 15-20 updates per second. Especially when you run on the internet. Locally it can be pushed higher, although it can tax the client performance.
cheers
-
JuliusBtesh
- Posts: 58
- Joined: 30 Sep 2014, 17:08
Re: Spawned 50 Networked Objects and already lagging.
Ok so then I would assume its better off to just use a regular SFSRoom for this purpose? I mean, the people that I am working on this project with are wanting hundreds of thousands, or even millions, of players to be in each room at a time. So I may have to use the MMORoom and just limit each clients view to only a few units around him.
The updates are going continuously at the moment because the way this game is going to be played is not dependent on the client input. The objects will be bouncing around the room which means the positions will be constantly changing hence the constant update. I'm not sure on how to get this to work better with all these objects being shown.
The updates are going continuously at the moment because the way this game is going to be played is not dependent on the client input. The objects will be bouncing around the room which means the positions will be constantly changing hence the constant update. I'm not sure on how to get this to work better with all these objects being shown.