Map Database  •  FAQ  •  RSS  •  Login

AI improvements

<<

Esthlos

User avatar

Knight

Posts: 676

Joined: 23 Jun 2013, 16:02

KaM Skill Level: Beginner

Post 30 Aug 2017, 19:55

Re: AI improvements

New combat AI
There are my improvements of combat AI.

First screenshots:

Old combat AI Attack-Closest-Something-Command:
Image
Image
Image

New combat AI:
Image
Image
Image
Image

How it works?

Each group has its own squad class which provides orders (to attack something / move in position). Multiple squads make a platoon which checks the formation and the presence of enemies. Finally, multiple platoons create company which gives global orders (such as: go there, use this road, kill everything in this radius) and plans weighted polygon pathfinding - this provides the performance improvements because there is not need to calculate the pathfinding of all groups in 1 tick (sometimes over the whole map). Groups are moved by small distances because the route is already known and is given by array of polygons. This structure also permits division into different time areas (each platoon could be calculated in following tick).

More examples of weighted polygon pathfinding (2 platoons):
Image

Real map:
Image
Image
Image

(Can 1 new!AI beat 2 old!AIs in a skirmish?)
(Also, how does it react to the "send 1 bowman to draw them out of their base and into an ambush" strategy that the old!AI is so weak to?)
Just when you think you know something, you have to look at it in another way, even though it may seem silly or wrong. You must try! - John Keating, "Dead Poets Society"
<<

Toxic

Rogue

Posts: 50

Joined: 22 Feb 2017, 19:04

Post 01 Sep 2017, 17:36

Re: AI improvements

(Can 1 new!AI beat 2 old!AIs in a skirmish?)
Well, do you mean 2v1 test in a combat map? In this case it depend on inaccessible terrain. When map doesn't have obstacles then there is not much difference because in KaM is practicaly impossible to beat 1v2 in balanced maps and with decent players. Vice versa when will be units splited by obstacles then may new AI win.
(Also, how does it react to the "send 1 bowman to draw them out of their base and into an ambush" strategy that the old!AI is so weak to?)
It is matter of the defence AI which is still same. But if you want I can add simple condition to attack against archer with archers if are in radius.
<<

Esthlos

User avatar

Knight

Posts: 676

Joined: 23 Jun 2013, 16:02

KaM Skill Level: Beginner

Post 01 Sep 2017, 19:35

Re: AI improvements

Well, do you mean 2v1 test in a combat map? In this case it depend on inaccessible terrain. When map doesn't have obstacles then there is not much difference because in KaM is practicaly impossible to beat 1v2 in balanced maps and with decent players. Vice versa when will be units splited by obstacles then may new AI win.
Thanks!
And in a normal "build" map?
Can an AI with the improved combat and city management win 2v1 against 2 of the current AIs?
(Also, how does it react to the "send 1 bowman to draw them out of their base and into an ambush" strategy that the old!AI is so weak to?)
It is matter of the defence AI which is still same. But if you want I can add simple condition to attack against archer with archers if are in radius.
That would be an improvement, thank you. :D
Honestly though, I don't know what I'd do if someone tried to pull that on me... the AI in Battle Realms actually does try to do just that, and ordering archers to "stand your ground" (= don't move and open fire on any enemy in range) near the tower does seem to be the best counter there.
Just when you think you know something, you have to look at it in another way, even though it may seem silly or wrong. You must try! - John Keating, "Dead Poets Society"
<<

Toxic

Rogue

Posts: 50

Joined: 22 Feb 2017, 19:04

Post 02 Sep 2017, 17:23

Re: AI improvements

And in a normal "build" map?
Can an AI with the improved combat and city management win 2v1 against 2 of the current AIs?
It looks like new AI made it even against players with improved city management. Hoewer, it had to use gold and iron in loc 1. I will add support of Marketplace for the AI. Maybe it change result.
Image

Image
Honestly though, I don't know what I'd do if someone tried to pull that on me... the AI in Battle Realms actually does try to do just that, and ordering archers to "stand your ground" (= don't move and open fire on any enemy in range) near the tower does seem to be the best counter there.
I don't like this solution. The AI should be adaptive and not coded for specific events. People will soon find a way how to bypass this behaviour. For example this is the way, how can attacker kill all archers and then shoot troops from distance or catch them into combat without long-range support. I think that best solution could be adaptive neural networks which learn from previous games (for the battle AI and for the city construction something like weight functions of surrounding area tuned by genetic algorithms). Unfortunately, this solution requires quite large amount of computing time for a real time strategy.
<<

Esthlos

User avatar

Knight

Posts: 676

Joined: 23 Jun 2013, 16:02

KaM Skill Level: Beginner

Post 03 Sep 2017, 16:22

Re: AI improvements

And in a normal "build" map?
Can an AI with the improved combat and city management win 2v1 against 2 of the current AIs?
It looks like new AI made it even against players with improved city management. Hoewer, it had to use gold and iron in loc 1. I will add support of Marketplace for the AI. Maybe it change result.
Thanks! :D
Honestly though, I don't know what I'd do if someone tried to pull that on me... the AI in Battle Realms actually does try to do just that, and ordering archers to "stand your ground" (= don't move and open fire on any enemy in range) near the tower does seem to be the best counter there.
I don't like this solution. The AI should be adaptive and not coded for specific events. People will soon find a way how to bypass this behaviour. For example this is the way, how can attacker kill all archers and then shoot troops from distance or catch them into combat without long-range support. I think that best solution could be adaptive neural networks which learn from previous games (for the battle AI and for the city construction something like weight functions of surrounding area tuned by genetic algorithms). Unfortunately, this solution requires quite large amount of computing time for a real time strategy.
Guess "just don't use that strategy if you don't want to" will have to suffice then... :(
Just when you think you know something, you have to look at it in another way, even though it may seem silly or wrong. You must try! - John Keating, "Dead Poets Society"
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 10 Sep 2017, 18:49

Re: AI improvements

I'm a bit late, but these improvements are incredible. Very good job, you've done the community a great service.
I used to spam this forum so much...

Return to “Ideas / Suggestions”

Who is online

Users browsing this forum: No registered users and 12 guests