Polls

Default Game Speed

Log in to vote!

Latest Posts

Topic: Improving the AI

the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 115
Ranking
Likes to be here
Posted at: 2019-07-10, 12:14

I have played hundreds of games the last days, with AI, self swapping to AI optimzing it and giving it back to AI, or let my build play from AI on. So I have lots of Ideas and improvements to make a script based AI better. The only problem is that i have not enough programming skills so, maybe I can swap my Ideas with womeone who is good in programming and we can try to implement the Ideas.

Most important thing is that I want an AI that trains faster, so for single player its more fun and can even be challenging to play games with some AIs versus yourself on small maps.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1252
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-07-10, 18:55

Ideas are always welcomed, especially low-hanging fruits, where coding needed is up to few hours and outlook for success is high. Therefore it would be very convenient if you knew the current AI code to know what changes are easy to implement.

Sometimes ideas described in few sentences can require hundreds of hours of coding.

So we can start with some easy fixes and discuss them at least.


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 115
Ranking
Likes to be here
Posted at: 2019-07-12, 16:08

Yes, that would be great The main thing I want to do first is have a closer look on the build order, cause there many changes could be made, this should be relatively easy to implement?- maybe later i also want to develop 2 different AIs, like rushing as efficiently as possible and one going more for economy


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 758
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-07-12, 16:29

First of all we should clarify some things in the beginning.

AI has no fixed order or anything like that. Basically it picks a couple of fields and evaluates the possibiliteis on these fields. Then it makes a ranking of the possibilities due to a lot of decisiongates and weights (this is where the genetic algorithm with all the values defined kicks in).
Furthermore the Ai is tribe and map agnostic as we need to aim to have it working under every circumstance.
Different character are possible though by giving different values to the weights. But until we have still lots to do we skipped training a different character (for different win conditions e.g.)


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1252
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-07-12, 19:35

Two more points to add:

  • we have something like "basic economy" concept, it would be good if you make yourselves familiar with this, just search this site, it was discussed couple of times
  • It is possible to have multiple sets of genetic algorithm's numbers, but the main problem here is that such training is very time consuming so we are barely able to train one set of DNA numbers.

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 1269
Ranking
One Elder of Players
Location: GER
Posted at: 2019-07-25, 20:04

What about splitting the AI into several AIs which work together? One builds only roads, one builds only buildings, one launches only attacks and so on...


“It's a threat to our planet to believe that someone else will save it.” - Robert Swan

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 758
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-07-25, 23:12

WorldSavior wrote:

What about splitting the AI into several AIs which work together? One builds only roads, one builds only buildings, one launches only attacks and so on...

In fact all of these topics are already seperate functions. they are called from a main scheduler and are run sequentially. So either I got your sugesstion wrong or I believe it already being implemented.

Nevertheless any suggestion or discussion input is very welcome.

Currently road building is slightly improved in my eyes, building algorithm has been improved as well for some shortfalls but now this has other issues uncovered or even produced. AI now builds too much buildings although it can't man them. My next fix is therefore to limit the buildings by a factor times the available workers tools or even better by already buzild unmanned buildings of same type. As I said often the best way in my eyes is doing one step after the other, as every new stepm will reveal new issues.

Last para was just to let you know what i have already in plan.


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1252
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-07-27, 17:09

Indeed, the AI has own scheduler and about 15 jobs that are called in own intervals..

@hessenfarmer: new roading for AI is still waiting for merge

If you perceive the vacant production sites that problem, I can modify fitness function to penalty this. And train another hundred of rounds... If it will not help, just go on...


Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 1269
Ranking
One Elder of Players
Location: GER
Posted at: 2019-07-28, 18:05

Tibor wrote:

Indeed, the AI has own scheduler and about 15 jobs that are called in own intervals..

15? Interesting!

hessenfarmer wrote:

WorldSavior wrote:

What about splitting the AI into several AIs which work together? One builds only roads, one builds only buildings, one launches only attacks and so on...

In fact all of these topics are already seperate functions. they are called from a main scheduler and are run sequentially. So either I got your sugesstion wrong or I believe it already being implemented.

Looks like it's already implemented. My idea was that each component of the AI can be trained separately.


“It's a threat to our planet to believe that someone else will save it.” - Robert Swan

Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1252
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-07-28, 18:15

WorldSavior wrote:

Looks like it's already implemented. My idea was that each component of the AI can be trained separately.

This is not bad idea, but currently all DNA numbers are messed up together, so it would be quite painfull to separate them into corresponding areas - but possible.

However, I dont see this as a way to speed up training, because it would take the same time and only part of AI would benefit from it...


Top Quote