Why is there a new AI interface for the Spring Engine? Lets clear up some misunderstandings and explain things nice and clearly!I’ll start by explaining the problems with the old interface and how things are changing, but first lets lay some myths to rest.
What Interface Would This be?
The spring engine (RTS Strategy game engine), has an interface with which AI modules can be loaded into. These modules are then given control of a player, and play the game; when you play against the computer it is these AIs you are playing against. Many different people have built and are still building AIs for the spring engine, and this is how they do it. The spring developers themselves however do not maintain an ‘official’ AI, rather they bundle the most popular and active AIs in the community. An example of this would be my own AI project NTai.
Its a common conception that AI developers have abandoned the content, and are embarking upon an orgy of development by reinventing the wheel and cavorting with new and exotic programming languages nobody needs. This is nonsense, ignorant speculation by people who didn’t read the forum threads and made wild assumptions without any effort to understand the problem.
Its also seen by many that lua has made native AIs obsolete. This is nonsense, since lua AIs lack the vast amounts of code available to native AIs, such as geometric processing libraries, and networking, etc. Lua AIs are also much slower, something that is very important in an AI. There’s also a vast amount of pre-existing algorithms that native AI code can make use of.
What Is The AI Interface?
When you play against the computer, the computer has an AI in it that tells the computer controlled units what to do, how to behave, where to build etc etc. These are called skirmish AIs, and they’re built by AI developers who contribute to the community. Their code sits in a dll/so library which the spring engine uses via the ‘interface’
What Was Wrong With The Existing Interface?
The interface was initially satisfactory for the most part. It worked! But as time went on, it got messier. Guidelines where introduced to keep it tidy and they were flouted and it became a great big spaghetti monster of code, making it harder to learn the API and build new AIs.
After all this de-motivational code bloat, the engine moved to Linux support. One of the main requirements being the use of a specific compiler, mingw32. Most active AI developers however used Visual Studio, and the change to mingw32 was not welcomed. With Visual studio, all one had to do was load up the project and press build, and hey presto, out popped a dll! Debugging AIs was also much easier.
Mingw32 however changed everything. There were issues with setting up the build environment, IDEs that didn’t quite work, command line tools, new libraries, slower execution speeds, larger dll file sizes, etc, etc. Annoying quirks such as needing to put the AI on the same hard drive as the compiler, and fixes for Vista due to bugs in mingw made the whole system a tedious nightmare. What’s more, because it was a C++ AI interface, AI developers couldn’t just go back to visual studio without dragging the rest of spring with them and loosing Linux support.
As a result most AI developers lost their momentum, the number of new AI projects appearing nose dived, and AI development ground to a halt for the most part.
How Is the New Interface Going to Fix This?
The new interface is a C interface, not a C++ interface. This means that AI developers are no longer bound to the mingw32 compiler, and can now use Visual Studio once again if they wish. This makes the build process infinitely easier, and should be a huge boost to AI development.
Because the interface has also been redesigned, it has been envisaged that a more generic message based approach be taken to safeguard the interface against compatibility issues and future changes, as well as encourage a more modular approach to AI design. This means it should be easier for new AI developers to pick up and learn. A compatibility layer has been written to allow the existing AI code base to carry on, on top of the new interface.
Since the new system is modular, a system of wrappers and implementation libraries has been introduced, allowing new languages to be added, such as C#, Java, or even D. Since not all programmers know C++ , this expands the range of potential developers, as well as giving new tools to AI developers.
A shift in how lobby clients declare AIs has also taken place, presenting a unified mechanism for specifying AIs rather than one for lua AIs and one for c++ AIs. AI options are now possible too. The group AI interface has also been removed.