Current projects:
RAIMIP - Remote AI Management Interface Proxy
This is not so much an AI proper as it is an interface for other AIs to leverage. Ignoring that, RAIMIP is the AI selected within the lobby. This uses the excellent Pyro RPC layer to locate and communicate with AIs created with the SAIL toolkit.
RAIMIP is very much a proxy. It maintains very little state. The state it does maintain is used to intelligently push events to SAIL AIs based on a combination of local unit tracking and event trigged by the game engine. The proxy also processes requests from SAIL AIs at deterministic developer specified intervals.
The proxy does not directly react to any events. Rather it updates internal state and obtains state for SAIL AIs as directed by SAIL AIs.
RAIMI - Remote AI Management Interface
A package which abstracts various values (constants, definitions, Commands, Interests) to facilitate communication between SAIL and RAIMIP. This decouples RAIMIP from SAIL and SAIL from RAIMIP. By decoupling it allows for AI development and limited testing to occur without actually running the spring engine or RAIMIP. As such events can be easily and independently triggered (couple lines of code with Pyro knowledge) in a test environment without requiring developers to constantly start/stop or even run the spring engine. This has a direct result in speeding AI development over and above what is already gained by developing in python.
SAIL - Spring AI Library
Aims to provide a multitude of benefits to would be AI developers by allowing them to concentrate on their AI implementation and behaviors rather than the multitude of common framework which is required before development can even begin.
In addition to accelerating AI development SAIL also completely abstracts and hides Pyro's RPC layer. SAIL "just works" without requiring Pyro, networking, or even RPC specific knowledge. Though to be clear, a properly configured networking stack is required. You might be surprised to learn the number of incorrectly configured windows boxes there are.
Elements I hope to address with SAIL include steerings primitives as well as specific behaviors, concurrency primitives (example, shared [reader/writer] locks), AI Planners (calling controllers), mapping primitives and basic implementations (threat, heat, terrain, metal, height, etc), unit abstractions (with concurrency support), various state caches, various decorators to ease using various primitives (example, locking), and economy primitives.
One major advantage of writing a SAIL AI is that the AI actually runs within its own address space (process). As such, it drastically increases scalability while imposing minimal overhead to the spring engine itself. This means AIs can now scale both horizontally (more CPUs and even more computers (thanks to RPC layer); including more CPUs on more machines) and vertically (faster hardware). This means AIs can continuously run completely independently of the spring engine it self, even without resorting to use of threads. This, of course, opens the door, for as much or as little use, of python's threading and processing modules as desired.
Swarm
Is my own AI. Right now its largely serving as a test bed to drive development for all of the layers on which it sits. Its current goals will remain vague until I'm ready to made it available.
SAIL Concepts
Low Latency and Asynchronousity
The vast majority of spring AI events result in the event being pushed to the SAIL AI via the Pyro RPC layer. Almost all of these events are what Pyro calls "one-way" events. Which is a fancy way of saying, the event is pushed to the SAIL AI and no response is expected, allowed, or even desired. This means the vast majority of spring engine events are extremely low latency in nature. Unlike many AIs which perform a multitude of processing associated with each event, which in turn "holds the frame" for the duration of all events for a given frame, RAIMIP simply notifies the SAIL AI of the event and returns control back to the spring engine. Effectively most events become asynchronous notification events, whereby, once the SAIL AI has been notified of the event, control is immediately returned back to the spring engine. This basically means RAIMIP queues the event within the network layer, control returns to the spring engine.
Ticks
One notable exception to RAIMIP's one-way calls are ticks proper. RAIMIP and SAIL allow AI developers several of ways to manage ticks and developer requested events. In other words, AI developers can configure the ratio of actual ticks received by RAIMIP (directly triggered by game engine) to how many are actually delivered to the SAIL AI (those actually called via RPC by RAIMIP to the SAIL AI). As SAIL AIs can effectively and efficiently run independently of ticks (details up to developer), a lower threshold, and therefore lower overhead on the spring engine, is both possible and preferred.
Timed
As its possible for ticks per second to drop below the maximum 30 ticks per second, the interface allows developers to also specify a timed interface, which is triggered by ticks, to in turn trigger a tick to the SAIL AI. This allows AI developers to contribute in load reduction, if desired. This likely has other uses but this is its primary goal - Command and Interest throttling, etc.
Asynchronous Model
Because SAIL AIs are largely asynchronous in nature, they require the ability to submit Commands and request state (via Interests) from the spring game engine. These tasks are managed via Commands and Interests.
Both Commands and Interests are locally queued within the SAIL framework and dispatched to RAIMIP during ticks. This means the requested SAIL AI tick interval specifies the upper limit at which SAIL AIs can provide feedback (Commands) to the simulation.
Interests
Interests are managed by RAIMIP. In a nutshell, a SAIL AI informs RAIMIP it is interested in monitoring units and/or features at given tick intervals. At the requested interval, RAIMIP collects current values and makes them available to the SAIL AI on that request frame interval.
Commands
Examples of Commands are move and fire. These are received by RAIMIP and processed on behalf of the SAIL AI after a tick notification is pushed to the SAIL AI. In fact, the majority of state obtained by RAIMIP, from a SAIL AI, is the return value obtain from the RPC tick method call.
Obviously I'm working on some concepts I've not previously seen applied to Spring AIs. As far as I know this creates the first extra-process AI implementation. Some concepts still require validation. Some scalability aspects my require additional turning and optimization. Regardless, the above glosses over many technical details and is by no means attempts to be an in depth technical overview.
I still have lots of work to do. RAIMIP is roughly 85% complete and is fairly functional. For example, Unit Interests are supported but Map Interests are currently absent. The SAIL framework proper is barely started. I have roughly 15% completed there, if that. Right now, most of what SAIL does is the RPC abstraction and integration with RAIMI to facilitate easy communication with RAIMIP. It does, however, provide a base AI (SAILAI) from which higher level AIs should be derived.
As for Swarm, it too has very little completed. Just the same, I have been able to do things like initiate hit and runs of multiple coms against another com. Obviously not a functional AI (lacks building, etc) but goes a long way toward test driving all the layers below it as well as validating the concept.
Let's hope this all sees the light of day!
