[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!
x1400
New user
Posts: 2
Joined: 08 Mar 2012, 19:32

Re: NullBot v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by x1400 »

Wow, it's easy when you know how! Thanks a lot aubergine. Going to try and kick some bot butt now!
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by aubergine »

Turtle is fubar: not building any radars other than CB = it's arty isn't doing much good.

Also, sensor droids seem to be trying to target stuff deep within my base = outer defences pummel them to oblivion. With turtle approach, it's customary to wear away the outer defences first with arty before getting to the soft underbelly.
"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 v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by NoQ »

Hmm hmm hmm. I just can't set them to SCOUT, and OBSERVE doesn't make them stop and hit things. I will think on how to improve it. Probably just repeatedly tell them to target the nearest enemy object ...

x1400: It's all in the FAQ. Also, actually, you can unpack the .wz file into your game data folder (not into ~/.warzone2100-3.1, but into the game folder itself, wherever you compiled it or installed it (the latter being unnecessary btw)), and this way you can host multiplayer games with NullBot without asking other players to install it. Ok, i think i need to write it in the first message (:
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by aubergine »

Another problem with turtle - it seems to be focussing too much on sensor droids once it's got a few of it's key buildings made. I destroyed a bunch of it's trucks (like almost all of them) and it wasn't making any more. Also, it was building things like vtol factories when there were available oil resources nearby.
"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 v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by NoQ »

I just limited the amount of sensors it makes. Also, it uses some trucks for base buildings only while other trucks for oils only; probably all oil trucks were dead.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: NullBot v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by aubergine »

It seems to have a limit on the amount of oils it will take (and power gens it will build). I've not yet seen it make more than 2 powergens (turtle this is).
"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 v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by NoQ »

No, this doesn't seem to be the case.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot v1.0: an adaptive skirmish AI for Warzone 2100 v

Post by NoQ »

v1.01 hopefully fixes all the three issues aubergine has pointed out.

Changes:
  • Don't overproduce sensor tanks.
  • Make sure sensor tanks target nearest enemy.
  • Make sure truck production orders don't get overwritten by tank production orders.
What really bothers me is that if you call buildDroid(), the structure doesn't instantly stop being idle, and it doesn't stop being idle even in 200ms after that o.O but it certainly does sometimes stop being idle. So the problem with trucks is that i call produceTanks a bit later, but it overwrites truck building orders, much like previously truck building orders overwritten each other >.<
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 »

That must be while the data sync's amongst players internally in the game engine. Per mentioned that it can take a while for the game state to update across all players.

Maybe have something like this:

Code: Select all

function structureReady(struct) {
  // if we checked this structure less than 30 seconds ago, assume it's still busy
  if ( (struct.id in structureReady.lastCheck) && (structureReady.lastCheck[struct.id]+30000 > gameTime) ) {
    return false;
  }
  structureReady.lastCheck[struct.id] = gameTime;
  return structureIdle(struct) && (struct.status == BUILT);
}
structureReady.lastCheck = {};
Last edited by aubergine on 09 Mar 2012, 23:41, edited 2 times in total.
"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 Warzone 2100 v3.1+

Post by NoQ »

I think i'd just rearrange production code a bit, so that for each factory only one production order is called every time (:
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 »

I bet the structure remains idle if it's waiting for the green bar to fill, and only stops being idle once the yellow bar starts...?
"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 Warzone 2100 v3.1+

Post by NoQ »

There is no green bar (?)
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 »

There is a green bar on factories.

When you instruct a factory to build a droid, if you've not got enough power then the factory has to wait for power to accumulate = green bar phase, same sort of thing happens on research labs.

Once the factory has enough power to start building the droid, the bar goes yellow and construction begins.
"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 Warzone 2100 v3.1+

Post by NoQ »

Oops, hmm, this new green bar. No, i don't think so: i've been able to order 3 trucks at once even when i had a lot of power (at game start) (:
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.02

Changes:
  • Fix a few things that got broken when saving/loading a game;
  • Generic rocket AIs now always prefer bunker busters to mortars, even though the latter are still needed for CB technology;
  • A lot of internal invisible code simplification; hopefully, no more production order collisions.