[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
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by aubergine »

In the AI-vs-AI guide, you wrote:
NoQ wrote: [*]Kill your trucks or pre-placed combat units as soon as possible (select them and press Alt+K). Otherwise the enemy AIs will react on you and the experiment will no longer be clean. Any spectator mod can't do that (lack of removeObject in 3.1 JS API), so you can't rely on it.
[*]If you have any buildings, kill them one by one in the same manner (for the same reason).
[/list]
You could try DORDER_DESTRUCT - I think I tested it once and it does make droids self-destruct.

As for buildings, there's removeStruct()

Re: Scav nullbot, I will give it another try with latest release.
"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: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

You could try DORDER_DESTRUCT
Hmm nice catch!! Will try.
Re: Scav nullbot, I will give it another try with latest release.
I didn't change anything there in the latest release. I still don't understand what are you trying to do, it sounded as if you are trying to make two scavenger mods fight each other, but i don't think it works out of the box. In the challenge with scavenger AIs, i had to make some tweaks, eg. stop treating any player (including yourself) as enemy, etc.
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by themac »

I wonder if there is some sort of timeout in the NullBot AI. I did save a skirmish game. Two NullBot AI were alive and me, active via Naxus autogame on. Both NullBots have a lot of units lurking around, not moving. They are producing some new of course, but seem not to fight anymore vs. the other AI. They look lazy to me. O.o
User avatar
Giani
Regular
Regular
Posts: 804
Joined: 23 Aug 2011, 22:42
Location: Argentina

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by Giani »

That is what happened to me. And that is why I said it wasn't a pathfinding bug.
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

Might it be broken savegameing as well? Do you get any errors?
Why don't you post that savegame, anyway? I'm begging for that for of the thread, but nobody did it yet.
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by themac »

Hello NoQ,

here I send you my savegame. :-)

Edit: Strange, now they are moving again. Yesterday I was watching the match for long, but they were just lurking around doing nothing.

themac
You do not have the required permissions to view the files attached to this post.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

Ok. In this game, both AIs are at 150 units cap, so they can't produce more/new/better units. At this time of game, they are attacking only when they manage to get 26 units in a group. The green AI has three groups capable of attacking (that is, having at least 26 units), so he makes some movements. The red AI has no groups capable of attacking, so he's waiting to produce more tanks, something he can't do.

What i can do to fix this?

I can make him throw units into attack in a dumb manner when he reaches the unit cap. Would it be a good idea? Cause it might make the AI play much worse on high-oil :hmm:

I should most certainly make him merge groups fighting against the same enemy; this happens when some of the players are defeated, so the groups start changing their target players, and he ends up attacking the same player with multiple groups, which is known to be ineffective. But it won't solve that (cause if these players were alive, the problem would have been there anyway). Finally, i can make him always merge underpacked groups, which may make sense.

Thanks for the nice feedback, will do (:
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

v1.33, mostly some subtle invisible fixes.

Changes:
  • Merge two combat (or VTOL) groups together if both of them don't have enough droids to fight (fixes the issue we just discussed, probably makes the AI play better in some cases).
  • Don't send regroup orders to droids that didn't leave the base yet (will probably reduce traffic jams at the base a bit).
  • Try to hunt for oil with builder trucks when we have no derricks and no oil hunt trucks (fixes this issue)
  • Return the droid to base after it picked up an oil drum, so that the trucks didn't stay vulnerable at the middle of the map (master only, doesn't work on 3.1).
  • Probably some more tweaks and fixes, and i wasn't really sure what they change.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by aubergine »

NoQ wrote: Return the droid to base after it picked up an oil drum, so that the trucks didn't stay vulnerable at the middle of the map (master only, doesn't work on 3.1).
Why doesn't it work on 3.1? If it's something to do with knowing when the barrel is picked up, that can be done using the following code:

Code: Select all

// if the droid is within 1.5 tiles of the item, assume it picked it up
function pickedUpThis(droid) {
  return (distBetweenTwoPoints(droid.x,droid.y,this.x,this.y) < 1.5);
}

function eventDestroyed(obj) {
  if (obj.type == FEATURE && obj.player==21) { // something was picked up (barrel or artefact)
    var myTrucks = enumDroid(me, DROID_CONSTRUCT);
    if (myTrucks.some(pickedUpThis, obj)) {
      // your truck has picked up the object
    }
  }
}
I use code like that in Enhanced SitRep Mod and it works great. You'd need to tweak it to work out which truck picked up the barrel, but it should be enough to get started.

BTW, what are you using that's 3.2 specific to achieve the task?
"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: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

BTW, what are you using that's 3.2 specific to achieve the task?
eventPickup :oops: yeah good idea (:
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by themac »

Finally, a new version of NullBot. Tnx NoQ. :-)
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by themac »

Sometimes NullBot is low in power, maybe it has lost his last oil derrick. Instead of forcing to get some oil derricks again, it starts building up base structures which will never be finished becaus NullBot does not have enough power left and it does not get one because it is no oil derrick taken. NullBot never aborts that order to build up the structure to be able to look for some oil instead. Then I send him some power and he continutes starting to build up some more base structures even if it has still not power for that. Sometimes it takes one oil derrick and is playing with that for a long time, not searching for some more derricks which are sometimes not too far away...
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

themac: savegame again?
I didn't investigate too much what he does when he is almost dead.
themac
Trained
Trained
Posts: 415
Joined: 17 Jul 2009, 19:14
Location: Germany

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by themac »

Here is the savegame (not showing the problem told before because I have send red NullBot power as much as needed for him to get more active someday, so red NullBot started again working after a long pause of turteling around) but once again you can see that red NullBot has tons of forces sitting duck doing nothing. O.o
You do not have the required permissions to view the files attached to this post.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.1+] NullBot: an adaptive skirmish AI

Post by NoQ »

Guys, is it a good idea to make him send to death some small groups of units that are anyway not enough to kill the enemy, if he is at the unit limits?

That's a pretty hard choice even for a human player. You know, he won't make a better army anyway. He already has all the technology researched. So why just throw away the tanks? There's no guarantee he will have a chance to rebuild them. Thus, i believe that sitting there and doing nothing is a right choice any good player will make, turning the game into a standard artillery war stalemate. Should i make the AI make an explicitly bad choice for fun?

In this particular savegame, ground forces are fine, but he doesn't consider his VTOL force to be strong enough to break through the enemy defenses. And, while being at 150 unit cap, he can't produce more VTOLs. themac: are you saying he should just throw them away because of that?

Anyway, i'd any time vote for forbidding games that last for 7 hours (: