Solution Structure
Although you're free to set up your AI solution and projects any way you wish, we recommend
using a particular structure, which will allow you to write, test, and debug your AI programs all in
one solution.
Tip: The walk-through topics in this guide take you step by step through the process of
creating your solution, adding an AI class and code, and testing/debugging.
The solution should contain two projects: one whose output type is Class Library (.dll) to contain
your AI classes (because they must output as DLLs), and one whose output type is Windows®
Application (.exe) that will allow you to test and debug those AI programs. Let's assume the
former is named AI and the latter is named AIRunner.
The AIRunner project needs to have a reference to the AI project, and both projects need to have
references to the Bots AI Library assembly. Adding the reference to the Bots AI Library should be
done using the .NET tab of the Add Reference dialog, to ensure that the correct and latest version
is always used in your builds.
Naming Conventions
In choosing names for your project assemblies and namespaces for your classes, consider using
a convention such as "<your alias>.<AI collection name>" (without the quotes of course). For
example, if the alias you use is John123 and your solution is named MyFirstAI, then for your AI
project you could use "John123.MyFirstAI" for both the assembly and namespace name, and for
the AIRunner project you could use "John123.MyFirstAI.AIRunner" for both the assembly and
namespace name.
As a result of following the above convention, the fully qualified name of an AI class named Scout
would be something like "John123.MyFirstAI.Scout", which would be contained in a file named
"John123.MyFirstAI.dll". This would specifically identify your output files and your creations,
helping to avoid ambiguity if you ever share them or include other people's AI in your games.
Recommended Topics