Menu

Files and includes

NoQ

NullBot currently has two general files that are part of any of its personality. They are called nullbot-head.inc.js and nullbot-tail.inc.js.

The "head" file contains a few definitions that are useful for defining personalities. Most interesting part of it is definition of standard research paths and weapon classes.

The "tail" file is the most interesting part of the AI that defines its behaviour, like producing units, researching technologies or controlling combat groups.

Every NullBot personality is a set of three files. nullbot-(personality).inc.js contains all the personality-specific code; it's the only interesting file out of the three. nullbot-(personality).ai defines the AI by giving it a name and including a link to the third file, nullbot-(personality).js, which is actually a sequence of three includes:

include("multiplay/skirmish/nullbot-SHORTVERSION-head.inc.js");

include("multiplay/skirmish/nullbot-SHORTVERSION-(personality).inc.js");

include("multiplay/skirmish/nullbot-SHORTVERSION-tail.inc.js");

Thus, nullbot-(personality).js is the actual code of the personality, which is a simple concatenation of "head", personality-specific code and "tail".

See [Personalities] to know more about how personalities are defined.

The "SHORTVERSION" string is substituted by the actual version of the AI during the preprocessing done by [make.sh].


Related

Wiki: Home
Wiki: Personalities
Wiki: make.sh

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.