[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!
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

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

Post by Cyp »

Why is chat necessary for teamplay? Would probably make sense if it tried helping without being asked, since it might not understand humans chatting on the same team, anyway. (Unless you're implementing a natural language parser.)

It's good at taking oil, but it might be better if it spent more efforts on taking oil on its half of the map (while the other team takes oil on its side of the map, instead), and less efforts on taking oil in its allies' bases.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

Cyp wrote:Why is chat necessary for teamplay? Would probably make sense if it tried helping without being asked, since it might not understand humans chatting on the same team, anyway. (Unless you're implementing a natural language parser.)
Helping in defending the bases doesn't require chat, but concentrating attacks does, i think. I might have a look.
Cyp wrote:It's good at taking oil, but it might be better if it spent more efforts on taking oil on its half of the map (while the other team takes oil on its side of the map, instead), and less efforts on taking oil in its allies' bases.
Well, probably i need to add an exception. The definition of the "oil in allies' bases" is pretty vague though. How would you define it?
Last edited by NoQ on 22 Mar 2012, 10:57, edited 1 time in total.
User avatar
Flail13
Code contributor
Code contributor
Posts: 263
Joined: 16 May 2008, 12:00

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

Post by Flail13 »

NoQ wrote:The definition of the "oil in allies' bases" is pretty vague though.
One way is to find the AI's closest truck to the oil in question, then find the closest allied truck to the same oil. If the AI's truck is closer than the ally's then it tries to build on it. - I tried to make a skirmish AI once.
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

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

Post by Cyp »

NoQ wrote:...
Cyp wrote:...
Well, probably i need to add an exception. The definition of the "oil in allies' bases" is pretty vague though. How would you define it?
An arbitrary formula, no idea if it's any good:

A = min(distance from allies to oil)
E = min(distance from enemies to oil)
S = distance from self to oil

f = min(max(1/S - 1/A + 1/E, 0.5/S), 1.5/S)

And then prefer oils with large values of f. There's probably better formulas.

Don't know what the best way of defining the distance from allies/enemies/self is, since bases sometimes need to be relocated suddenly.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

v1.08

Changes:
  • Don't take allies' oil (picked Flail13's solution ... works fairly well, didn't try Cyp's one though >.<)
  • Make use of transfered units (eg., if you give him a truck, it will actually build things with it)
  • Use the workaround code from v3.1 even on master/3.2+ when it comes to sending units for repair (v3.1 code is known to have some nice features, like retreating to allies' repair centers and repairing VTOLs at repair centers)
  • Regroup a bit more often after all
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

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

Post by aubergine »

Motorways are clear, no traffic jams to report :)

Although my gameplay has changed drastically - I no longer turtle! I blame NullBot (:
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
JDW
Regular
Regular
Posts: 1669
Joined: 18 May 2010, 20:44

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

Post by JDW »

On a 5 (4 NullBots + Me) vs 5 (Humans) game, we found a few places where it could improve,

At one point one of the bots had forgotten to build a power generator and so I had to lend him power (which he has yet to return to me btw) .
wz2100-20120323_044739-Metacity-T1.jpg

Another thing it failed at was building modules even though it had it researched.
wz2100-20120323_045753-Metacity-T1.jpg
You do not have the required permissions to view the files attached to this post.
"Speak when you are angry and you will make the best speech you will ever regret."
-- Ambrose Bierce
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

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

Post by Berg »

not to put off topic into threaqd but can the bot also control scavs by default?
Just an idea
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

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

Post by aubergine »

Scavs are controlled separately by scavfact.js, in theory it could control scavs but scav's don't have a truck to build stuff, or research labs to learn tech.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

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

Post by Berg »

scavs dont have a lot so lets give it them.

anyway its just a idea prolly need its own thread
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

Although my gameplay has changed drastically - I no longer turtle! I blame NullBot (:
The same would have happened after your first day in multiplayer, but since you didn't want ... :geek:
Scavs are controlled separately by scavfact.js, in theory it could control scavs but scav's don't have a truck to build stuff, or research labs to learn tech.
The main problem is that while modifying AIs is about adding files, modifying scavengers is about replacing. So NullBot installation doesn't modify any existing data, which brings many benefits, but if i start working on scavfact.js, these benefits will vanish.
Another thing it failed at was building modules even though it had it researched.
At one point one of the bots had forgotten to build a power generator and so I had to lend him power
I will have a look :oops: probably more unit over-pays? Cause when humans implement this build order, they clearly have a lot of power left before the first gen. I still couldn't ever reproduce unbuild modules :hmm:

May i ask if there were any console/stderr messages? Cause every time at least one console/stderr message appears from nullbot, it is worth investigating.
(which he has yet to return to me btw)
Lol, btw, maybe i should make them repay :?:
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

v1.09.

Changes:
  • React on scavengers properly (lol, with the new scavenger mod, i had to fix NullBot to make it survive from time to time).
  • Fix: don't stop building modules when unable to complete the build order due to lack of space or due to danger or something like that.
NOTE: NullBot currently doesn't work on master (git) due to #3366, but 3.1 beta users are unaffected (yet?).
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

v1.10: yet another little bugfix release.
  • Works correctly when given no trucks at start (at least don't crash, and try to do whatever we can).
  • Consider combat engineers when trying not to take allies' oil (they were not captured in enumDroid(me,DROID_CONSTRUCT) call).
  • Remove dynamic number of groups support from the code (it is dynamic enough even without it).
The first two bugs were caught when testing NullBot on the "Gang War" map by p0l1z1.

These little bugfix releases show that i'm pretty much satisfied with NullBot. Chat, unit/money transfer and improved gateway support are the nearest features planned, but they 1. won't work in 3.1 anyway and 2. their development is currently blocked by #3366.

Another obvious plan is to make a scavenger AI, based on the one used in the ultimate scavenger mod, but simplified to agree with the current game rules (that is, only scavfact.js is modified).
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base

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

Post by Goth Zagog-Thou »

Great job on the AI, NoQ. It kicks my butt nicely, every time.
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

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

Post by Giani »

There are different types of Nullbots for choosing weapons? For example, 1 type of Nullbot always uses mg+cannons and other Nullbot uses rockets+flamers. Or Nullbot randomly chooses the combination of weapons?
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501