put some files like TAResourceAI.lua, BattleGroupAI.lua and MicroJeffiesAI.lua and it'll Just Work(tm), you're asking for something that hasn't been done yet. not only in spring, but at all, and for good reasons. (actually, those files could work, but changing TAResourceAI.lua to, let's say, StarcraftResourceAI.lua without heavily modifying logic elsewhere is pretty much impossible.)
Not exactly. Certain things shouldn't be managed by a core DLL:
1. Economy. Why make an AI to manage an economy, when that's relatively simple math, needs to run only every 10-15 seconds or so, and then results in just a few orders being issued? No point, unless you're trying to duplicate human levels of efficiency- and there we go right back to my main point, which is that AI developers are the least-likely to even know what my game is about, let alone what choices to make at what point. Moreover, any halfway-decent AI should just plain cheat, when it comes to resources. Again, I understand that you guys want to model human behavior, that's nice and all... but ultimately, it pigeonholes your designs too much to be useful. P.U.R.E. is not a waaaaaay out of the mainstream. It's straightforward and pretty close to OTA. Yet none of the current AIs can handle Resistance's economy, nor do I predict I'll see one that can before my first non-beta release. So, CHEAT, dammit. Some of us aren't willing to wait forever.
2. Unit micro. Again, this is behavior that shouldn't run often. It'd be nice to have a fast DLL that performed unit-tracking behaviors, and informed a Lua decision-maker when my Jeffy is close enough to enemies that it should begin dancing... but the actual dancing should be handled through Lua.
3. Battlegroups. It's not that big of a deal to set up a Wait with Lua, or to simply assign units being built to a bog-standard Group, then tell them to assemble, then wait a minute, then go somewhere.
4. Determining what a Unit's purpose is. Here's a big thing that annoys me about every AI except for NTAI. They don't allow game developers to specify what the unit does, and then proceed to do various stupid crap with them.
In short... your examples are things that Lua can and
should be used for.
What Lua should
not do, in my opinion, are things like this:
1. Terrain analysis. Where are the high and low spots? Where is the closest place I can build Unit X, Y or Z? Am I looking for a point that's in the "lee" of incoming enemy fire? Do I need to find a chokepoint? Etc.
2. Metal analysis. Where would be the most efficient place for Unit X to build a mine next?
3. Threat analysis. Where is the largest threat on the map?
4. Scouting analysis (for non-cheating AI). What areas are unknown, or need to be refreshed? A DLL could divide up the map into sectors, rate their scouting values, and then return a table of locations located in the sectors, so that Lua could be used to pull one out of a hat and send a scout there.
5. Traffic analysis. I need to send a group to location X,Y- what would be the optimal way to avoid current and projected traffic in this zone?
See what I'm getting at? There are a
lot of serious crunchy things where I'd be the first one to say, "yeah, we need the fastest code we can get our hands on, to do that well". But... it doesn't have to be tightly interconnected to remain effective. Most of this stuff involves things that don't need to be updated often, and Lua could just ask it to return its current state when required.
The issue is that what's being done right now is doing lots of stuff that should
not be done at the AI level, which means, among other things, lots of assumptions about game design and unit behavior that just plain don't work, once we're not talking about BA.
<shrugs>
I'll just have to sit down and prove that this can be done in Lua, then. You guys are
entirely too pessimistic about what's possible, and how hard it is, and how useful it is.
Making a basic cheating AI with Lua is both practical and useful. I have most of it sketched out already, frankly.
Having one that can also interface with DLLs that could handle the complex tasks it needs to perform, such as efficient building placement, would result in an
enormous gain, in terms of effectiveness, and would make less cheating necessary.
But meh, that's not necessary, and if it ever arrives, great, if not, oh well.