Page 7 of 57

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

Posted: 13 Feb 2012, 16:32
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 (:

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

Posted: 13 Feb 2012, 17:09
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...

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

Posted: 13 Feb 2012, 17:44
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.

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

Posted: 13 Feb 2012, 17:52
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 (:

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

Posted: 13 Feb 2012, 23:23
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.

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

Posted: 13 Feb 2012, 23:37
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?

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

Posted: 13 Feb 2012, 23:42
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.

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

Posted: 14 Feb 2012, 04:18
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...

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

Posted: 14 Feb 2012, 04:26
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

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

Posted: 14 Feb 2012, 08:27
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 (:

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

Posted: 14 Feb 2012, 10:29
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.

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

Posted: 14 Feb 2012, 10:47
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 (?)

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

Posted: 14 Feb 2012, 11:34
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;

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

Posted: 14 Feb 2012, 13:22
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.

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

Posted: 14 Feb 2012, 20:34
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.