- 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:
Features:
- 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:
- Default
- MG/Rockets
- MG/Cannons
- 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.
- 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).
Known bugs:
- 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.
Please read this howto carefully before trying to make AI vs. AI matches, to avoid many common mistakes.