[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!
Post Reply
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: yet another AI for v3.1+

Post by NoQ »

aubergine wrote:In the eventStartLevel() would it be worth using slightly more random numbers for the setTimer() calls to reduce the chances of multiple timers being triggered at the same time? On a 4 player map with 3 nullbots, the game will start to stutter after an hour or so due to lots of enumeration churning at the same time.
It's still fun for me to observe the stutter and know which timer is lagging up the game by measuring the time between those micro hangs. So i'd rather add a random delay before turning on fixed-period timers (: Ok, i see the point. Even more useful is to split the slow procedures into smaller parts connected with queue() calls.

Well, this is probably the first time in around 8 years i actually want a faster PC (:
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: NullBot: yet another AI for v3.1+

Post by aubergine »

I can divert some of my time to completing my .dither() function - you pass it a list and a function to run actions on that list and it dithers the enumeration over several frames...
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
dak180
Trained
Trained
Posts: 288
Joined: 01 Nov 2009, 23:58
Location: Keeper of the Mac Builds

Re: NullBot: yet another AI for v3.1+

Post by dak180 »

NoQ wrote:
effigy wrote:I was having a thought (and maybe I missed it having just read the whole thread) does NullBot recycle obsolete units? Could he? :)
That's one single nice idea, but i have no idea when or why exactly should the AI recycle units. In fact, i don't even know when i should do it as a human (: I mean, just too uncertain (:
Recycling units nets you some power and preserves the experience of the unit; new units created after units have been recycled will then receive that experience where the order is the highest level of experience first.

So generally any time you have an outdated design it is not a bad idea to recycle them when you are ready to build their replacements.
User:dak180
Keeper of the Mac Builds
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: yet another AI for v3.1+

Post by NoQ »

Well, i'm not yet ready to give a precise enough definition of an outdated design in all possible game situations.

I also can't really explore the design of any given droid via scripts. I could encode this info into the unit name though (:
I can divert some of my time to completing my .dither() function - you pass it a list and a function to run actions on that list and it dithers the enumeration over several frames...
I do something like that with attackStuff() function already. I'll try to do it manually when necessary, and it'd also be nice to have an automated way you propose (:
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: NullBot: yet another AI for v3.1+

Post by aubergine »

nullbot-0-17.wz: When it chooses the MC personality, it hardly builds any base structures, eg. just one research facility. After a few hours of playing on sk-startup t0, it still didn't have any base defences, there were 5 nearby oil resources that it hadn't built on and it had no vtols.
"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
Contact:

Re: NullBot: yet another AI for v3.1+

Post by effigy »

NoQ wrote:Well, i'm not yet ready to give a precise enough definition of an outdated design in all possible game situations.

I also can't really explore the design of any given droid via scripts. I could encode this info into the unit name though (:

...
Hmm... maybe something more generic like if droid x takes heavy damage 3 times it gets recycled, and/or everytime a unit gains rank with a limit that no more than 10-15% of all it's units be recycled at a time?
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: yet another AI for v3.1+

Post by NoQ »

aubergine wrote:nullbot-0-17.wz: When it chooses the MC personality, it hardly builds any base structures, eg. just one research facility. After a few hours of playing on sk-startup t0, it still didn't have any base defences, there were 5 nearby oil resources that it hadn't built on and it had no vtols.
v0.18.

Hopefully fixed. Looks like the built-in safeDest() function was unreliable :o
effigy wrote:Hmm... maybe something more generic like if droid x takes heavy damage 3 times it gets recycled, and/or everytime a unit gains rank with a limit that no more than 10-15% of all it's units be recycled at a time?
Well, lets start with trying to program the fact that if we have some redundant power stored, then it's a bad idea to recycle anything at all. Anyway, situations favoring recycling are extremely rare, i think. Especially when the AI can't make his units survive long enough to get obsolete.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: NullBot: yet another AI for v3.1+

Post by aubergine »

Latest version *much* better, however:

* Doesn't seem to build any sensors / CB towers
* Somewhat excessive number of repair stations!
* After first VTOL strike, subsequent VTOL attacks contain only a small number of units = stormbringer fodder

That being said, it's first VTOL strike was epic! About 50 VTOLs all headed my way at the same time, luckily I'd lined the mountains with stormbringers and there was much carnage :)

Right, now I'm going to hurl 100 VTOLs at it's base, it's not built any air defences as usual...
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: NullBot: yet another AI for v3.1+

Post by aubergine »

Another thing: If I attack with VTOLs, it finally makes a few AA sites, but if I then VTOL attack a derrick, for example, it stops building the AA sites. You mentioned that if under VTOL attack it puts all other building on hold? Maybe it's cancelling the building of AA sites because it's being attacked by VTOLs? :P
"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: yet another AI for v3.1+

Post by NoQ »

Doesn't seem to build any sensors / CB towers
I think it does, but only after it invents artillery.
upd: just checked, it does. Not much though. Also, CB towers are always built when available, but at the base only. Probably i could already try to mix some sensors in attack groups!
Somewhat excessive number of repair stations!
Never too much. There is a limit on them anyway. That is much better than an excessive number of defenses.
After first VTOL strike, subsequent VTOL attacks contain only a small number of units = stormbringer fodder
Can we actually order a VTOL to return for rearm and then just sit there? Cause after rearm they just keep attacking the targets they were given, until they (or they) are destroyed.
That being said, it's first VTOL strike was epic! About 50 VTOLs all headed my way at the same time, luckily I'd lined the mountains with stormbringers and there was much carnage
That was not intended. The first attack should have contained exactly 4 units, and so far i couldn't reproduce that issue; could you give me a hint of on what map that happened? Are you sure it didn't attack something else before?
If I attack with VTOLs, it finally makes a few AA sites, but if I then VTOL attack a derrick, for example, it stops building the AA sites. You mentioned that if under VTOL attack it puts all other building on hold? Maybe it's cancelling the building of AA sites because it's being attacked by VTOLs?
Yeah, it does, but it is programmed to return and finish unfinished structures at some point. I could try to reduce the effect though.
Right, now I'm going to hurl 100 VTOLs at it's base, it's not built any air defences as usual...
I think we were just given some v3.2-only functions to make necessary adaptation. Ok, gone working on it (:
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: NullBot: yet another AI for v3.1+

Post by Cyp »

NoQ wrote:..
...
Can we actually order a VTOL to return for rearm and then just sit there? Cause after rearm they just keep attacking the targets they were given, until they (or they) are destroyed.

...
Yes, by ordering the VTOL to move somewhere (anywhere), and then immediately ordering it to rearm.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: yet another AI for v3.1+

Post by NoQ »

Cyp wrote:... ordering it to rearm.
We only have orderDroidObj and orderDroidLoc and orderDroidBuild, none of which is suitable for a rearm order that doesn't take any parameters (?)
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: NullBot: yet another AI for v3.1+

Post by NoQ »

v0.19

Changes:
  • No longer runs out of power before first generator is built in T3/nobases games;
  • Builds a bit less repair facilities and a bit more sensors;
  • Builds some anti-air defenses even when not attacked (v3.2+/master only);
  • Doesn't always leave structures unfinished when going to build AA, but only sometimes;
  • MR, MC and Flame personalities are now in the base package, while Hover and Generic are still in the extra;
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: NullBot: yet another AI for v3.1+

Post by aubergine »

I think it does, but only after it invents artillery.
upd: just checked, it does. Not much though. Also, CB towers are always built when available, but at the base only. Probably i could already try to mix some sensors in attack groups!
It would be better to build CB towers before building arty IMHO, otherwise when my arty returns fire, your arty just sits there not knowing what's shooting at it = quickly destroyed.
Can we actually order a VTOL to return for rearm and then just sit there? Cause after rearm they just keep attacking the targets they were given, until they (or they) are destroyed.
You might be able to do that by issuing a DORDER_STOP followed by DORDER_REARM?
That was not intended. The first attack should have contained exactly 4 units, and so far i couldn't reproduce that issue; could you give me a hint of on what map that happened? Are you sure it didn't attack something else before?
I didn't see it attack anything beforehand. It looked like it was just churning out VTOLs for quite some time at two VTOL factories. It was only when some of my arty started attacking your structures that they woke up and went on the rampage.
I think we were just given some v3.2-only functions to make necessary adaptation. Ok, gone working on it (:
Could you let me know what was added? I need to update my JS API docu site.
"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: yet another AI for v3.1+

Post by NoQ »

It would be better to build CB towers before building arty IMHO, otherwise when my arty returns fire, your arty just sits there not knowing what's shooting at it = quickly destroyed.
That's exactly what i currently do. At least three CB towers are certain to have been built immediately after they are researched, and sensors start to appear at the same time. Are you saying it doesn't work?
Could you let me know what was added? I need to update my JS API docu site.
You already did (: I'm refering to canHitAir and canHitGround properties of structures (and droids) that are useful to count how much AA i already have.
I didn't see it attack anything beforehand. It looked like it was just churning out VTOLs for quite some time at two VTOL factories. It was only when some of my arty started attacking your structures that they woke up and went on the rampage.
May i ask again what map and what game setup you were playing?
You might be able to do that by issuing a DORDER_STOP followed by DORDER_REARM?
Sure, but i still have no idea how to issue them. We don't have a function to issue orders that don't need a target.
Post Reply