Aquileo | Recent changes to wikihttps://sourceforge.net/p/nullbot2100/wiki/Recent changes to wikienTue, 20 Nov 2012 09:02:55 -0000Aquileo | WikiPage Files and includes modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Files%2520and%2520includes/<pre>--- v5
+++ v6
@@ -4,7 +4,7 @@
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](https://warzone.atlassian.net/wiki/pages/viewpage.action?pageId=590695):
+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](https://warzone.atlassian.net/wiki/pages/viewpage.action?pageId=360541):
include("multiplay/skirmish/nullbot-SHORTVERSION-head.inc.js");
</pre>NoQTue, 20 Nov 2012 09:02:55 -0000https://sourceforge.net046287cf0c35adce3c5c1ab53fefa576fe42926cAquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v15
+++ v16
@@ -25,6 +25,8 @@
### Subpersonalities of the Generic AI ###
Note that **constructPersonality()** is not merely a set of variable definitions, but rather a full-featured JS function. Generic AI uses that to randomize itself in every game. It starts with picking one of the research paths (MR, MC, FR, FC, or MF, organized as some sort of enum), and then controls all further stats based on this definitions (making a few more random definitions on the way).
+
+These subpersonalities are team-synchronized: if some team has multiple generic AIs, they all pick the same subpersonality.
### Simple and double lists ###
</pre>NoQMon, 03 Sep 2012 09:19:32 -0000https://sourceforge.net04098fe12a7095b85f541d9ce4c1a734946be91bAquileo | WikiPage make.sh modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/make.sh/<pre>--- v2
+++ v3
@@ -2,4 +2,6 @@
Every LONGVERSION word in any of the files will be substituted with something like "v1.0" when "sh make.sh 1 0" command is run, and every SHORTVERSION word is substituted by "1-0" in this case. It also adjusts file names by putting the "short" version right after the first dash.
-It currently compiles two mod files: *nullbot-(version).wz* and *nullbot-(version)-extras.wz*.
+make.sh also has a third optional parameter that can be set to 0 or 1, called LIGHTNESS. When set to 1, it produces the -light AI that plays worse but takes less CPU time.
+
+It currently compiles three mod files: *nullbot-(version).wz* and *nullbot-(version)-extras.wz* for the base game and *nullbot-(version)-contingency.wz* for the contingency mod AI.
</pre>NoQMon, 03 Sep 2012 09:17:51 -0000https://sourceforge.net7a5e7faa61aa909aafe13d76615d89d192cd0cf4Aquileo | WikiPage Combat tactics modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Combat%2520tactics/<pre>--- v2
+++ v3
@@ -12,7 +12,7 @@
This event is called when one of our units or structures is under attack, and contains code that makes NullBot respond adequately. For example, unit just attacked may be sent for repair when damaged, and other units of the same group will be ordered to destroy the attacker.
-Note that **eventAttacked()** is throttled, which means that not every single machinegun bullet will activate it, but it will only be called at certain maximal frequency. Thus, no proper micromanagement can be achieved in this function.
+Note that **eventAttacked()** is throttled in v3.1, which means that not every single machinegun bullet will activate it, but it will only be called at certain maximal frequency. Thus, no proper micromanagement can be achieved in this function in v3.1. On the other hand, on current Warzone 2100 master, the event is right now completely unthrottled. So the code of this event shouldn't be too complicated, or contain cpu-intensive procedures, or include some partial throttling on its own (which it does).
**regroupWarriors()**
</pre>NoQFri, 01 Jun 2012 12:29:26 -0000https://sourceforge.net38a924c464d2d98d21ff347c9599cf9bf5030b63Aquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v14
+++ v15
@@ -2,11 +2,9 @@
NullBot personalities are AIs with different behavior based on NullBot. They include the generic code of NullBot and also personality-specific code, as described in [Files and includes].
-Every personality definition is in fact a single constructor function. This constructor is called once at the start of the game (from within **pickPersonality()** function) to construct the global **personality** object queried in many different places of the code.
-
To define a new personality, you need to make a .inc.js file with personality definition, a .js file to combine .inc.js with the generic NullBot code, and an .ai file for the game to see the .js file.
-To see the properties that need to be initialized in the personality constructor function, you can take any existing personality as an example. Most of the properties are just constant values or arrays of game stat definitions (like research paths or weapon choices). There is one function though that needs to be defined; it is **buildOrder()** function that defines the way this personality starts the game.
+One part of personality definition is a constructor function called **constructPersonality()**. This constructor is called once at the start of the game to construct the global **personality** object queried in many different places of the code. To see the properties that need to be initialized in it, you can take any existing personality as an example. Most of the properties are just constant values or arrays of game stat definitions (like research paths or weapon choices). There is one more function though that needs to be defined; it is **buildOrder()** function that defines the way this personality starts the game. Note that this function is also defined globally, cause if it is defined as a **personality** object method, it will break during saving/loading a game.
For many of these properties, some standard values are already defined in *nullbot-head.inc.js*. You can either use them or inline your own.
</pre>NoQFri, 01 Jun 2012 11:29:25 -0000https://sourceforge.netbb2fdeea95d86c7ba951d0f15519c68614a18064Aquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v13
+++ v14
@@ -34,7 +34,7 @@
The items on top of every simple list will have a priority, while items at the bottom will be disregarded when items from the top are available. Thus, you put *better* weapons on top, and you put *early* research on top.
-In a double list, all simple sublists are equal. This is for making the AI mix different equivalent choices when it doesn't lead to much double work (eg. python and scorpion body, or medium cannon and hpv cannon). Note that every sublist that has at least one item available is considered, even if this item is already obsolete in the other sublist. So when defining cannon weapon list, you'd need to write something like \[ \[ light, medium, hpv \], \[ light, hpv, medium \] \] instead of \[ \[ light, medium \], \[ light, hpv \] \], otherwise the AI will keep building light cannons even when medium cannons are already available, if hpvs are not.
+In a double list, all simple sublists are equal. This is for making the AI mix different equivalent choices when it doesn't lead to much double work (eg. python and scorpion body, or medium cannon and hpv cannon). Note that every sublist that has at least one item available is considered, even if this item is already obsolete in the other sublist. So when defining cannon weapon list, you'd need to write something like \[ \[ light, medium, hpv \], \[ light, hpv, medium \] \] instead of \[ \[ light, medium \], \[ light, hpv \] \], otherwise the AI will keep building some light cannons even when medium cannons are already available, if hpvs are not.
#### Bodies ####
</pre>NoQFri, 01 Jun 2012 06:40:38 -0000https://sourceforge.net1d2742a570c9c01ed8c72e65551acff965785425Aquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v12
+++ v13
@@ -34,7 +34,7 @@
The items on top of every simple list will have a priority, while items at the bottom will be disregarded when items from the top are available. Thus, you put *better* weapons on top, and you put *early* research on top.
-In a double list, all simple sublists are equal. This is for making the AI mix different equivalent choices when it doesn't lead to much double work (eg. python and scorpion body, or medium cannon and hpv cannon). Note that every sublist that has at least one item available is considered, even if this item is already obsolete in the other sublist. So when defining cannon weapon list, you'd need to write something like \[ \[ light cannon, medium cannon, hpv cannon \], \[ light cannon, hpv cannon, medium cannon \] \], otherwise the AI will keep building light cannons even when medium cannons are already available, if hpvs are not.
+In a double list, all simple sublists are equal. This is for making the AI mix different equivalent choices when it doesn't lead to much double work (eg. python and scorpion body, or medium cannon and hpv cannon). Note that every sublist that has at least one item available is considered, even if this item is already obsolete in the other sublist. So when defining cannon weapon list, you'd need to write something like \[ \[ light, medium, hpv \], \[ light, hpv, medium \] \] instead of \[ \[ light, medium \], \[ light, hpv \] \], otherwise the AI will keep building light cannons even when medium cannons are already available, if hpvs are not.
#### Bodies ####
</pre>NoQFri, 01 Jun 2012 06:40:02 -0000https://sourceforge.netf96eedc7595a54264267f65f6c7144fee58ea449Aquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v11
+++ v12
@@ -28,7 +28,7 @@
Note that **constructPersonality()** is not merely a set of variable definitions, but rather a full-featured JS function. Generic AI uses that to randomize itself in every game. It starts with picking one of the research paths (MR, MC, FR, FC, or MF, organized as some sort of enum), and then controls all further stats based on this definitions (making a few more random definitions on the way).
-### One-dimensional lists and two-dimensional lists ###
+### Simple and double lists ###
Bodies, weapons, defenses and research paths are organized into lists, some of which are one-dimensional ("simple lists"), while others are two-dimensional ("double lists", lists of simple lists).
</pre>NoQFri, 01 Jun 2012 06:36:43 -0000https://sourceforge.netc40dae9ab9d74a8b001ac4df9cdf2f18acd7b84bAquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v10
+++ v11
@@ -78,4 +78,4 @@
The boolean value returned by **buildOrder()** is essential. Only after **buildOrder()** returns *false*, the AI starts to make other structures in **keepBuildingThings()** function.
-In fact, better modify an existing function than rewrite from scratch, because there are quite a few such caveats around.
+In fact, better modify an existing function than rewrite from scratch, because there are quite a few such hard-to-notice caveats around.
</pre>NoQFri, 01 Jun 2012 06:35:43 -0000https://sourceforge.net8daebbfd433abcdad97baffcf2254f5f812ddc83Aquileo | WikiPage Personalities modified by NoQhttps://sourceforge.net/p/nullbot2100/wiki/Personalities/<pre>--- v9
+++ v10
@@ -70,11 +70,11 @@
When a base is under attack, it is necessary to have some structures to make sure the base is operational, but building too many things is not effective, for they are instantly destroyed. Thus, a certain amount of thought is to be given to the *importance* parameter. Try playing the Garden map with ultimate scavenger AI mod to see how this parameter affects the NullBot's early game play when truck rushed by scavengers.
-In the code of this function, you can use many variables and functions defined in -head and -tail files.
+In the code of this function, you can use many variables and functions defined in -head and -tail files. For example, the Hover AI uses **iHaveHovers()** function to check wether it's time to build more factories.
To find out how many structures of certain type you already have, try **enumStruct(me,*type*).length** calls.
-Always check that a structure type is available before calling **buildBasicStructure()** with a **isStructureAvailable(*type*,me)** check. Otherwise the build order will hang in games where structure limits are set below normal.
+Always check that a structure type is available before calling **buildBasicStructure()** (use the **isStructureAvailable(*type*,me)** check). Otherwise the build order will hang in games where structure limits are set below normal.
The boolean value returned by **buildOrder()** is essential. Only after **buildOrder()** returns *false*, the AI starts to make other structures in **keepBuildingThings()** function.
</pre>NoQFri, 01 Jun 2012 06:34:44 -0000https://sourceforge.net8926018e05fea29c376342a8e7083ab2a76146fe