Page 1 of 3

Cobra skirmish AI

Posted: 08 Jan 2017, 23:59
by Berserk Cyborg
Image
Cobra.wz
git repository

I would like to introduce a modified Semperfi-js AI skirmish bot I have been working on. I made this bot with team battles in mind, but it should do fine without an ally as well.
-I do use a custom NullBot standard file since it has a bunch of useful data about research and weapons.

--Chat commands--
It will give allies helpful text throughout the course of the skirmish. These include:
--What player it is attacking.
--Which player has been the most harmful towards the bot.
--Various calls for help like wanting a unit or needing power.
--Beacons.

--Personalities--
AC: cannons and mortars. AR: flamers and mortars. AB: Rockets and missiles. AM: machine-guns and (fire)mortars. All personalities use lasers/plasma cannons when possible.

Current list of commands:
“need power/truck/tank/cyborg/vtol” → request that item
“attackX” → X is a player number you want to attack.
"oilX" → X is a player number you want Cobra to target oil.
"stats" → ask which player is being the most harmful to the AI.
Entering a personality name will change Cobra to that specific one. (list in personality section).


Edit: version 1.06 brings hover map support and a more dynamic build/research order depending on starting technology and bases. Adds a new personality that focuses on machine-guns/mortars/fire mortars. A bunch of smaller improvements made as well.

Re: Cobra skirmish AI

Posted: 09 Jan 2017, 11:14
by Prot
Excellent, the more bots, the more interesting!
Today will definitely test it.

Re: Cobra skirmish AI

Posted: 10 Jan 2017, 15:13
by montetank
Berserk Cyborg wrote:Image
Cobra.wz
I would like to introduce a modified Semperfi-js AI skirmish bot I have been working on. I made this bot with team battles in mind, but it should do fine without an ally as well.
Nice. Its good, that somebody works on the AI. So NoQ is not alone.
Here is my Question: Is it possible, that the bots detect the oil barrels and oil derricks, which are covered/surrounded by treas?
The reason i ask: We know, that over 90% of the players are playing alone the skirmish maps against the bots. When i try to create maps, i often want to place oil barrels which are hidden by treas or walls (So-the player has to produce a combat unit at first before the oil could be arrived). But thats unfair. The Al cant detect the hidden oil and so it is a big advantage for the player. The AI should handle the treas like enemys, to get the oil.

Sorry for my bad english. I am sure, you understand, what i want to ask. I will test your bots now.

Re: Cobra skirmish AI

Posted: 10 Jan 2017, 23:50
by Berserk Cyborg
montetank wrote:Here is my Question: Is it possible, that the bots detect the oil barrels and oil derricks, which are covered/surrounded by treas?
Yes. Most bots will just count some feature on a map on a set timer so to speak. NullBot can seek out oil drums/artifacts on its own, but I do not know if it will destroy structures blocking important items.

I can add some code to Cobra that makes some units target buildings/walls/trees around oil drums and resources.

Re: Cobra skirmish AI

Posted: 11 Jan 2017, 00:12
by Per
The micro-AI (in the C++ code) will shoot at features blocking a droid's path after being stuck for a bit, so you can order them to ignore such obstacles, and that should take care of it.

Re: Cobra skirmish AI

Posted: 11 Jan 2017, 02:21
by montetank
My experience: For example in this screenshot. The AI will never send a tank to destroy the treas or other objects to arrive the oil derrick (or barrels, which were placed there by map makers). Thats my experience. I tested this many times.

Re: Cobra skirmish AI

Posted: 25 Jan 2017, 19:11
by Berserk Cyborg
Been working on this AI lately and made some improvements. New version is in my first post and report any bugs or anomalies you find.

-Better build order (also oil is more likely to be taken) and Cobra should no longer use too much power early on in T2/T3.
-Fixed vtol related research/weapons and vtol factory building.
-No longer spams beacons at an incredible rate and thus crashing warzone.
-Basic laser satellite support.
-Builds anti-air defenses (needs improvement).
-Better module building decisions.
-Sensors are accompanied by an attack unit. Other sensors are used as backup in case the active sensor unit is destroyed.
-Performance improvements all around.
-Tries not to build stuff in dangerous locations.
-Bunch of other changes I likely forgot about.

Next I will need to make it do better research/weapon decisions, but for now it is not too much of a problem.

Also is there anything I could do with difficulty or is this already handled? I can not prove it, but it seems Nexus AI cheats with research and unit production especially on insane difficulty.

Re: Cobra skirmish AI

Posted: 26 Jan 2017, 00:11
by MIH-XTC
Yea you're correct in saying that Nexus AI cheat finishes research except while on easy mode. One problem I noticed with AI in 3.2 is that Nexus AI on easy mode is the only AI that continuously researches once a research lab becomes available. All other AI's do not research seamlessly from one upgrade to the next, often times they have research labs available but do not research anything.

If you want to make a truly dynamic AI that can play any map and settings very good then you will need to calculate (or consider) the following variables below. Once calculated, then it's just a matter of determining the following 4 items:

base build order
truck order (which trucks do what in which order)
research order
units to be produced

Game Settings:
Arty on/off
VTOL's on/off
Starting base (full/half)
# of allies
# of players
Starting tech

Map Properties:
# of oils in starting base
# of starting derricks
# of oils on my half of the map
# of tiles needed to reach furthest oil outside of base on my half of map (furthest middle oil)
# of tiles between starting truck and opponent starting truck

With these quantities in mind, one does not need to really look at the map to strategize. Strength of scavs and water tiles are two items that aren't so straightforward in determining AI strategy but still need to be considered.

Programming AI unit handling is an entirely different beast.

Re: Cobra skirmish AI

Posted: 26 Jan 2017, 05:34
by Berserk Cyborg
Thanks for the input, I will definitely try using the information you provided to make Cobra more dynamic in the future.

On a side note: I just discovered a bug with group initialization should a map provide attack/sensor units so anybody who downloaded Cobra earlier should download it again.

Re: Cobra skirmish AI

Posted: 12 Feb 2017, 01:41
by Berserk Cyborg
A new update is available (download link is in first post). As always report any new bugs with this release. Do note this is still a WIP, but from my tests everything is stable so far.

More or less just made some minor improvements which include fixes for vtol attacking and research behavior and preventing personalities from changing on save-load. Cobra starts off trying to research all the machine-gun tech (cheap and effective) and then focuses on its specific weapon of choice. Also a rocket based personality was added and each personality will use lasers as well. This means there is more unit variety.

I plan on expanding on more useful chat commands and adding some basic adaption next.

Re: Cobra skirmish AI

Posted: 26 Feb 2017, 21:26
by Prot
montetank wrote:My experience: For example in this screenshot. The AI will never send a tank to destroy the treas or other objects to arrive the oil derrick (or barrels, which were placed there by map makers). Thats my experience. I tested this many times.
I think you about this ? ;)
https://youtu.be/beHZwoRU76w

Re: Cobra skirmish AI

Posted: 07 May 2017, 20:36
by Berserk Cyborg
Cobra.wz
There have been a lot of changes since the last release that I published here. These include:
1. Repair group. Makes use of the heavy repair turret when available.
2. Sensors and artillery management has improved.
3. Improvements to build/production/tactic systems.
4. Better map adaption for the personalities. A new personality, AL, is exclusive to T3 matches with at least bases (thermal based weaponry is only used).
5. Much better research choices.
6. Performance improvements.
7. It can build defenses near derricks it owns, if power levels are good enough.
...And a bunch of other stuff.

Anyway, I think I am done with this bot for the time being. Let me know if you find any bad behavior or bugs with Cobra AI (if not, I will upload this to the addons section).

Edit: v1.11 - Fixed an issue where units would not attack walls.

Re: Cobra skirmish AI

Posted: 17 May 2017, 04:31
by Berg
I edited the description in add-ons to supply chat commands if you would make it tidier i will re approve it on request keep up the good work

Re: Cobra skirmish AI

Posted: 19 May 2017, 05:04
by gamesforfun
can the original owner of this mod please fix it as it contains a virus

Re: Cobra skirmish AI

Posted: 21 May 2017, 18:06
by MOLDY2
how do I add it to warzone I figured out maps but I cant figure out how to add the bot