[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 Warzone 2100 v3.1+

Post by NoQ »

Jorzi wrote:Maybe if the force is large enough, the units should be set to do or die, rather than retreat at heavy damage.
By the time the force falls back, it's already small enough, i think :hmm:


P.S. Having some progress, but don't have time to finish right now ... seems to be easy though (:
effigy wrote:I guess I had the mod in my maps folder for some reason... it works with v1.05 aswell. I don't see a mod message when I launch wz, but I'm able to select him from the AI list.
Cool! Didn't know.
Also, good news: #3226 - sounds like injecting custom AIs into multiplayer games has been legalised (:
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

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

Post by effigy »

NoQ wrote:...
effigy wrote:I guess I had the mod in my maps folder for some reason... it works with v1.05 aswell. I don't see a mod message when I launch wz, but I'm able to select him from the AI list.
Cool! Didn't know.
Also, good news: #3226 - sounds like injecting custom AIs into multiplayer games has been legalised (:
Great! It's a bit messy currently, but I'm glad it's ok :)
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 Warzone 2100 v3.1+

Post by NoQ »

v1.06.

Changes:
  • Some anti-stucking workaround. He will still be stuck for a while before it detects that he is, but shouldn't be stuck forever any longer ... needs testing, of course.
  • Switch ~MC~ extra personality to FRCFF (having plans on it).
  • Some minor bugfixes.
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 »

Does NullBot adapt well when the factory limits are set? Like say No Tanks, or No Cyborgs, or No VTOLs? Perhaps it does, but no harm in asking I guess :P

P.S. Could you also post a link to your updated Changelog file? Would be easy to browse all the changes by version. Thanks.
"Speak when you are angry and you will make the best speech you will ever regret."
-- Ambrose Bierce
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 »

Does NullBot adapt well when the factory limits are set?
Not sure, but it shouldn't break completely.
Could you also post a link to your updated Changelog file?
I wonder if this link is good enough. Cause i don't have a better one. Or i could try to gather it somewhere in sf wiki ...
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 »

@JDW: I was looking through nullbot source the other day and it looks like in most places it will check isStructureAvailable() and thus take limits in to account - not sure if it does that on buildings like factories though, and that could confuse the build order and get stuck waiting for X buildings of type Y before moving on to next 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: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+

Post by NoQ »

not sure if it does that on buildings like factories though, and that could confuse the build order and get stuck waiting for X buildings of type Y before moving on to next task?
It should be all right, because if a structure is limited out, it is not available (!) and is therefore skipped.
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 »

Yes, but in your initial build order, eg. FRCFF, what happens if user has limited to 2 factories? The third F will not get built, so your build order will keep trying to build it?
"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 »

Code: Select all

	if (factoryCount < 3 && isStructureAvailable(factory,me)) {
		buildBasicStructure(factory); 
		return true;
	}
	if (genCount < 2 && isStructureAvailable(generator,me)) {
		buildBasicStructure(generator); 
		return true;
	}
	if (labCount < 2 && isStructureAvailable(lab,me)) {
		buildBasicStructure(lab); 
		return true;
	}
The "if" statement will fail if the structure is not available, so the next "if" statement will be called instead of "return".
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 »

My concern was whether Nullbot adapts well rather than break in such scenarios, but this discussion is also interesting.
"Speak when you are angry and you will make the best speech you will ever regret."
-- Ambrose Bierce
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 »

JDW wrote:My concern was whether Nullbot adapts well rather than break in such scenarios
No, not yet. It will keep researching cyborg armor even when cyborgs are switched off.
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 »

Still getting traffic jams:

ImageClick for large view

It looks like you're detecting a traffic jam and ordering units to attack, they start moving off but then the cluster regroup timer kicks in and they all rejoin the traffic jam.

So, I think when traffic jam is detected, order a mass strike against an enemy and disable the regrouping code for 60 seconds to give them a chance to at least get away from the traffic jam?

EDIT: Also, it looks like regroup timer is kicking in *way* too often, like once every 5 seconds or so, if not sooner. They should only regroup ever 20 seconds or more.

EDIT #2: Attached a savegame, there's a bug in current beta that it doesn't load up AIs properly from savegame, however it does seem to work for a few moments after the savegame is loaded, but then stalls again.
You do not have the required permissions to view the files attached to this post.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
effigy
Regular
Regular
Posts: 1217
Joined: 22 Jan 2010, 03:21

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

Post by effigy »

Is nullbot designed with "teamplay" in mind?

As usual with other AI's, he's greedy about capturing oils, yet recently in a 3v5 (5 hard NullBots) all five massed units mid game and went after one player, then the next, etc.
You do not have the required permissions to view the files attached to this post.
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 Warzone 2100 v3.1+

Post by NoQ »

Is nullbot designed with "teamplay" in mind?
No. Chat is necessary for this. The synchronized attacks you observed were random. On the other hand, once the AIs start multitasking (when it accumulates too many units for a single group, or fights against at least two forces), everyone of them will attack all of you uniformly.
there's a bug in current beta that it doesn't load up AIs properly from savegame
Emm, having a savegame without the other mod loaded could have made things easier as well (:
Nope, can't load :(

Ok yeah, disabling regroup on traffic jam management makes sense though.
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 »

By the way, i do most of traffic jam testing on this map.
aubergine: is this one better?

v1.07

Changes:
  • Some modifications in regrouping and traffic jam management code.