Page 1 of 1

GroupAI check calls

Posted: 16 Dec 2006, 20:55
by AF
According to MSVS debugger, everytime you select a unit it loads all the groupAIs and queries them then unloads them.

Why it has to load then unload the dll's is beyond me, especially when it does it when the dll is already loaded and running a groupAI.

And why these return values cant be cached, it isnt that much memory to have an array of bits (I believe there's an STL container for it too), indexed by the UnitDef index, which would rarely breach the 1kb mark, which is filled at startup.

Posted: 17 Dec 2006, 01:17
by Tobi
It's because it calls a function to check whether the AI does allow to be assigned to a certain unit.

Posted: 17 Dec 2006, 16:44
by AF
I know, i said that in my first post. Why it has to repeatedly do ti for every peewee in a group of ten peewees when the unit is selected and not once? Why it has todo them when they're selected and not when the selectAI button is pressed? And why the data cant be cached instead fo continuosly refigured out everytime a unit is selected.

This should only happen when the user presses the selectAI or the q button to list groupAI. Its like re-preloading MS Office when your mouse goes over the start menu button, or loading every webpage under the taspring.clan-sy.com domain everytiem you hover past a hyperlink to this site.

Posted: 17 Dec 2006, 20:29
by Tobi
It's because it hasn't been implemented then. If it bothers you, patch it.

It has yet to show up in the top 5 of most CPU eating functions in my profiles of spring, and I really don't have time to optimize the least CPU intensive 95% of the spring code. (Let alone optimizing the most CPU intensive 5%... :o)