Player / Bot performance limitations?
by Pascal · in Torque Game Engine · 10/27/2003 (12:14 pm) · 14 replies
Does anyone what number of Bot's are reasonable to have visible at one time? I'm having an issue when I add more than around 10+ bots even with just a localconnection. The bots start to just jerk from location to location instead of moving smoothly.
Has anyone else experienced this?
-Pascal
Has anyone else experienced this?
-Pascal
About the author
#2
10/28/2003 (12:53 pm)
Ah, that would make sense. Thanks for posting the answer! :)
#3
10/28/2003 (3:09 pm)
Everything's a tradeoff hehe.
#4
Even with a limited number of players, 10 just isn't very useful if you want NPC's in your game on the screen too.
10/28/2003 (3:11 pm)
Pascal, have you done any experimenting to see what the limit of bots is before the problem returns. That is, what's a top limit of bots before this adjustment, or further upping of the limits, doesn't help any more?Even with a limited number of players, 10 just isn't very useful if you want NPC's in your game on the screen too.
#5
getting sent. Just off the top of my head it seems like the current max of 400 bytes should allow for more than 10 Player/AIPlayer's(I might be and probably am wrong). But if not that could probably be upped or some other workaround implemented (i.e. make sure that bots that weren't updated last time are this time, etc..) I haven't dug in the code yet so I'm just speculating..
-Pascal
10/29/2003 (9:57 am)
I'm going to try to do some profiling of the packets that aregetting sent. Just off the top of my head it seems like the current max of 400 bytes should allow for more than 10 Player/AIPlayer's(I might be and probably am wrong). But if not that could probably be upped or some other workaround implemented (i.e. make sure that bots that weren't updated last time are this time, etc..) I haven't dug in the code yet so I'm just speculating..
-Pascal
#6
Compile the code as Release if you want many bots running.
In debug I couldn't exceed the 10 bots but in Release I can easily go to 50.
11/15/2003 (3:45 am)
Just a little sidenote:Compile the code as Release if you want many bots running.
In debug I couldn't exceed the 10 bots but in Release I can easily go to 50.
#7
I am having a little bit of a problem that might be related to this thread. I have bots integrated into the engine, they spawn when the game starts and I can spawn more if need be. But the starting number is only five. The game will run at around 10 fps with 50 bots fighting it out in a single player mission but when I have somebody join a multiplayer game my performance drops steadily after a few minutes of game play to lower than 1 fps with only the five original bots. I have changed the packet size as described in this thread but it still doesn't change anything. I am hoping that somebody has had some experience with this and can give me some advice.
Thanks allot!
Matt :)
11/19/2003 (11:40 am)
Hi, I am having a little bit of a problem that might be related to this thread. I have bots integrated into the engine, they spawn when the game starts and I can spawn more if need be. But the starting number is only five. The game will run at around 10 fps with 50 bots fighting it out in a single player mission but when I have somebody join a multiplayer game my performance drops steadily after a few minutes of game play to lower than 1 fps with only the five original bots. I have changed the packet size as described in this thread but it still doesn't change anything. I am hoping that somebody has had some experience with this and can give me some advice.
Thanks allot!
Matt :)
#8
11/19/2003 (12:11 pm)
To get many bots on screen, i went into Player.cc and deleted PlayerObjectType mask for collision detection. I have also implemented the hand to hand combat in my engine and can still attack bots, only difference is that collision between bots/players is turned off. This raised my FPS, as well as toning down the level of detail on the models drastically.
#9
@Matt - maybe a memory leak?
11/19/2003 (1:29 pm)
Yes, physics is a big hit when you have a lot of bots running around.@Matt - maybe a memory leak?
#10
11/20/2003 (9:06 am)
@Ben - I am working with Matt on this issue. Like he said, the performance is acceptable in single player mode, but as soon as someone else enters the game in multiplayer mode, it goes down to a crawl. Its like as soon as the game is played through the net, everything slows down. Any settings for network play we might have not set properly?
#11
Do you see any spikes in memory usage?
How big are your packets?
11/20/2003 (10:04 am)
Is the slowdown on both ends of the connection?Do you see any spikes in memory usage?
How big are your packets?
#12
So we both experience a slowdown when both playing... but if we are both playing and if there aren't any bots, then we both have a high fps.
There doesn't seem to be any memory peaks or leaks.
So to resume this, one player with lots of bots works ok, but 2 or more players with bots gets a major slowdown. 2 or more players without bots works ok.
It looks like the engine has too much information to transfer to the clients when there are bots.
In our client\prefs.cs, we both have this:
$Pref::Net::LagThreshold = "400";
$pref::Net::PacketRateToClient = "20";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "400";
before, we had the default that came with the
HEAD.
Is there anything else we should set? Thanks for helping :)
11/20/2003 (11:29 am)
Ok we did another test. Matt hosted a game with 10 bots + himself all fighting. He had around 50 fps. Then, I enter the game, we both get around 5-10 fps. We play for 5 minutes, then I leave the game, Matt gets back to 50 fps.So we both experience a slowdown when both playing... but if we are both playing and if there aren't any bots, then we both have a high fps.
There doesn't seem to be any memory peaks or leaks.
So to resume this, one player with lots of bots works ok, but 2 or more players with bots gets a major slowdown. 2 or more players without bots works ok.
It looks like the engine has too much information to transfer to the clients when there are bots.
In our client\prefs.cs, we both have this:
$Pref::Net::LagThreshold = "400";
$pref::Net::PacketRateToClient = "20";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "400";
before, we had the default that came with the
HEAD.
Is there anything else we should set? Thanks for helping :)
#13
11/25/2003 (10:54 am)
Ok, i solved this one, it had nothing to do with the network. I had a bug in my player list management.
#14
11/25/2003 (12:41 pm)
Hehehe. Glad you solved it. :)
Torque Owner Pascal
I upped the values ingame for
$pref::Net::PacketSize
$pref::Net::PacketRateToClient
(see netConnection.cc) and this
seemed to do the trick. I guess there
just wasn't enough bandwidth for the
10+ bots with the defaults.
-Pascal