This is probably part of our problem, it would be faster to just have one set of data to copy, I -think-, instead of many calls :)hoijui wrote:i dont know the critical methods (except the already mentioned ones).
no, a unit object is never fully populated. each property is requested from the engine right when you request it from the Unit java Object.
So ideally, when someone requests info about a unit, get the whole unit and everything with it, keep that in cache for the frame, so at most one call per inspected unit per frame.
But ofcourse it's nowhere near that easy :)
1. If someone only wants the position of a lot of units for example, getting a lot of data for each unit would waste performance I think, and memory :) But this is something that could be checked with profiling.
2. Things like unit def never change per unit, so it's better to request it once per unit life, but that means you can't get -all- the unit info in one call, you need to split it up in parts, and how do you let the java code know when it should make it null (end of life) ? :)
3. things like a unit pos can be different even in one frame, because of the cheat thing.
It's complicated :)