General Raycasting Question

How expensive is raycasting? I’m designing AI for fast-moving objects, and the environment is going to get chaotically dynamic (lots of obstacles to be avoided moving around everywhere). I want to have it predict the best next move frequently, but, to do it, it’ll have to do raycasts from all potential future positions. Since movement is 3-dimensional, this amounts to a lot of raycasts.

I know I can constrain them a bit by not having the raycast go beyond a certain range and by limiting how far ahead it needs to predict, but it’ll stil be alot of raycasts? How much overhead is that gonna be, generally speaking?

Still looking for an answer to this one.

Um, it’s been 4 hours… this forum is active, but maybe give it a little more time :wink:

Perhaps you could clarify how many “a lot” actually is.

Not sure exactly. I high estimate would be 50 raycasts per frame. I do mean per frame and not per think cycle. I’ve already factored that in. I can’t imagine it’s going to be that expensive, but I need someone more in the know about ray casting to confirm it.