- Home /
Pre-Emptive Optimisation Help
So I am creating an state driven AI system that involves a parent object controlling a group of child objects. The parent object will move itself and determine where the child objects need to be depending on the state it's in.
My question is would it be more efficient to store the transforms in the parent, and have the children retrieve them when needed or is it better to send the the transforms to the children immediately and have the children act on them on a state within them?
Also the children will inevitably "die" with this knowledge would this make storing the locations in the parent better as the children wouldn't cause null exceptions this way? Or am I better off making them inactive with the second approach and deestroying the parent that will include all scripts involved when all child objects are inactive?
And if you really wanna go the extra mile what method should I learn to prioritise particular transforms so that if a child that occupys a prioritised transform is to perish a child in the least prioritised transform would take its place.
Would be grateful for any pointers, I am really coming along with my code but this does push my boundries and would like to get it done with minimal CPU usage as there will be up to a dozen parents each with groups of child objects. Thank you in advance
Your answer
Follow this Question
Related Questions
Does moving around lots of unused naked tranforms consume cpu cycles? 1 Answer
Getting screenshots within a loop? 2 Answers
transform.localScale very slow on device (contrary to Android Remote) 2 Answers
Is there any way to use parenting as an organization tool without creating a Transform bond? 3 Answers
Return array of transform 2 Answers