Impossible AI?

Unbeatable for humans

Information and discussion for custom maps and mods.
Post Reply
noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Impossible AI?

Post by noobmapmaker »

How difficult would it be to program an impossable Ai, one that wins 99,99% of all games?

It may not cheat: other prices, advantages or unfair use of the radar. It can ofcourse be streamlined very efficiently.

In chess the engines beat humans easily, even World Champ Magnus Carlsen will only draw after many many games.

Also this remind me of the robotsoccer: http://en.wikipedia.org/wiki/RoboCup
The goal is to create a team that wins against the world champ of human soccer :)

I bet it is difficult as it requires many techniques to use all units in harmony, on land, see and air.

User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Post by BaronOfStuff »

It'd be borderline impossible to create an AI that consistently wins on a fair basis against everyone/anyone.

Unlike chess, OpenRA is real-time and has no fixed move pattern for each unit type or 'rules' that need to be followed. Anything goes. The possible 'moves' are essentially infinite too, as the battle situation changes constantly and there are various ways to adapt. Simply put, there's no machine powerful or dedicated enough to match the human brain when it comes to constantly assessing such an environment on the fly.

At least not yet.

asi_turk
Posts: 11
Joined: Sun Nov 16, 2014 7:11 pm

Post by asi_turk »

AI cheats...

Thats how the harder AI's win against humans and if they make a proccessor that can think equal as the human brain you need a crazy coder to do a very very difficulty AI.

For now its impossible ;)

noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Post by noobmapmaker »

I think you two are right: it would requires a supercomputer, like the ones from IBM, to get a grasp on what is going on and how to properly respond. Not only that, it would require alot of code to actually respond well.

Here are some suggestions that may make the AI already a bit tougher (without cheating):

- streamlined buildingorder, dont build nonsense stuff. Only build duplicates to prevents nukes from destroying everything essential, but only build them when there is no new purposefull building to build.

- deploy a couple radar jammers in the base at their own radius distance from eachother

- Automate units to attack their effective counterparts (not properly said, but it means): every unit has its weakest opponents. If weakest opponent is in range - attack them. If not, attack next weakest opponent, etc. This might creat some 'microing' by the bot and at least makes them attack quite effectively. (although there are other factors that need to be taken in account, for example 10 V2 shooting on 1 infantry is a waste of V2s, rather shoot 8/10 on the mammoth)

- also keep vulnerable and strong units more backwards when attacking

- attack after a atom bomb, or send in air units after atom bomb

- since the AI builds extremely effeicient: be the first to build a nuke anyway

- if an expensive unit (tank, plane, harvester) is damaged >90% and not doing anything, repair on the service depot.

- Just like we humans the bot is allowed to get a grasp on where he is on the map, and guestimate where his opponents are. This may not be easy, but not impossible either. (e.g.: I am in the left corner, since the field ends there. Probably my opponents are right of me.) This ofcourse influences where static defense is placed

- force check on some units: mammoths that follow a plane across the entire map for instance, or harvesters that are standing still. By forcechecking there activity (e.g.: if harvester stands still for X time, then search for ore and If target is way out of range, dont follow and return to base)

- and more

I know all this is way easier said than done, but I do think a bunch of them are very achievable.

User avatar
Prince Blueblood
Posts: 169
Joined: Wed Sep 24, 2014 6:32 am
Location: Kudus

Post by Prince Blueblood »

1) Streamline AI build using effective anti-rush build but still has good mid-game to late-game availability

- Power Plant
- Barracks - queue train 5 riflemen
- Refinery
- Refinery - train 2 riflemen and 2 rocket troopers
- Power Plant
- Pillbox / flame tower to cover MCV (against flamer cheese)
- War Factory - train another harvester

*Allies*
- Power Plant again
- at the same time with the third power plant, AA gun for covering anti-air
- Radar

*Soviets*
- train 2 flak trucks, no need for third power plant unless needed (depends on build)
- Radar

...
that's it, the midgame build is variable though, depends on how you want the attack / defense

And make sure the AI knows how to effectively expand (with second MCV)

perhaps give AI an advantage in this regard (aka they get 2nd MCV for free instantly after war factory is build)
OpenRA Nicks :
- Everything with "Blueblood" inside
- Yuelang (when I speak Chinese, literally)

My Ping might be Red... blame distance and my shitty connection due to which country I lived in...

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

Here is an example of how i assume that an AI like this would work:

Assumptions:
The ai has access to all unit and structure statistics
It DOES NOT have any pre-programmed strategies or tactics (this includes build orders)
The AI knows the map (i.e. it knows its starting position and ore, gems, water etc.)
The AI keeps data from previous matches
The AI can tell what faction the other player/s is/are using

The AI has an in-built incentive in the form of points. Points would be dished out in terms of the AI's actions. Examples of point-awarding activities are creating buildings, creating units, getting ore, killing enemy units. However, the AI would lose points by losing units and buildings. The faster the AI makes these actions the more points it gets (this would be configurable to allow the AI to be tampered with if it is making bad decisions). This, combined with the AI's memory of previous matches encourages the AI to build the optimal buildings and units for survival and attack.

When it comes to attacking it is quite similar. The AI runs several simulations using unit statistics to predict the outcome of a battle in several different circumstances and trys to finds ways in which it would come out on top (this is where learning from other games comes into play) and also whether the encounter is even worth it.

I would test this AI by using the same build order and tactics for several games until it is consistently beating you - then changing your build order and seeing how it would react.

Such an AI could be applied to any faction as it is not dependent on any hardcoded build orders or tactics.

Canavusbis
Posts: 37
Joined: Thu May 21, 2015 10:58 pm

Post by Canavusbis »

Murto the Ray wrote: -snip-
Such an AI wouldn't be unbeatable. Anyone who would invent a new, better tactic would be able to beat it, and it is often possible to fool a learning AI fairly easily. Also, learning machines require ludicrous amount of resources in order to be effective.

I think a difficult AI appropriate for OpenRA would be a cheating AI (increased knowledge only) that could modify its tactics based on a limited set of information of tactics. Maybe it could change its rules a bit if it sees a certain tactic lots of the time. A full blown learning machine is not appropriate, however.

Don't forget, deep blue was run on a supercomputer and still wasn't unbeatable.

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

Canavusbis wrote: -snip-
True, but then again deep blue was still able to defeat a reigning chess grand master which is still very impressive.

For now lets agree that such an AI is not within our reach.

User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Post by BaronOfStuff »

Murto the Ray wrote:
Canavusbis wrote: -snip-
True, but then again deep blue was still able to defeat a reigning chess grand master which is still very impressive.
Aaaaaand we're back to bringing up the insurmountable difference in possible moves between Chess and RTS games!

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

BaronOfStuff wrote:
Murto the Ray wrote: -snip-
I was only really commenting on the Deep Blue there, and RTS game is a completely different problem, and a more complex one.

noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Post by noobmapmaker »

I still think an AI that has several things streamlined + some smart algorithmes would be very hard to beat.

An AI can continu its building very efficiently, can reload airunits and repair continuously.

All it then needs (for its massive army) is some basic strategy with tactics. I know that is easier said than done, but those tactics and strategy dont even have to be extremely advanced. Just follow some rules like "place rocket infantry, mixed with some other infantry, in front of artillery" AND "have choppers nearby".

As for tactics I do think that the computer could learn by executing ALOT (maybe millions) of testruns with all kind of units.

User avatar
Prince Blueblood
Posts: 169
Joined: Wed Sep 24, 2014 6:32 am
Location: Kudus

Post by Prince Blueblood »

I think we could plan the AI mechanism largely on nullbot AI logic.

But yeah, it will NOT a real 'thinking' AI, it will be mostly analyzers and answer the "player question" by sending the unit compositions and such...

And it need to 'cheat' by having some handouts about player unit composition...
But NOT the map area (no fow cheat), so if we can let the AI 'know' player production but not their positions...
OpenRA Nicks :
- Everything with "Blueblood" inside
- Yuelang (when I speak Chinese, literally)

My Ping might be Red... blame distance and my shitty connection due to which country I lived in...

User avatar
Murto the Ray
Posts: 487
Joined: Mon Nov 10, 2014 4:34 pm

Post by Murto the Ray »

Prince Blueblood wrote: But NOT the map area (no fow cheat), so if we can let the AI 'know' player production but not their positions...
It would still require the map's layout so that it knows where to expand to and where to build etc.

User avatar
Prince Blueblood
Posts: 169
Joined: Wed Sep 24, 2014 6:32 am
Location: Kudus

Post by Prince Blueblood »

Murto the Ray wrote:
Prince Blueblood wrote: But NOT the map area (no fow cheat), so if we can let the AI 'know' player production but not their positions...
It would still require the map's layout so that it knows where to expand to and where to build etc.
Let's just make the AI knew the original direction of Human base, the ore (and ore nodes), and such...

and some flags on the map about defensible choke points / indefensible plains / you better-not-go-there areas...
OpenRA Nicks :
- Everything with "Blueblood" inside
- Yuelang (when I speak Chinese, literally)

My Ping might be Red... blame distance and my shitty connection due to which country I lived in...

Alley
Posts: 31
Joined: Sat Sep 19, 2015 3:03 pm

Post by Alley »

At the beginning it would be nice to have an AI that always begins with Power Plant and then with Barracks, Ore Refinery and mostly after that with a War Factor and that continues then with all other random then it would be nice. :) For now it seems that OpenRA AI builds only random at the beginning to the end. Although what I like is that this AI uses also super weapons and even builds the naval base that the old Red Alert AI doen not. :)

I believe however, this and old AI from original Red Alert 1 are too easy because in small maps those spend too much time for Ore Refinery if those have even no units and killing those AI's so is not difficult to kill even for the noobs when to focus how those AI's act. :P

Post Reply