[3.1+] NullBot: an adaptive 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

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

First, have you scripted your bot to recycle out-dated units?
No, not yet. Mostly two reasons excuses: 1. I couldn't come up with a good and simple definition of when the recycling is actually effective (in fact, i have no idea wether i myself should recycle units at some point in a real game) and 2. I haven't seen him actually preserve too many outdated units, so it doesn't really look like an important issue.

It does recycle old defenses though, the ones that are three levels below currently available. For example, if some personality prefers lancer towers to minipod towers, tank killer hardpoints to lancer towers and scourge towers to tank killer hardpoints, then it will demolish minipod towers (only) when scourge towers are available. Of course, i could include tank killers twice in this list, so it will recycle minipods when tank killers are available ... this scheme is pretty flexible.
and prolly replaces them with even more sensors lol
:oops: I'll fix the sensors by bounding the maximum sensor density in the next version (:
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by Iluvalar »

condition to recycle :
Experience bonus * Potential upgrade * Expected weapon modifier/now weapon modifier > 1/proportion of power recovered

Exemple 1:
1 level * mg=>medium cannon * 110 (I'm not fighting borgs) > 200%
125%^1*132%*110% = 181% => Not worth recycling yet
level2 ?
156%*121*110= 207% => recycle

Exemple 2 :
level 0* cannon=>hmg * 230% (i'm fighting borgs only) > 200
100 * 112% * 230% = 257% => switch those cannons

151% (Only 50% borgs now)
100 * 112% * 151 = 169% => Stay with cannons (but build hmg because >100% ;) )

What if we add cobra ?
100*112*125*151= 214% => recycle !

How to assess the power of a component?
If it's balanced the design of the player will follow the linear progression line "1+researchPoint/5000".

Each components in the design should do around 1/4 of the way (upgrades+upgrade+body+weapon).

ComponentPower=Pow(1+researchPoint/5000,1/4); ;)
Heretic 2.3 improver and proud of it.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by aubergine »

I think unit health and availability of repair stations/droids also needs to factor in to the decision to recycle. So, near start of game if you've got a heavily damaged droid and no way to repair it, might as well send it to be recycled and get 50% of it's value back to make a new droid. And, in most cases, that new droid will have upgraded body/weapons/propulsion too.

@Iluvalar - currently it's very difficult for AI to determine what stats a droid has. We can sort of work it out by droid name (which we can set when building the droid) but it's very messy and cumbersome, especially as the game progresses and we have to build an ever growing list of possible name combinations.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

v0.30 is up.

Changes:
  • Regroup even when too many units (was a nice tweak once, but now it's useless);
  • Doesn't build too many sensors: minimum distance between sensor towers is set to 10 tiles;
  • Research paths that include bombs now include VTOL factories as well;
  • Turtle AI now mixes anti-air into its defenses, uses plasmite bombs, had a few bugfixes.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by aubergine »

Ah, I see you fixed the excessive-radar issue, and also got it building some AA defences :)

Just one slight problem with the Turtle personality...

ImageClick for large view

Now it's not building any defence structures other than AA and almost no radars!

Actually, it did seem to have mortars at one point, but I think it recycled them in preference of AA defences.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

Yeah, just fixed the same thing. I think v0.30-Turtle will work fine when you run it on Hard.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by aubergine »

Here's something you don't see every day:

ImageClick for large view

Herds of scavs attacking a gazillion AA defences lol.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

Lol, sorry for ruining so many games :lol2: :oops:

v0.31.

Changes:
  • Sensor tanks are now ordered to DORDER_OBSERVE the target, which makes them target the long-range arty emplacements as well;
  • Improved counter-battery construction: build them at some max. density at spots that were actually attacked;
  • Build hardpoints around base on v3.1 (where no gateways information is available);
  • Turtle AI tweaks: fixed overuse of AA on Medium difficulty, now produces sensor tanks to target long-range arty, added a few mg towers into initial build order.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

v0.32:

Changes:
  • Queue AA construction at hot spots instead of distracting busy trucks;
  • New challenge bundled: "Flame Wars" (you fight against two turtles and a flamer on Sk-Mountains).
Iluvalar wrote:condition to recycle :
Not really everything we need to consider. For instance, even if recycling is effective, we can't recycle all our units when the enemy is about to attack, and there is no need to recycle anything at all when we have some unused power :hmm:
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by effigy »

I did a little battle vs. Nullbot 0.30 last night. Should he be this defenseless against mg rush? I know that's a problem for all AI, but I don't play against any AI very often.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
Iluvalar
Regular
Regular
Posts: 1828
Joined: 02 Oct 2010, 18:44

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by Iluvalar »

NoQ, I think those other conditions where obvious :
*You don't have recycled experience waiting
*You have the remaining power and production capacity to rebuild anew.

I guess you could simplify my equation a lot more by assuming that A) the unit have 1 level. B) the enemy adapted somewhat to old stuff and the weapon modifier is not more so good. C) You continued your own research.

That should be true most of the time, so you should be able to evaluate the condition above with only the age of the units as parameter :) .
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: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

effigy wrote:I did a little battle vs. Nullbot 0.30 last night. Should he be this defenseless against mg rush? I know that's a problem for all AI, but I don't play against any AI very often.
Of course not. It was supposed to beat you. Probably some bug in the JS engine :lol2:

I wonder what sort of tanks did you encounter at 08:00 (cause it was hard to see them ... tmg halftracks, i suppose?), and i wonder if a human could win this battle with proper micro. Or he should have fallen back even further and then strike back with a couple of minipods. You seem to have encountered a Flamer/Rocket guy, who is the techiest of all.

Of course he was supposed to do better. I'm gonna need to get back to 1x1 human testing, cause i didn't do much of it on the current generic AI yet. Probably he's still delaying early mg viper wheels production so that not to run out of power before a gen is built. But anyway, even if he's using the same strategy as you do, you will win easily due to better tactics and micro ... that's currently the real weakness, not the macro.
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by effigy »

At that point they were mostly tmg on half tracks, though i vaguely remember some smg half track. I didn't see any flamer or rockets.

Would Nullbot be stronger with bases on, or on a more open map?
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by NoQ »

Would Nullbot be stronger with bases on, or on a more open map?
No, i don't think so. It is doing the same thing on all maps, unless the base is very tight, so he has to move the tracks a lot (which is not the case here). The only thing i know is that it's very weak on T2+/No bases (starts with factories, but doesn't build modules early, but doesn't produce light tanks (you don't want to see heavy cannon leopard halftracks, really) ... need to think about T2/T3 specific build orders).

MC personality in -extra could have worked better. It's the currently rushest of all and has minimum troubles with micromanagement (cannons don't need much). But it's a bit too predictable. The NullBot itself is actually weaker than well-polished pre-defined personalities, but more fun due to unpredictability and using all technologies available.

Well, i'm afraid no AI will offer any good 1x1 challenge for a good player any time soon. But the input you are giving is very helpful, i'll be working on it ... (:
I didn't see any flamer or rockets.
I did, at the end, probably last 3 tanks it produced (:
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: NullBot: an adaptive skirmish AI for v3.1+

Post by effigy »

Oh, btw, the bot was on medium :)
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241