Game Development Community

C++ function for geting environement

by Artur Hallmann · in Torque Game Engine · 04/14/2005 (11:23 am) · 3 replies

Is there a function for call from C++ torque code who take all entity in LOS ?


i need this for made a bot who s managed by a neural network


i need also to know how to store all the visible entity into an array

tanks a lot

#1
04/14/2005 (11:26 am)
You could do a container search then do a LOS check on each of them and if you dont know how to put things in an array you probably shouldnt be asking that question
#2
04/14/2005 (11:32 am)
Yeah i have already think that but it ll be heavy if i make the test for each bot ...
#3
04/14/2005 (11:45 am)
I dont know how many bots you plan on having, but I highly doubt it will be so many that this method becomes cpu intensive.

No matter what you do you will have to do a LOS check for each bot. The only way around it is to do a 2D vector test to see if they are in your FOV before you do a LOS test. Other then that you aren't going to get a whole lot more optomization out of it. I would also write all your AI in script... And migrate it over to the engine after you got it working exactly the way you want it.