MCRbot: a stronger skirmish AI

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

MCRbot: a stronger skirmish AI

Post by NoQ »

Machinegun/Cannon Researcher skirmish AI ("MCRbot") (well, i had to give it some name :oops: ) is a modification (pretty slight actually) of the original (aka "Nexus") AI.
  • mcrbot23-0-9.wz
    For warzone2100-2.3.9, install to mods/multiplay, replaces all AIs with MCRbots.
    (234.25 KiB) Downloaded 399 times
    mcrbot-0-8.wz
    For warzone2100-master, install to mods/multiplay, pick MCRbot for some players in game setup screen.
    (56.95 KiB) Downloaded 368 times
The following things were changed:
  • Focused research. MCRbot tries to research machinegun and cannon branches only (switching to lasers/railguns later), and thus progresses faster. I picked MG/Cannons branch because it requires only a minimal amount of micromanagement, in which AIs are usually bad. Unit templates were also adjusted accordingly (no more AT weapon overuse, harder to beat with pure cyborgs).
  • Earlier fundamental research. MCRbot tries to study research upgrades earlier. The Nexus AI seems to delay it too much.
  • Modified build order. MCRbot does the RFFRC->Halftracks build order, which seems to be one of the classic multiplayer 1vs1 strategies by now. In fact, it starts the game much like i usually do.
Drawbacks:
  • Even worse than Nexus when it comes to hover-only and VTOL-only maps.
  • Doesn't have any good anti-bunker weapon.
  • Vulnerable to rocket hit-and-run tactics Fixed in v0.2 (uses enough HPV cannons)
Known bugs:
  • Fails to follow the build order sometimes Fixed in v0.2.
  • VTOL templates are still to be updated Fixed in v0.2.
  • The game shows a few errors about missing templates, but there's nothing to worry about; they still work. Fixed in v0.3
  • Fails to start on some very rare maps (see also)Fixed in v0.4
Strength:
  • A medium MCRbot v0.1 is capable of defeating two allied medium Nexus AI bots on some maps (no bases/T1).
  • A medium MCRbot v0.1 usually defeats an Insane Nexus or Semperfi bot pretty easily on most maps (no bases/T1).
  • MCRbot v0.2 is stronger than MCRbot v0.1.
  • If you are able to defeat an Insane MCRbot v0.2 on Startup (no bases/T1), let me know (i can easily beat Insane Nexus though).
  • A medium MCRbot v0.4 is capable of defeating two allied hard Nexus AI bots on some maps (no bases/T1).
  • An easy MCRbot v0.4 is capable of defeating two allied easy Nexus AI bots on some maps (not two allied Semperfi bots though)
  • A full MCRbot v0.7 on warzone2100-2.3 (that is, without the "don't remove defenses" tweak) survives against a pure rush on Startup, even though Nexus dies in less than 6 minutes.
Acknowledgements:
  • Iluvalar pointed out that the AI doesn't research the research upgrades early enough.
  • Dylan_Hsu has taught me the basics of RFFRC build order and the slugs-and-shells strategy it transitions to.
  • Dylan_Dog has created one of the best skirmish AIs around, helping me to overcome the fear of scripting.
  • Per for a quite a few scripting hints.
Last edited by NoQ on 12 Jan 2012, 11:31, edited 24 times in total.
User avatar
Boris
Trained
Trained
Posts: 283
Joined: 24 Apr 2010, 13:52
Location: About 10 years playing and creating warzone.
Contact:

Re: MCRbot: a stronger skirmish AI for master

Post by Boris »

did you replace some weapon or this is now one?
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

now one
??

upd: You mean "new one"? Where do you see any new weapons?
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

Updated to v0.2. I'm still keeping v0.1 inside a mod, so you can try both of them by loading a single mod. The mod can be downloaded in the first message.

Changes:
  • No more random deviations from build order and research path; it is now much more deterministic.
  • More research path and template set tweaks. It now switches to newer designs more rapidly.
P.S. Anybody interested? (:
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: MCRbot: a stronger skirmish AI for master

Post by Per »

Cool. Will look at it. Mind if I steal some of your improvements and roll them back into the Nexus AI? :)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

Sure, of course, i'm even ready to explain them in detail (:

Even though it would be bad to replace Nexus with this bot (cause MCRbot is less varied; it doesn't really use almost half of the technologies), it could probably be somehow bundled with the game as an alternative AI (as long as it's a little bit more polished and i'm here to keep it working (?))
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: MCRbot: a stronger skirmish AI for master

Post by Per »

I get lots of assertions that strings are missing when I run the AI.I think you forgot to include the new strings file that describe the new templates in the mod.

Edit: Nevermind. I changed the code not to complain about it instead.

I tried a few test games. When I turn off cheating ('easy' difficulty), then Semperfi still seems to be superior. (Not sure why you didn't use that as basis for your mod?) By opening factory first it gets more trucks early on, and by building earlier HQ instead of factory number two it can contest enemy derricks and fortify its own with mg towers. MCRbot seems to be to be quite vulnerable to early game rushes, since you can't defend before your HQ is up. But this is just me observing AI vs AI skirmishes, I have no idea how they perform versus humans.

Some of the changes look good. I think I'll copy your buildFundamentals(), seems cleaner.

Not sure which of the tech and template changes that are applicable to Nexus/Semperfi, as I did not look to closely. If you have some suggestions, I'll look into them.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

Per wrote:I get lots of assertions that strings are missing when I run the AI.I think you forgot to include the new strings file that describe the new templates in the mod.
NoQ wrote:there's nothing to worry about; they still work.
I'm switching to constructing templates in run-time anyway; it also seems to be readable (:
Not sure which of the tech and template changes that are applicable to Nexus/Semperfi, as I did not look to closely. If you have some suggestions, I'll look into them.
Templates are certainly irrelevant. About the research path: 1. Please include halftracks somewhere at the beginning. Currently, Nexus doesn't research them until he wants tracks (i even made a ticket for this, when developer area still worked :oops: ) 2. Nexus should care a bit more about synaptic link etc. (research upgrades) (Iluvalar's idea)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

Also, releasing v0.3, even though it has some problems in it, i think it is an improvement anyway.

Changes:
  • Even more detailed build order (always constructs 3 factories and 3 labs at the beginning).
  • Changes in base structure building code (less delays between events, tries to keep a couple of trucks at base so that not to delay module construction)
  • Now uses MG towers for early oil wars (like Semperfi does)
  • Some more slight research and template tweaks.
  • No more buggy template names and missing strings.
Per wrote:By opening factory first it gets more trucks early on, and by building earlier HQ instead of factory number two it can contest enemy derricks and fortify its own with mg towers. MCRbot seems to be to be quite vulnerable to early game rushes, since you can't defend before your HQ is up.
What about now? I tried on v0.3, and MCRbot is just slightly slower with capturing oil, but recovers quickly and wins almost instantly with halftracks advantage this build order gives (hard to invent early halftracks with one lab).
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: MCRbot: a stronger skirmish AI for master

Post by Iluvalar »

you are aware that if you blindly rush mg tower, you are vulnerable again blindly cannon rushing opening ? It's a poor idea to teach that to an AI as it will be easy to stomp it using cannon.
Heretic 2.3 improver and proud of it.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

It doesn't rush mg towers in the sense it is usually understood (aka sending all trucks to the enemy base and building some towers in the middle). It just tends to fight for remote oils with that: if two trucks race for a power resource, and the enemy one reaches first, it orders his truck to build a (single) tower instead. That's common behavior of both Nexus and Semperfi on master. But Nexus just doesn't research towers early enough.

Anyhow, the effect is pretty slight, and i think it's usually positive; of course it is exploitable ... anything that is done blindly is exploitable, and when it is blindly not done, it is just as exploitable (?)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

v0.4 upgrade.

Changes:
  • Repeatedly retry at slightly different location when unable to build initial research lab. This helps overcoming the problem mentioned earlier.
  • Slow down factory/research module construction when lacking power (usually happens in easy (non-cheating) mode, MCRbot used to become very vulnerable on that phase).
  • More effort to keep a few trucks at base.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI for master

Post by NoQ »

v0.5 update.

Changes:
  • Now mixes some light cyborgs into the attack force (even harder to survive with pure lancer borg guerilla warfare).
  • More checks for failed build orders (it sometimes failed to build the second building).
  • Some more slight research and template tweaks (add late-game hover tanks, research VTOLs earlier).
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI

Post by NoQ »

v0.6 update.

Changes:
  • Finally, a version compatible with warzone2100-2.3 is available! They aren't really identical though.
  • Attack the enemy more aggressively.
  • Probably something else, don't really remember.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: MCRbot: a stronger skirmish AI

Post by NoQ »

v0.7 update for 2.3-based bot only >.<

Changes:
  • Fixed a bug with all templates available for human player as well.
  • Fixed a bug when AI sometimes ran out of power before completing its first gen.
Post Reply