Game Development Community

AI kits and game performance...

by Paul Weston · in Torque 3D Professional · 09/15/2011 (8:37 am) · 24 replies

Hi all,

As our project nears completion and the game environment gets larger and more complex, we are noticing a real performance hit when we have the AI in the game. Even a small group of under 10 AI characters seems to really bog things down.

We are using the Universal AI Starter Kit, which we love for its simplicity and easy integration, but I can't help but wonder if perhaps our particular environment may be better suited to a different AI solution.

Wondering if anyone has any experience with the Tactical AI Kit - the demo works very well and has dozens of AI running in all directions and responding very quickly without any noticeable performance issues. Granted, the gameplay area in this demo may be markedly smaller and less complex than the entire interior of the Starship Enterprise, which is where we want our AI to be, but still the performance seems so good I am wondering if they have found a better way of handling the memory, etc, than we currently have with the UAISK.

No slight against Twisted Genius, his kit has more than served its purpose for us during the development of our project, but if there is a faster and less-intensive way to handle AI so we can have 10-20 characters on the ship without it slowing to a crawl, I'd be interested...

Basically, beaming out the AI crew increases framerate dramatically, even if only 3 out of the 10 default crew members is walking on a path and the others are stationary. Seems that the engine should be able to handle AI better than this?

Anyone have any experience in this area?

Many thanks!
Page«First 1 2 Next»
#21
09/21/2011 (6:51 am)
Hi all,

OK, an update...

Turns out our characters are pretty low-poly already, so LODs had only a small effect in terms of bettering performance. The biggest gain was in Steve's suggestion to stagger the thinking times of the AI, and to decrease the overall frequency of the think cycles.

Tried TJ's test of removing the think cycles, and as expected the fps went up. So we know that the AI is making a difference.

Benchmarked using Fraps, on a medium-to-high-end machine, we get anywhere from 30 to 60 fps with half the ship loaded, and this goes down to between 15 and 25 when the AI pops in (25 to 35 or so with the think cycles commented out). Better than it was, which was about 5 to 15 fps with AI before we made these changes. With the whole ship loaded though, we are still pretty slow at 1 to 10 fps. But it is playable as long as there is no AI (fps drops to below 5 and stays there when AI is beamed in with all decks loaded).

We do not use a lot of Visible Mesh collision types, except on our walls and floors, which need it or we pass through them. All other objects use Collision Mesh. We also have turned off shadow-casting by the sun, we don't need the shadows and they always were a big hit on performance, so they have not been in the build for some time.

Anyhow, marginally better now, however with the entire ship loaded it is still not feasible to beam in any AI or the game gets too slow. We are able to walk the whole ship now, top to bottom, as long as we turn off the AI spawning in the "All Decks" mission. As suggested, for this specific mission where everything is loaded, we will probably build a special AI routine that only spawns them in one or two at a time only in the area you are currently in.

On a side note, I am super-impressed with the new zoning features as I have stated before in a separate thread, however we find that now that the whole ship is in play the zones do not seem to be really improving performance as much as one would hope. For instance, when outside in space looking at the ship with its hull removed, there are no walls and almost no objects - meaning the zones are culling as they should. But there is still choppiness when looking around, as if the game is still rendering all that stuff even when it is not visible. I thought if we could make everything disappear in zones, that they would not be visible at all and the game would behave as if they were not there. So anyone have any ideas why even though it appears we've done everything right (thousands of objects are now disappearing and when outside there is basically no ship there), that when I rotate my view and look at where the ship should be, that my machine gets choppy as if it's trying to render those thousands of objects even though they are inside a zone?

Anyhow, probably a thought for another thread. Love the zoning, and it seems to work (there is a positive difference based on not having them there at all), but my initial amazement has now turned to puzzlement once I got up to having all 24 decks in play. I thought it would be faster. Anyone have any ideas on this? Tricks they've found to optimizing the zones?

Thanks again everyone for the help and advice.

Cheers
P
#22
09/21/2011 (7:00 am)
Good break down and testing there, out of interest what's the performance like when switching to basic lighting?
#23
09/21/2011 (7:07 am)
The benchmarks were run with video options all set to Normal. We can gain some performance by switching things to Low, and on my laptop I have to do this to get comparable performance to our desktop testing machine running in Normal. But I don't think we actually tried using BL vs. AL.

Will have to try testing using BL and see.
#24
09/21/2011 (7:13 am)
My guess is that the fps would be much higher, but then you'd not have the benefits that come with advanced lighting. I've not used pureLight, but this may be a question answered by those that have this product - are there any increases in performance by using pureLight instead? if you can reduce the lighting/options or target specific areas of your game that only require lighting then this may help.
Page«First 1 2 Next»