question about unit callins for other teams
Are unit callins for units on other teams not triggered by design, or because of a limitation of the Spring AI interface?
The LuaAI has the potential to trigger unit callins for units on teams other than the AI's own, but I'm not sure if it should. It would certainly be useful for things I want to do with the BA/BAR config, but it would be confusing to have different sets of basic assumptions for different implementations of the AI.
By this you mean stuff like unitDestroyed enemyUnitDestroyed allyUnitDestroyed? In all honesty it was an oversight, the initial build of Shard, and the test batch runs never had allies, so the gap never showed up.
Perhaps in my own mind if it did cross my mind I'd say the legacy API passed both allied and your own units into unitIdle etc, but I'm almost certainly misremembering that ( if not then that's a serious bug that might explain regressions in KAIK/etc, but what are the chances of that? )
Design wise, I'd say that a Shard instance should take care of its own units, and allied units while factoring into decision making should never be directly controlled, in the same way modules never issue orders directly to units, they do it via proxy.
Modules should direct other Shard instances to do what they want, at which point the other instance can ignore or respond however it deems is appropriate. I don't want to rule out that not all Shards are equal, we might decide that when 3 Shards are allied, that 2 of them yield and become mere proxies, or that there may be differing Shard instances testing variations of code.
I mention that because the natural follow on from ally events is information sharing and coordination as you hinted at.
I'm going to adjust the events provided in AIBase, I notice enemy destroyed etc are missing which I'm surprised by
Ah, I hadn't considered having different callins, such as EnemyUnitDestroyed and AllyUnitDestroyed. I was considering just calling UnitDestroyed for every unit regardless of team. Using separate callins wouldn't break any assumptions.
Ok, great, I'll add such callins to the LuaAI gadget, too.
At the moment I'm not so much interested in information sharing, just not having to use game:GetFriendlies() to have any idea what's happening with allied units. There are a lot of defense and build location algorithms in the BA/BAR config that would benefit greatly from considering allied units. The clean way to do it would be with callins.