[3.2+] NullBot 3 ‘Reloaded’

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!

Re: [3.2+] NullBot 3 ‘Reloaded’

Postby NoQ » 13 Feb 2017, 08:04

I originally spent quite a bit of time tweaking Nexus AI, and after that JS was an awesome delight - in a few days i had an even stronger AI written from scratch. Even if the original high-level design of NullBot was nothing but a Nexus rip-off, the new language was still terrifically helpful. Nowadays i'd definitely prefer Python, but compared to WZScript, even Javascript is a fantastic thing to have.
User avatar
NoQ
Special
Special
 
Posts: 6041
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’

Postby Tzeentch » 14 Feb 2017, 00:23

Cool, I'll try it out sometime.

What is your next challenge? Can you make an A.I. that plays more unpredictably, in a random way?
More or less grey
User avatar
Tzeentch
Trained
Trained
 
Posts: 234
Joined: 14 Oct 2012, 14:24

Re: [3.2+] NullBot 3 ‘Reloaded’

Postby NoQ » 15 Feb 2017, 10:58

I cannot advance significantly further without using better design patterns in order to simplify logic. In this department, i believe the way to go is to start using decision trees, decisions taking multiple game frames if necessary for smooth performance; a well-designed support library is needed for that.

Generally, playing in a random way is essentially playing worse, because there are relatively few good strategies in the game for now (personalities already cover them mostly). NullBot3 is already much more surprising than the original NullBot because adaptation methods produce non-trivial results (for example sometimes it decides to spam mortars against offensive armies, because they fit just right against the tank:cyborg ratio he sees).

It would be great to make it attack from different corners or even from multiple directions at once (a tactic humans often underestimate - yes you engage with weaker army, but you do a lot of damage to the enemy base with your other half, so as long as you have enough defensive advantage to survive an all-in, not even necessarily an overally stronger army, it's well worth it, not to mention the possibility of surrounding and slashing droids that retreat to repair), but that'd require terrain analysis, which i've little idea how to implement. Having terrain analysis would open up a huge bunch of possibilities such as auto-detecting choke points, engaging in combat on them in concave formations.
User avatar
NoQ
Special
Special
 
Posts: 6041
Joined: 24 Dec 2009, 11:35
Location: /var/zone

A few thoughts

Postby Forgon » 08 Mar 2017, 19:55

Seizing oil
  • If a construction unit aims for an oil derrick yet comes second, the designated unit should target the closest alternative. If none exists, a defensive structure may be built to conquer it, but as soon as there is a new one and no other construction unit is closer, building should be halted in its favour. I consider the lack of all this Nullbot's greatest weakness.
  • Combat engineers should be sent to capture oil for their speed.
  • If oil barrels are only accessible through water, Hovers should be built to seize them. This should pay off in almost every case given the poor adaption to geography and consequent underuse of Hovers. Alternatively, the behaviour could be triggered by a threshold of additional power to be gained though that is too fishy for me.

    power.png
    All oil derricks are taken, 6 Hover trucks are available and power is lacking -- still no effort to seize the oil barrels.
    power.png (585.11 KiB) Viewed 372 times

  • Own structures blocking oil derricks from being rebuilt (e.g. on Sk-Rush) should be demolished temporarily.
  • With construction units to spare, those could build defensive structures next to enemy derricks proactively
Combat
  • Attacking units should not bypass enemy oil derricks along their path, but always destroy them before advancing.
  • Pursuit ought to last longer, e.g. right to the end of a base.
  • Repair closer to the front, either by units or facilities ahead of the base would reduce downtime in the army.
  • Some units, such as sensors or trucks should plan their routes around known enemy locations.
  • Any estimation of combat outcomes would be great. Sometimes very few units charge into many.
  • Sensors and Commanders could scout and lead units, especially artillery.
Trucks
  • Fewer trucks should be made and they should hunt power resources all the time instead of idling in large groups or trying to construct buildings with too little power available. Once their production limit is reached, efforts to make more must not block factories!
    idling.png
    Idling can become much worse than in this picture. Also notice the many factories despite a power shortage and how useless 2 sensors are next to each other.
    idling.png (773.86 KiB) Viewed 372 times
Buildings
  • There should only be so many factories as can realistically keep producing.
  • Defensive structures should guard the entry, not the inside or backside of a base.
    buildings.png
    Turtle AI shows to the extreme how poorly buildings are placed. All the effort will do very little in defense of his base.
    buildings.png (715.43 KiB) Viewed 372 times

  • Sensor Towers should not be built so close that their ranges overlap.
Orientation
  • If there was an easy way to teach a bot how to read a map and understand its geography, devs would have found it :|
Coordination
  • Trucks should not be used to seize derricks in an allied base but handed over so that he can rebuild.
Forgon
Greenhorn
 
Posts: 6
Joined: 07 Dec 2016, 22:23

Re: A few thoughts

Postby NoQ » 11 Mar 2017, 12:14

Forgon wrote:Seizing oil
  • If a construction unit aims for an oil derrick yet comes second, the designated unit should target the closest alternative.

Yep, i guess it's a good idea.

Forgon wrote:
    If none exists, a defensive structure may be built to conquer it

This, however, is highly situational.

(1) In most cases i, as a human, would prefer adding two machinegun viper wheel tanks to my army to building a machinegun tower near a derrick. I could use these two tanks to either destroy multiple undefended derricks, or scare the enemy army away in direct confrontation and gain control of more territory, hence more economy. The only case where machinegun towers are viable are remote derricks on large maps - diverting army to which is more costly. But determining this situation requires terrain analysis.

(2) I believe this is one of the features that's good in AI vs. AI matches, but i'd rarely use this trick against humans on tasteful maps.

(3) This is a feature that i feel annoying rather than delightful for new players.

For these three reasons, i'm holding this back until terrain analysis.

Forgon wrote:
    , but as soon as there is a new one and no other construction unit is closer, building should be halted in its favour. I consider the lack of all this Nullbot's greatest weakness.

  • Combat engineers should be sent to capture oil for their speed.

The time window when combat engineers are available and hover trucks aren't is very slow. Also, oil gets actively captured only at game start, and in only few setups you have engineers but not hovers available at start.

Forgon wrote:
  • If oil barrels are only accessible through water, Hovers should be built to seize them. This should pay off in almost every case given the poor adaption to geography and consequent underuse of Hovers. Alternatively, the behaviour could be triggered by a threshold of additional power to be gained though that is too fishy for me.

I didn't try to adapt NullBot to all possible crazy maps. Having large amounts of oil barrels pre-placed is just one of the things that makes the map crazy, by which i mean skewing the strategies you use dramatically. I believe it's generally a good idea to let NullBot adapt to such maps, but not at the cost of the code complexity, so i delay this stuff until i manage to deal with code complexity.

Forgon wrote:
  • Own structures blocking oil derricks from being rebuilt (e.g. on Sk-Rush) should be demolished temporarily.

Yep, agreed.

Forgon wrote:
  • With construction units to spare, those could build defensive structures next to enemy derricks proactively

Again, only if derricks are remote. Otherwise it's a waste. Also, it's much better to build said structures not next to the derrick, but at a shooting distance in a terrain-defended position (especially stuff like mortars).

Forgon wrote:Combat
  • Attacking units should not bypass enemy oil derricks along their path, but always destroy them before advancing.

That should already be the default behavior, i don't see wouldn't this happen. Moreover, most units will fire-on-move even on move-command.

Forgon wrote:
  • Pursuit ought to last longer, e.g. right to the end of a base.

What do you mean by pursuit? NullBot attacks as long as it has large army, and retreats when it thinks it doesn't have enough army to engage. There's no notion of pursuit, it doesn't care if he follows anybody or just attacks the base. You might be referring to the droid's default micro-AI behavior that NullBot doesn't control.

In any case, i don't understand the point of pursuit (eg. the "bring back the pursuit secondary order" debate), because you shouldn't ever let your single units split away from your army and go to enemy bases alone, that'd be weird.

Forgon wrote:
  • Repair closer to the front, either by units or facilities ahead of the base would reduce downtime in the army.

Yep. Support for repair droids would also be great in general.

Forgon wrote:
  • Some units, such as sensors or trucks should plan their routes around known enemy locations.

Yeah, and it requires making a custom pathfinding implementation (as part of terrain analysis).

Forgon wrote:
  • Any estimation of combat outcomes would be great. Sometimes very few units charge into many.

This shouldn't happen unless they're trying to rejoin the army. I agree that'd be a good feature - ideally a good AI shouldn't engage in combat at all unless he's sure he's winning.

Forgon wrote:
  • Sensors and Commanders could scout and lead units, especially artillery.

Commanders should never be in the front lines. They're too expensive. NullBot doesn't use them though.

Sensors are moving around freely though, it already works that way.

Forgon wrote:Trucks
  • Fewer trucks should be made


Many strong competitive players prefer starting the game with three factories before all other buildings, constantly producing trucks. This helps building the game faster and capturing the oil faster and eventually pays off.

Forgon wrote:
    and they should hunt power resources all the time instead of idling in large groups or trying to construct buildings with too little power available. Once their production limit is reached, efforts to make more must not block factories!

Agreed. I already tried to avoid blocking factories as much as i could.

Forgon wrote:Buildings
  • There should only be so many factories as can realistically keep producing.


NullBot builds more than 2-3 factories only when it sees all of them occupied. It should already work that way. However, the game changes (production times of different units changes, more classes of factories appear, modules appear), so the estimates skew around, which makes things difficult.

Forgon wrote:
  • Defensive structures should guard the entry, not the inside or backside of a base.

Yep, needs terrain analysis.

Forgon wrote:
  • Sensor Towers should not be built so close that their ranges overlap.

Should already work that way, strange.

Forgon wrote:
Orientation
  • If there was an easy way to teach a bot how to read a map and understand its geography, devs would have found it :|
Coordination
  • Trucks should not be used to seize derricks in an allied base but handed over so that he can rebuild.

I don't know how to rigorously define "allied base". If the player is so slow that NullBot can capture his oil before him, then he probably should do so. You can make NullBot give your trucks by saying "!nb truck" in chat. Your own base, however, may not be the safest place to bring trucks, because it was recently destroyed; it's better if he just gives you a truck in a safe location, and you decide what to do with it.
User avatar
NoQ
Special
Special
 
Posts: 6041
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Previous

Return to Addon discussions