Game Development Community

AIPlayer performance

by John Klima · in Torque Game Engine · 06/20/2005 (7:55 am) · 12 replies

Hi all,

been working with bots, using AIplayer. i have loaded multiple bots, the more i load of course performance decreases. but even at only 8 bots, they appear to sort of "pulse" around. in other words, they don't move smoothly, they move, pause, move, pause etc... i guess as each one gets its slice of cpu. but 8 bots seems an incredibly small number to be exhibiting this kind of hit. is there some way to optimize? is there a better approach to NPC's than AIPlayer?

thanks,
j

#1
06/20/2005 (8:06 am)
I don't think this is a cpu problem. I think its a network problem (yes, even on a local host).
I similar problems with my game, and there are less problems when i increase the package size and/or package rate.
#2
06/20/2005 (8:17 am)
I have a similair problem... Framerate drops really low with too many bots. I always htought it was just a vid card issue... ie. pushing too many polys, and not associated with the actual bots thinking.

I pushed 35 bots before (BT's Jill at 3600 polys) and it seemed to run properly, despite the massivley low framerate.
#3
06/20/2005 (9:33 am)
Mmm, i was thinking it also might be network. how do you increase package size?
#4
06/20/2005 (10:43 am)
One other thing it might be: The various "think" calls are scheduled on 1/2 second delay... If you've extended that time for some reason, you'd start seeing noticable pauses.
#5
06/20/2005 (10:48 am)
Are they moving smoothly or jumping to there new location and hten pusing? And is the game smooth ? I mean is it low framerate with everything, or just jumpy bots (the player etc still moves smoothly) ?
#6
06/20/2005 (3:17 pm)
Increasing the package size and rate solved the problem. framerate was fine, so i thought it might be a threading issue. question is, at what point does increasing the package size and rate cause other problems.
#7
06/20/2005 (7:05 pm)
John - where do you increase the package size? I can't seem to find it.
#8
06/20/2005 (10:34 pm)
Every time you raise package size and/or rate, dial-up users playing your game online will
have serious performance issues. If everybody is using broadband, it shouldn't be too much of a problem. This is all just my poorly-educated opinion.
#9
06/21/2005 (12:37 am)
Yes, Midhir, but not all games are multiplayer. Some of us do use Torque for single player games, and it would be nice to, if not get totally rid of the network code, find some parameter values for which things could behave optimally.
#10
06/21/2005 (1:57 am)
Can anyone explain me why AI seems te be a heavier load for the network then normal players? I'm not too concerned about modem users having trouble becuase of higher package size/rate. What i am worried about is the higher bandwidth required by the server because of this.
#11
06/21/2005 (6:47 am)
@JMac - i started my project from tutorial.base, so for this it is located in prefs.cs. here's the section with my current values (it's "packet", not "package").

$pref::Net::PacketRateToClient = "32";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "450";


oddly, when i try to dial PacketSize up past 450, torque re-writes the value back down to 450 at runtime. regardless, these values seemed to solve my issues
#12
06/21/2005 (7:13 am)
Thanks John!