AI Ideas Thread

Ideas and suggestions for how to improve the Warzone 2100 base game only. Ideas for mods go in Mapping/Modding instead. Read sticky posts first!
User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

AI Ideas Thread

Post by Shadow Wolf TJC »

I'd like to create this thread here for people to post some ideas for AIs that they'd like to see created. Suggestions could include AIs that use artillery or VTOLs to their fullest capabilities, AIs that focus on spamming Flamers, or even joke AIs that would make n00bs look competent by comparison. :P

Anyways, to start things off, here are some AI ideas that I have:

1. PyromanAIac: An AI that's designed to serve as a training tool for players on how to deal with an enemy that loves to focus on researching and deploying the dreaded Flamer line of weapons. As such, its research would focus on researching and upgrading Flamers, researching Hover Propulsion, Cyborg Factories, and VTOL Propulsion (especially at higher difficulties), researching Engine upgrades, as well as Kinetic Armor upgrades for both vehicles and Cyborgs, and, to a lesser extent, but especially on harder difficulty settings, researching and upgrading Mortars (including Incendiary Mortars) and Sensors, and later Bombs (including Phosphor, Thermite, and Plasmite Bombs) and Howitzers (including Incendiary Howitzers), to help deal with those pesky Hardcrete structures that are so resistant to Flamer damage.

2. GuerillAI: An adaptable AI that would primarily focus on wearing down its enemies through attrition: aggressively expanding for more Oil Derricks, utilizing hit-and-run attacks with Cyborgs, Hovercraft, and VTOLs, assaulting bases and securing areas with more durable Super Cyborgs, and Half-Tracked and Tracked vehicles, and sometimes even using Cyborg Transports to insert some Cyborgs, including a couple Combat Engineers, behind enemy lines in an attempt to build a forward outpost for a sneak attack on the enemy's flank. Would typically start matches off by having a couple of its Trucks build Machinegun Towers next to external Oil Resources that are closer to the enemy's spawn point than to the AI's spawn point, as well as sending out attacking forces to search for and destroy any enemy Trucks or Derricks outside of the enemy's spawn point. Would focus mostly on researching and upgrading Machineguns and Cannons, though would also focus on researching and upgrading Mortars, Howitzers, and Sensors (for both siegework and defense), researching vehicle armor upgrades and new vehicle bodies (including Collective and NEXUS bodies, as well as the Wyvern and Dragon bodies, but excluding New Paradigm bodies), researching Repair Facilities (and building them away from the base for damaged units to repair after performing a hit-and-run attack), researching research upgrades such as Synaptic Link Data Analysis (since many higher-tiered technologies, including Hyper-Velocity Cannons, Howitzers, Railguns, Lasers, and Composite Alloys, require them as prerequisites), and, sometimes, researching and upgrading Flamers and AA (in case the enemy was deploying slower Half-Tracked or Tracked units, or VTOLs, respectively). Would even attempt to adapt well to a wide variety of enemy unit and structure types. For example, it would build less VTOLs if the enemy had strong AA, build less Cyborgs and more Half-Tracks if the enemy had strong Anti-Personnel weaponry, build less Half-Tracks and Tracks, and more Cyborgs if the enemy had strong Anti-Tank or All-Rounder weaponry, build more AA units and structures if the enemy had been attacking with VTOLs, build more Cyborgs and Hovercraft armed with Machineguns or Lasers if the enemy had been attacking with mostly Cyborg or Hover Flamers, and build less units armed with Machineguns or Lasers, and more units armed with Cannons or Railguns, as well as more Cyborg and Hover Flamers and Hover Mortar or Howitzer Teams, if the enemy had been attacking with mostly slower Half-Tracked and/or Tracked vehicles (since the AI would actually attempt to take advantage of its enemies' units' slower speed, as well as their weapons' longer or shorter range).

3. n00bot: A joke AI for those who just want to relax after a hard day's work of compstomping in skirmish games or playing online in multiplayer games. Not only does this AI focus on researching EVERYTHING on the tech tree, regardless of how useless they are, but this AI would actually build some of the most pointless buildings that you could think of, like Flamer Bunkers or Tank Traps, as well as some of the most ridiculous unit templates imaginable, like Bug Flamer Tracks, or Viper Plasma Cannon Hover. Could actually pose a serious challenge if used in, say, a 1 vs 7 compstomp match, but otherwise, would almost certainly lose out against your typical AI, including Semperfi, DyDo, or even the default NEXUS AI. :lol2:

Also, I have a few ideas for people to consider implementing in future AIs in general:

1. Building forward outposts that consist of, at the very least, a Vehicle or Cyborg Factory: This would allow the AI to deploy units closer to the front lines, where Oil Derricks may be contested. May also allow the AI to prepare a sneak attack on an enemy's flank.

2. Building Repair Facilities closer to the front lines: A smart player would know that preserving his/her forces and keeping them repaired would not only save them power from building replacement forces, but would also increase the odds that they live long enough to grow in experience level. One of the best places to build these Repair Facilities is close to the front-lines, where damaged units can quickly go for repairs, and then quickly return to the battlefield once repaired.

3. Using Cyborg Transports to airlift Combat Engineers (along with some escorts) to various places: The Combat Engineers could then proceed to build either an artillery firebase and/or airbase on top of a normally inaccessible mountaintop, or a factory (and defenses) behind an enemy's base in order to prepare for a sneak attack. However, some way to designate optimal places for such airlifting operations would be needed. Right now, the AI programmer might need to manually designate ideal airlifting coordinates for each map, though it may be possible to add support for such for map editing programs in the future.

What kinds of things would you like to see in future AIs?
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: AI Ideas Thread

Post by NoQ »

1. Using flamers involves a *lot* of micromanagement and clever tactics (like cornering enemy army etc.), and i've heard of no AI that is actually good at this part of the game.
2. Same thing: hit-and-run is a micromanagement thing, and it also involves tactical analysis (from where to attack and where to retreat), which is rather hard to program.
3. Possible (:

When i made my MCRbot, and choose MGs and cannons as a point of focus, the main idea was to minimize the amount of micromanagement my AI has to do, because i knew it to be weak in this aspect. Once this "EggPlant AI" thing is close to ready, clever AI tactical game might be much more possible :3

I agree that AIs should use more of the techniques you mentioned in the second part of the message. Not sure about proxy factories, (their effectiveness is often questionable in Warzone2100), but repair centers and engineer business trips are certainly worth a try.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: AI Ideas Thread

Post by aubergine »

@Shadow Wolf - great suggestions!

The EggPlant AI that I'm working on will hopefully make some of these things possible.

However, as NoQ mentions in his post, tactics like hit and run or cornering the enemy are really difficult to achieve in an AI.

Hit and run

A human can easily look a the units on the map and decide what to do. We can see when a unit has fired and retreat it to safety while it reloads. That requires us to know which direction to send it in when retreating.

Currently there's no (easy) way for an AI to know when a unit has fired or otherwise engaged with the enemy. So the AI would have to repeatedly check the ".armed" property of all it's tanks/cyborgs to detect when one gets less than 100%, then work out which direction to retreat it in and then keep checking until .armed gets back to 100%, then re-engage the enemy.

With my Vault library, this *might* be possible using something like the following:

Code: Select all

// run after attacking:
$("droid.tank[armed<100]:isMy:isAttacking") // get list of my droids that have just attacked
      .findNearest("droid:isEnemy, .defence:isEnemy",1) // get list of nearest threats
        .shapshot("enemies") // take a snapshot of enemies list
      .end() // go back to my list of droids
        .runFrom("@enemies"); // tell my droids to run away from enemies

// once my droids are reloaded, send them back to attack:
$("droid.tank[armed=100][health>70]:isMy:isRunning") // get list of my droids that were running away but are now reloaded
      .findNearest("droid:isEnemy, .defence:isEnemy",1) // get list of nearest threats
        .shapshot("enemies") // take a snapshot of enemies list
      .end() // go back to my list of droids
        .attackNearest("@enemies"); // tell my droids to attack nearest enemies
That code wouldn't actually work, it would need to be performed on a droid-by-droid basis (from the .findNearest() modifier onwards), but it shows the general approach that could be used. There will also be a bunch of other factors to consider that I've not even though of yet. However, I believe it might be possible to get an AI to do hit and run micromanagement tasks - but there's a lot of work still to do before that can be made a reality.

Cornering the enemy

I really don't see this being possible any time soon, if ever.

First, you would have to work out *what* to corner - if this is a single droid, then no problem. If it's a cluster of droids, how do you accurately identify the cluster and then keep track of it's movements? And what would happen if damaged droids in that cluster suddenly retreated for repairs?

Second, you then have to work out how to corner the cluster. That involves working out where the cluster is heading (this would need direct access to the pathfinding system), spotting a "corner" you can get them in to (I have no idea where to even begin doing something like that), then getting your group of droids to the right place at the right time. All of these things are currently impossible with warzone to the best of my knowledge.
"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: AI Ideas Thread

Post by NoQ »

One thing about cornering ... "attacking from (at least) two opposite directions" is usually a good enough definition for it. At least, that's what i meant it to be.

Also, Cluster analysis (:
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: AI Ideas Thread

Post by aubergine »

To attack from two directions I need to work out the exact path to get to those two points, then how long it will take groups of my droids to travel each path, then get them to set off at different times so they reach the two points at the right time, then make sure that the enemy is between those points at that time. Oh, and I need to work out if there are any dangers on the paths that would delay or harm my droids. = nightmare!

As for clustering, it might be possible to get rudimentary clustering just based on listing units within a given range of a droid in the group (not hugely accurate, but would be sufficient I think). The most difficult part is working out which droid to use as a point of reference, bearing in mind that a fast moving mechanic borg ahead of the main group could be used like "chaff" to confuse the AI. I'm seeing increasing uses for knowing what propulsion/body/turrets are on droids - hopefully such things can be added to the JS API.
"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: AI Ideas Thread

Post by dak180 »

aubergine wrote:... then work out which direction to retreat it in ...
You might ask per about adding (if they have not been already) his danger maps to the .js api.
User:dak180
Keeper of the Mac Builds
User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: AI Ideas Thread

Post by Shadow Wolf TJC »

NoQ wrote:1. Using flamers involves a *lot* of micromanagement and clever tactics (like cornering enemy army etc.), and i've heard of no AI that is actually good at this part of the game.
I wanted it to be used for training other players on how to deal with players that, well, love to spam Cyborg and Hover Flamers, and simply rush at their enemies with them. As such, AI Balance was placed low in priority. In fact, I'd imagine that it wouldn't operate much differently than the default NEXUS AI, aside from its different choices of research items and templates to build, and perhaps ordering its damaged units to retreat more often. (I believe that the easiest way to program that would be to simply set its units to either of the "Retreat at X Damage" settings, as well as building Repair Facilities in some places.)
NoQ wrote:2. Same thing: hit-and-run is a micromanagement thing, and it also involves tactical analysis (from where to attack and where to retreat), which is rather hard to program.
Yeah. I thought that such an AI would be pretty challenging to program. Still, it would be nice to see AIs kite their slower, shorter-ranged enemies more often. :D
NoQ wrote:I agree that AIs should use more of the techniques you mentioned in the second part of the message. Not sure about proxy factories, (their effectiveness is often questionable in Warzone2100), but repair centers and engineer business trips are certainly worth a try.
By building proxy factories in out-of-the-way places, as well as having enough Oil Derricks to supply them with power to produce new units, you'd help ensure that, should your main base get destroyed (along with whatever trucks were located there), you'd still remain in the game, and could even rebuild from there, possibly launching an unexpected attack on your opponent's base in retaliation. Some ideal places to build proxy factories for this purpose would include spawn points that weren't being used, such as, say, if you were playing a 2 player match on a 3+ player map. This is a perfectly valid strategy to undertake in RTS games in general, including Command & Conquer, Starcraft, and Supreme Commander to name a few.

@ aubergine

I'd be interested in taking a look at that AI of yours in the future, once it's done. :) And for the record, I wasn't exactly thinking about running whenever the weapon was empty, but rather, I was thinking about running if an enemy unit just got too close (such as close to their weapon range), hence the phrase "kiting". Also, I never thought about cornering an enemy either, though I do agree in that it would probably be difficult to program. :|

Edit: By the way, I wonder if it's possible to make AIs trash talk to players. I'd imagine that it would be hilarious, especially if it was coming from, say, n00bot. :lol2:
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: AI Ideas Thread

Post by aubergine »

dak180 wrote:
aubergine wrote:... then work out which direction to retreat it in ...
You might ask per about adding (if they have not been already) his danger maps to the .js api.
Per has added a isSafe() method that allows checking if an x,y coord is relatively safe based on player's sensor data.

However I think it would possibly need things like continents, etc., exposing to the JS API to properly start working out alternate routes, etc., for droids.
"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: 3462
Joined: 10 Oct 2010, 00:58

Re: AI Ideas Thread

Post by aubergine »

@Shadow Wolf:

At some point I hope to create an EggTimer AI that will be able to run all sorts of training scenarios with human players.

In terms of building forward factories and repair posts, I'm also planning that too using a concept of "settlements":

* Camps - main industrial/research zones with factories and stuff like that
* Derricks - resource gathering facilities, with good sesors/defences
* Outposts - fortified sensor/defence outposts
* Lookouts - basic sensor outposts

My plan is to have some type of repair facility at each outpost (as well as my camps obviously). Whether it's a repair droid or a repair structure, my units should be able to retreat to any outpost/camp to get repairs.

EDIT: And I'm also working on getting my AI to use transports, but that brings a lot of additional complexities that I've yet to fully investigate.
"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: AI Ideas Thread

Post by NoQ »

By building proxy factories in out-of-the-way places, as well as having enough Oil Derricks to supply them with power to produce new units, you'd help ensure that, should your main base get destroyed (along with whatever trucks were located there), you'd still remain in the game, and could even rebuild from there, possibly launching an unexpected attack on your opponent's base in retaliation. Some ideal places to build proxy factories for this purpose would include spawn points that weren't being used, such as, say, if you were playing a 2 player match on a 3+ player map. This is a perfectly valid strategy to undertake in RTS games in general, including Command & Conquer, Starcraft, and Supreme Commander to name a few.
I think you're missing the whole point. If your main base is destroyed, you are already dead in 99% cases, no matter wether it's warzone or starcraft. A rare exception here is matches between 3 or more forces, where your enemies have a quarrel between themselves and don't have much time to look for your last truck, which decreases these chances to ~80%, okay. Anyway, it's rarely worth it to double the radius you need to defend and splitting your army for the single purpose of annoying your opponent by making him look for you for 10 more minutes.

Making proxy factories to attack the opponent from an unusual direction is something more curious, but usually rather risky (if the factory is discovered before the attack plan is executed, you won't be able to come for help and most likely waste all the money you invested).

Clearly, the main point of building away factories in any game is to get units into combat faster. In starcraft, proxy factory based rushes are known to be more effective than regular rushes, and the only reason for this is that builders move ~25% faster than units produced in those factories. In warzone, this is not the case: early wheeled units move exactly as fast as trucks, which means that decreased time of getting units into combat is compensated by later factory construction. Proxy factories start making sense only when halftracks are researched, but even then the effect is very slight and not really worth the effort. They start making some real sense when combat tanks get extremely slow (eg. tiger HC tracks).

But there's one thing i definitely agree with: If AI built multiple bases, it would be more fun to play with! But it is usually a bad idea for him. But still fun (:
I wonder if it's possible to make AIs trash talk to players
It is possible, though not yet exposed to JS api afaik (:
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: AI Ideas Thread

Post by NoQ »

Shadow Wolf TJC wrote:1. PyromanAIac: An AI that's designed to serve as a training tool for players on how to deal with an enemy that loves to focus on researching and deploying the dreaded Flamer line of weapons. As such, its research would focus on researching and upgrading Flamers, researching Hover Propulsion, Cyborg Factories, and VTOL Propulsion (especially at higher difficulties), researching Engine upgrades, as well as Kinetic Armor upgrades for both vehicles and Cyborgs, and, to a lesser extent, but especially on harder difficulty settings, researching and upgrading Mortars (including Incendiary Mortars) and Sensors, and later Bombs (including Phosphor, Thermite, and Plasmite Bombs) and Howitzers (including Incendiary Howitzers), to help deal with those pesky Hardcrete structures that are so resistant to Flamer damage.
Still a WIP, but still ... (:
NoQ wrote:New "Flame" personality: a flamer spam AI.