- NullBot on SourceForge (GIT repository)
- Code: Select all
git clone git://git.code.sf.net/p/nullbot2100/code nullbot2100-code
NullBot is included into the game since 3.1, so you may use it without installing. If you want to try a different version or a different personality, use the standard procedure: Installing a mod. Detailed explanation below:
- There are several alternative ways of installing NullBot:
- Put the .wz files you downloaded into mods/autoload folder in your config folder. This is the easiest way, but it will break your multiplayer compatibility: you will be able to play only with people who have NullBot installed as well, until you remove these files.
- Put the .wz files into mods/multiplay folder in your config folder, and then enable them with --mod_mp command line option. Pretty much the same thing. This way, you can make separate icons for Warzone 2100, one is with this option, another is without any options, and click the second one when you want to play multiplayer.
- Unpack .wz file (which is, as usual, just a renamed .zip file) and put all *.js, *.js.inc and *.ai files into data/mp/multiplay/skirmish folder inside your game data folder (that is, in the same folder where warzone2100 executable is located) (i think it only exists when you compiled the game from source; you may try to pack it into base.wz instead). This way, you can actually host multiplayer games with NullBot without making all other players install the mod. Do not install the scavenger AI this way.
- effigy's hack: put the .wz files into your maps folder. Works much like the previous way of installing, but easier. Do not install the scavenger AI this way. Doesn't work on 3.1 beta11 and later!
- Another similar hack: unzip these .wz files straight into your config folder.
- NullBot is a non-cheating AI. Well, actually, it deity-cheats on hard difficulty and above (assumes full visibility; much like DyDo AI used to do; it doesn't share this full visibility with his teammates though), but it doesn't make him actually do anything impossible or violate game rules. Well, at least it doesn't give itself unlimited oil and fast research, and it doesn't build things that were not researched yet.
- NullBot multitasks with several groups. The whole army of NullBot is split into a varying number of groups (from 1 to 6, depending on the game situation), and droids of each group try to act together and help each other. Every group is responsible for a particular enemy player, even though multiple groups may fight against a single enemy. The average size of groups gets bigger as the game progresses.
- NullBot adapts to the enemy choices by changing its weapon choice and even research path based on the opponent's prefered way of playing. For instance, if you overuse cyborgs, you will be dealt with by NullBot's machineguns or flamers, and his research of anti-tank weapons will be cut, and if you make too many defensive structures, he will research and send mortars or bunker busters on you.
- NullBot has multiple personalities:
- Flamer spamer
- Rocket hover techer
- Turtle (defensive)
- NullBot works correctly on sea maps. Even though Hover AI is still stronger on sea-only maps, all other personalities have this adaptation enabled as well on all difficulty levels. It attacks ground-reachable enemies first, then tries to research hovers as soon as possible. It also doesn't use ground tanks against sea enemies. Note: it doesn't yet work correctly on VTOL-only maps.
Supported in-game chat commands (for warzone2100 v3.2+ only!):
- !nb who
Tell this to make NullBot introduce itself. It will reply with a message describing its version and personality. Should be supported by the NullBot personality to work.
- !nb set
Tell this to set NullBot's subpersonality. For instance, "!nb set mc" sets him to machineguns-cannons. Simply say "!nb set" to see a list of possible personalities. Should be supported by the NullBot personality to work.
- !nb res
Tell this to set NullBot's research paths. For instance, "!nb res mg" makes him prioritize machinegun research. Simply say "!nb res" to see a list of possible research path commands. Say !nb res 0 to make him stop researching completely. Say !nb res clear to make him proceed.
- !nb help
After dropping a beacon, say this to make NullBot bring his strongest group to the beacon to stay there for the next 5 minutes. You can repeat this command to bring more of his combat groups there, if any.
- !nb tx
Dismiss groups that were sent to help you, allowing them to do whatever NullBot wants.
- !nb truck
Ask NullBot to give you a truck. It will always give you one, even if it's his last truck, unless you are on truck limits. It will flash a beacon near your new truck. If you yourself have placed a beacon, he will give you a truck nearest to the beacon.
- !nb power
Ask NullBot to give you power. It will give you 1/3 of its power. This command is not very useful because the AI will most likely have almost-zero power.
- EASY: Research specialization and all adaptation mechanisms are disabled. The AI researches all technologies in a particular order and spams units without considering the opponent's choices, which makes him pretty weak. Note that lack of research specialization has less effect in team matches, where a team of 4 actually has a chance of researching most of the technologies.
- MEDIUM: Research specialization is enabled, but research and production adaptation is still disabled. The AI picks one of the five pre-defined narrow research paths and researches its sub-branches uniformly, regardless of the game situation.
- HARD: This is the best non-cheating AI i could make. It rapidly adapts its research path and unit designs to the enemy choices. Note that it doesn't necessarily defeat the Medium AI, because adaptation is not really effective against anybody who makes the same choices all the time. But this AI is designed to have as little amount of clear flaws exploitable by humans as possible; ideally, the only chance of defeating Hard AI is actually playing better than him.
- INSANE: This AI differs from Hard AI only due to the hard-coded cheats it is bound to use, like preserving all defenses in no-bases mode. On 3.2+, it will have double power (you can already see that in the current master).
Note that not all of these difficulty levels make sense for the extra personalities. They usually don't discriminate between Easy and Medium, because they were designed with a specific research path in mind. The difference between Medium and Hard is also less, because most of the personalities don't support research adaptation yet. For ~Turtle~ AI, Medium and Hard difficulties are completely equal, for it doesn't really produce tanks.
- Some of this code is highly ineffective and CPU-intensive. It may cause the game to slow down or stutter when you have a lot of units on the map and many AI instances are running simultaneously.
- AI units may sometimes get stuck. Even though some workarounds for it exist in the AI code, it should rather be fixed on the game/c++ side by creating a more effective pathfinder.
- This AI doesn't make proper use of map gateways. In v3.1, gateways are not supported at all by the JS engine, while in 3.2/master there is still no easy way to find out wether some tile of the gateway is already blocked.
- There is some strange error message about some "missing template 140" that i don't really understand, see also #3161. A certain workaround applied in v1.0, that makes this bug very rare, but it can still be reproduced artificially.
- Machinegun and cannon VTOLs may behave weirdly on 3.1, see also #3178
- NullBot doesn't use commanders. This won't be fixed until commanders are actually useful in multiplayer.
- The extra mod includes a remake of "Back to Basics" challenge (with NullBot ~MC~ as your enemy) and "Hide Behind Me" challenge (with NullBot ~MR~ controlling your allies). Note that NullBot is a non-cheating AI, so the challenges will not necessarily be more difficult or more easy.
- It also includes two more challenges: the "Startup" challenge (Startup T1 no bases, with NullBot ~MC~ as your enemy showing how the standard MG rush works), and the "Flame Wars" challenge, where you fight on Mountain map against NullBot ~Flame~ and two turtles.
- Here is a single-player challenge called "Anchor". It is based on NullBot v0.11 and features all four personalities this AI had.
- Here is a single-player challenge called "The Paradigm". It is based on NullBot v1.29 (~MC~ and ~Hover~ personalities), and you enjoy having a NullBot Scavenger AI as your ally.
AI vs. AI matches
Please read this howto carefully before trying to make AI vs. AI matches, to avoid many common mistakes.
- Pick a map with more than two players. There are some maps with a spectator positions, you can pick one, but don't rely on a spectator mod (explained below).
- Put yourself on a spectator position, or any other position that is ok to be empty.
- Make one of the AI teams allied with you, so that you had a place to put your outpost, and you are also able to monitor their research by having a research lab now.
- Enter debug mode ("cheat on" or shift+backspace).
- Kill your trucks or pre-placed combat units as soon as possible (select them and press Alt+K). Otherwise the enemy AIs will react on you and the experiment will no longer be clean. Any spectator mod can't do that (lack of removeObject in 3.1 JS API), so you can't rely on it.
- If you have any buildings, kill them one by one in the same manner (for the same reason).
- Scroll the screen view to one of the bases you are allied with.
- Open the debug menu (Ctrl+O), press the structures button.
- Give yourself a command center. But not your standard command center, but rather one of the three campaign command centers (New Paradigm, Collective or Nexus). Having a friendly standard command center so close will make NullBot stop taking oil that is closer to your CC than to his. Having your CC (of any kind) outside the allied base will distract enemy Nexus/Semperfi AIs (they will try to attack it), even though NullBots won't bother killing a CC.
- Give yoursef a lab to monitor friendly research.
- You can use the "deity" cheat to see what happens on the board.