AI Efficiency and Lots of Baddies
by Rhys Butler · in Technical Issues · 04/17/2003 (4:56 am) · 7 replies
Hey Guys,
I've recently purchased the SDK and am loving it. I have come up with my first question for you learned people out there though.
I have implimented some of the AI/Bot scripts and code that can be found in the forums and around. Generally they are great building blocks for some more specialized advanced functionality. (e.g. AI code like that found at www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3746)
However, I've noticed that once there is about 5 - 10 bots, the engine starts to slow down considerably. Im developing a small game but I'm wanting to have a plethora of AI enemies (not hundreds or anything, but certainly 40-50 in any one level). My question is, are a lot of the scripts on the forums just inefficient, or is the engine capabilities for AI inefficient? What might be a basic skeleton of a plan to impliment baddies and baddie AI where there maybe be many AI baddies?
Is there any plans to add further AI functionality to the engine, or is that not an issue anymore? Does anyone have any AI code or concepts where having a larger amount of bots doesnt choke the system? Is there another solution better than using the bot framework included in the SDK? Has anyone implimented a decent AI framework that will cater for multiple enemies (no more than a standard half-life level say).
A lot of questions I know, but they are all basically one large question. Any help anyone could give will of course be appreciated.
T.
I've recently purchased the SDK and am loving it. I have come up with my first question for you learned people out there though.
I have implimented some of the AI/Bot scripts and code that can be found in the forums and around. Generally they are great building blocks for some more specialized advanced functionality. (e.g. AI code like that found at www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3746)
However, I've noticed that once there is about 5 - 10 bots, the engine starts to slow down considerably. Im developing a small game but I'm wanting to have a plethora of AI enemies (not hundreds or anything, but certainly 40-50 in any one level). My question is, are a lot of the scripts on the forums just inefficient, or is the engine capabilities for AI inefficient? What might be a basic skeleton of a plan to impliment baddies and baddie AI where there maybe be many AI baddies?
Is there any plans to add further AI functionality to the engine, or is that not an issue anymore? Does anyone have any AI code or concepts where having a larger amount of bots doesnt choke the system? Is there another solution better than using the bot framework included in the SDK? Has anyone implimented a decent AI framework that will cater for multiple enemies (no more than a standard half-life level say).
A lot of questions I know, but they are all basically one large question. Any help anyone could give will of course be appreciated.
T.
#2
T.
04/17/2003 (5:29 am)
Yes, I forgot to add that as one of the possibilities, and indeed I believe that very well may be the case, because even just adding bots with an unadjusted Bot AI still brings the whole thing down to a crawl.T.
#3
04/17/2003 (5:33 am)
I've had in the regions of 200-300 bots walking waypoints and didn't have much of an issue until I crested the hill and brought them into view...
#4
04/17/2003 (6:56 am)
On the other hand, when I added 8 static shape player models, my frame rate only dropped to 60, but when I restarted and added 8 bots, my frame rate dropped to 30. :/
#5
Ok, so let me rework the question. Displaying many "players" (i.e. not static shapes) seems to have quite a negative effect of fps (and so it should). If the engine (or any other for that matter) cannot handle showing many different player models simultaneously, what methods can we use to keep our frame rates up? I can think smart design of levels would ensure that not too many baddies are visible at any one time, but with Torque and its wide open spaces, how do we address the issue?
How does tribes 2, which is supposed to be able to handle MANY player models at any one time, do it? Could this be an issue with the test player model supplied with torque? How does T2 do it? Is the LOD for player models functioning properly?
Anyway, just some more thoughts to get the thinking juices stiring.
Thanks for your input btw guys.
T.
04/17/2003 (7:14 am)
Yes, I believe this is the issue, not so much the AI (although that does have some effect).Ok, so let me rework the question. Displaying many "players" (i.e. not static shapes) seems to have quite a negative effect of fps (and so it should). If the engine (or any other for that matter) cannot handle showing many different player models simultaneously, what methods can we use to keep our frame rates up? I can think smart design of levels would ensure that not too many baddies are visible at any one time, but with Torque and its wide open spaces, how do we address the issue?
How does tribes 2, which is supposed to be able to handle MANY player models at any one time, do it? Could this be an issue with the test player model supplied with torque? How does T2 do it? Is the LOD for player models functioning properly?
Anyway, just some more thoughts to get the thinking juices stiring.
Thanks for your input btw guys.
T.
#6
I am surprised to find that 8 static shapes of the player's body slows a system to 60 fps whereas 8 moving botes slows it to 60. Certainly there is a lot of processing going on when a player moves over the ground...but not *that* much.
Also...have you tried hosting a server on one machine and then joining it as a client? Does this change the FPS degradation?
04/17/2003 (7:34 am)
Here is a dumb question. Did you compile for Release, or where you testing a Debug build?I am surprised to find that 8 static shapes of the player's body slows a system to 60 fps whereas 8 moving botes slows it to 60. Certainly there is a lot of processing going on when a player moves over the ground...but not *that* much.
Also...have you tried hosting a server on one machine and then joining it as a client? Does this change the FPS degradation?
#7
Here's a dumb answer: I compiled in Debug. :'(
lol. I didn't even realize it! My god. When I tried compiling in Release, after spawning 8 bots, my framerate only goes down to oh, 90 fps when they're all on the same screen 5-20 feet away from me... Considering I'm on a GeForce 2 Ultra, that's pretty damn good.
Thanks, Paul. It's always the "dumb" questions that need to be asked!! This solved my problem. I hope it solves other's.
04/17/2003 (8:39 am)
Quote:Here is a dumb question. Did you compile for Release, or where you testing a Debug build?
Here's a dumb answer: I compiled in Debug. :'(
lol. I didn't even realize it! My god. When I tried compiling in Release, after spawning 8 bots, my framerate only goes down to oh, 90 fps when they're all on the same screen 5-20 feet away from me... Considering I'm on a GeForce 2 Ultra, that's pretty damn good.
Thanks, Paul. It's always the "dumb" questions that need to be asked!! This solved my problem. I hope it solves other's.
Associate Stefan Beffy Moises
what modells do you use? the standard player?
maybe try to add them at some distant location where they are completely out of sight....
I have yet to test this with more than a handful of bots...