[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!
cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

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

Post by cue » 20 Oct 2012, 07:20

How about a gather and rush tactic without repair?
(simply eliminate repair).

User avatar
Andrie
Regular
Regular
Posts: 533
Joined: 20 Jun 2012, 14:11
Location: Suid Afrika

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

Post by Andrie » 20 Oct 2012, 08:26

Why do you want to eliminate repair?? O_o
"My IRC en multiplay naam is Andrie"

Groete Andrie

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 » 20 Oct 2012, 10:50

cue wrote:How about a gather and rush tactic without repair?
(simply eliminate repair).
I do not want to add more workarounds and to sacrifice more play strength to avoid the bug that everybody is waiting to get fixed anyway, regardless of any AI work. If anybody really wants a gather and rush (aka punching bag) AI, Nexus makes quite a good work in that, probably semperfi-js of master will be its replacement in this area.

raycast
Trained
Trained
Posts: 131
Joined: 12 Sep 2012, 19:16

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

Post by raycast » 20 Oct 2012, 13:27

With respect to repair issues. I've noticed the AIs love to build a lot of repair stations close to each other. And usually rather early in the game. It may be an idea to have the AI detect traffic jams (maybe this could actually be done globally by the WZ engine, as it should also be used in pathfinding), and then consider placing a repair station just outside. A repair station is not very expensive, but having one "forward" to get faster repair cycles can be very benefitial.

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

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

Post by Rman Virgil » 20 Oct 2012, 16:17

.

I've tended to assigning mechanics to combat groups over setting-up repair stations. I'm sure there are arguments against this.

Ideally, I would add another Command to the Retreat Threshold UI: Retreat at Medium Damage Out of Enemy Fire Range and NOT to a Repair Facility, HQ or LZ. Mechanics would be repairing throughout this maneuver. Of course if your implementing just for the A.I. you don't need to make UI changes. This all likely reflects that I favor multi-vector, mobile velocity, over scattered multiple entrenchments, though if re-supply logistics and threat assessment favor bringing Manufacturing closer to In Theater conflict, I will.

.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

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

Post by aubergine » 20 Oct 2012, 16:47

I used mechanics for the first time in a very long time in a skirmish last night and they were very effective early in the game. If an AI script can work out where to place mechanics outside danger zones, it would be relatively simple to treat mechanics as repair stations just like their structural counterparts.

For example, in NullBot, there's this function that gets a list of repair facilities:

Code: Select all

// returns a list of all repair facilities
function getRepairList() {
	var centers=[];
	for (var ally=0; ally<maxPlayers; ++ally) if (allianceExistsBetween(me,ally) || ally==me)
		for (var i=0; i<repair.length; ++i)
			centers = centers.concat(enumStruct(ally, repair[i]));
	return centers;
}
That could be updated to:

Code: Select all

// returns a list of all repair facilities
function getRepairList() {
   var stations=[];
   playerData.forEach(function(data,player) {
      if (me == player || allianceExistsBetween(me, player)) {
         stations = stations.concat(enumStruct(player, REPAIR_FACILITY))
                            .concat(enumStruct(player, REARM_PAD))
                            .concat( enumDroid(player, DROID_REPAIR));
      }
   });
   return stations;
}
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

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

Post by Rman Virgil » 20 Oct 2012, 17:29

.

Interesting.... and elegant, methinks.

Out of the danger zone I think would be tied to their health state and the threshold to retreat to x tiles out enemy fire range.... retreating away from the fire direction till they are no longer sustaining damage. How that would translate into actual script is beyond my eroded competance these days.

Here's another intriguing thing about mechanics. Upgraded their HP is 1245 to the 1000 for the RF base of 1000. 'Course if you do all the base structural upgrades you can max that HP to 3700. Haven’t done a comparative cost-benefit analysis (Iluvalar would be able to answer that in a heart beat, no doubt).

Then, as you intimated, there's the whole "timing" dimension and commitment to Research resources in early-mid game: Base Structures vs Borgs. These later decisions circle us back to the fundamental dynamic between entrenchment commitments vs mobile force (& type) commitments. Since we are here within the domain of Skirmish Mode fun-entertainment and NOT the strictures of winning competitive MP modus operandi, I think there's more latitude in exploring these type tactical variants. I also think this working solution excercises the greatest parsimony vs complexification of other possibilities while upping the fun-factor.
Last edited by Rman Virgil on 20 Oct 2012, 17:54, edited 2 times in total.

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 » 20 Oct 2012, 17:32

aubergine wrote:@Per - I tried experimenting with using transports for collecting damaged units and ran in to several problems:

* Sending a transport to where the damaged unit is, usually results in the transport getting destroyed or damaged (and how do you send transports for repair or recycling?)
...
I am sure it will take long to code, but i have an idea:
When there are 3-9 units close, they will get togeter and wait for a transport to pick them up, or for a repair unit. The transport would check what are safe routes where it won't get very damaged. And if there aren't, the units would wait for a repair unit or go back to base. Another idea is that if there were lot of units that got damaged and killed many times in the same place, if there aren't any units or defenses, some trucks would go there to build a repair facility. :lecture:
Edit: if there is a group of more than 9 units close to each other, they go back to a repair facility in group, because it would take long to take them in 1 transport.
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501

cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

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

Post by cue » 20 Oct 2012, 22:51

Out of danger might be very far away if you have good ripple/sensor coverage.
I think you would have to put in a limiting factor if the repair base is too far away rush the enemy (do or die).

Does the AI dispose of or limit the use of and building of repair stations after it gets auto repair?

I think its only in low oil maps that the amount of repair that the AI is doing is beneficial to its war.

cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

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

Post by cue » 21 Oct 2012, 03:57

Some more units stuck pics.
This time I dont understand, they are stuck on a ramp thats plenty wide.
I think its trying to use repair cyborgs but failing very badly.
wz2100-20121021_003728-Desert_fortress2-T1.png
wz2100-20121021_004149-Desert_fortress2-T1.png

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

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

Post by Rman Virgil » 21 Oct 2012, 06:05

.

I blew up these screens as much as I could for the most detail I could see.

Couldn't find any repair GFX. There's always a GFX when repairs are in progress. Looked for Mechanics too. Couldn't obviously dicern any. Most of the borgs I could identify were weaponized. There were a couple I couldn't identify one way or another but still no associated repair GFX. My eyes could be bad. Maybe you can identify them by an arrow or somethin.

Just to be clear....these are all NullBot unit templates, in a locked AI team, late T3, unit limits maxed-out a.?? Just curious, are you even still alive in this game..?

There certainly is plenty of passage room, that much is clear. If the different AI players in this mixed group are of a sudden divided in the cardinal directions of their movement orders, I can see such a jam up resulting.
.

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 » 21 Oct 2012, 11:53

I don't see a point discussing something we can't fix in the context of this thread, something that is not even AI-related. Let's just wait for the fix on the game side. I'm not currently appearing here very often, so every time i do, i need to watch through a couple of pages of these long offtopic posts with huge pictures and miss important things you're trying to say.
I've noticed the AIs love to build a lot of repair stations close to each other.
Humans do that too, it's natural to have all 5 repair facilities at one spot for instant repair. NullBot places them near oil derricks that are getting destroyed more often, when such derricks exist; it also puts more defenses there. Such derricks are naturally closer to the battle and more far from the base.

I'll have a look at what i can do about repair droids, probably it's really a good time to try using them. But sending-units-to-repair code is a bit slow: it may cause slowdowns if more repair spots become available.

cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

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

Post by cue » 21 Oct 2012, 12:36

I cannot see any repair GFX either, I just cannot find any other reason for them being there in that state.

Yes its NullBot 1.37, in a locked AI (5 AI top, 3 humans down), late T3 and all units maxed out.
And yes we are still alive and actually winning :)
Its some time since the AI stopped attacking us with a vengeance because all his units are stuck like this.
So the game gets boring :(
This is a very good co-op map by Giani

I get your point NoQ.
but those fixes have bean a long time coming, I see my best chance in you doing some magic with your NullBOt baby :)

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

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

Post by aubergine » 21 Oct 2012, 12:43

There seems to be two common themes for traffic jams:

1. Units going to a repair station in the base block newly produced units trying to leave the base. This issue could possibly be resolved within the AI script by preventing a repair station being built within X distance of the HQ?

2. Units getting jammed next to a "ramp + cliff" combo, often near base entrance but also anywhere else on the map that this sort of terrain exists. This is more an issue for pathfinding code in the game engine and Per's ideas are likely best suited to fix that.

As for performance, I've been using a construct like this to cache data for a single game tick:

Code: Select all

var repairCache = {
  time: 0,
  data: null
}

function getRepairList() {
  if (gameTime != repairCache.time) {
    repairCache.time = gameTime;
    // code to build list of repair stations goes here
    repairCache.data = centers;
  }
  return repairCache.data;
}
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

cue
Trained
Trained
Posts: 59
Joined: 06 Nov 2011, 00:12

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

Post by cue » 21 Oct 2012, 13:14

Could I get you to consider changing the Insane difficulty level and making it just like Hard, except with no repair..??
All units are set to do or die and never retreat.

Post Reply