Jump to content

Improving the AI


Recommended Posts

Currently, the majority of players are much better than even the Very Hard aggressive AI and find it easy to defeat. Therefore, I would like to request the addition of even more challenging AI settings for pro players to practice and experiment new skills on. The current 'very hard' AI consistently makes a few strategic mistakes which slow down its eco and decrease its attacking ability even though they have 56% gather bonus:

1. Using women to mine

2. Not researching upgrades

3. Using men to gather food

4. Not using formations

5. Small pushes - real players often commit all of their units to a big push

6. Not knowing to retreat after rushing

7. Unwise timing for expansions

8. Chasing after lone enemy cavalry - causes idle time and increases risk

9. Lack of selection in where to attack - they attack a random location which could be well defended. They never outflank or make sneaky moves.

10. Not training in large batches

11. Not using enough women in early phases

12. Scattered troops and sending small groups of women out of the safe zone to build new cc

 

If the devs can fix these then the AI would be much more fun to play with. To make the AI more realistic we can also add a cavalry rush or archer rush feature. Just increasing the gather rate does make their boom faster but doesn't make the AI feel like a more challenging nor intelligent opponent. With that said, we can push the very hard AI's gather bonus to 100% to make it extra tough. 

Meanwhile, the very easy AI could do some smaller rushes, for example with just 5 archers. This makes the learning curve shallower for beginner players. 

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Stan` said:

It's funny cause most new players complain about the AI being too hard

When I played my first match against the very easy Ai I also found it impossible. The reason why Ai is hard for beginners is they rush early with the combination of spearmen and ranged units, which is very hard to defend against. If you could let the Ai rush with only a few ranged units or a just a few spearmen then that would be much easier for the player. The very easy AI and very hard Ai use identical strategies, which is the problem. 

  • Like 2
Link to comment
Share on other sites

It's a bit more complicated than that. It's not so much about the ideas, than putting them in practise. Since the departure of the last AI programmer, the AI is not being developed actively. We fix the bugs, but we do not really add new features.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I am now working on a mod that improves the strategy used by the AI. I copied the .js files controlling the petra bot into my mod folder, but I am not sure where I can change the eco bonus of the AI. Can someone give me a hint please?

I have already adjusted their strategy slightly by increasing the number of units trained before phasing up. Here are the 3 easy points I will tackle first:

1. Using enough women for eco (I see some improvement)

2. Not phasing up too early (they phase up at around 60 pop now compared to the previous 40 pop, could do better)

3. No suicide push. (haven't started editing this yet)

 

  • Like 4
Link to comment
Share on other sites

1 hour ago, Yekaterina said:

1. Using enough women for eco (I see some improvement)

For eco stopping the ai from walking 200m for some berries would help a lot. Generally the ai doesn't mind large distances much when gathering.

 

1 hour ago, Yekaterina said:

3. No suicide push. (haven't started editing this yet)

Danubius (map) would be a great benchmark for this.

---

Adding to your initial list, ship trade is currently pretty much broken for the ai, so disabling it is an easy fix.

In a perfect world to ai would be non-cheating.

As for lower difficulty yet still interesting ai you could simply limit pop to let's say half what the player has at any given time.

---

If you are serious about writing an ai, first thing give it a new name ;)

Link to comment
Share on other sites

15 minutes ago, hyperion said:

If you are serious about writing an ai, first thing give it a new name ;)

I will call it KateBot :)

I don't have the skills to write a whole new AI...

I edited the javascript files and now the AI reaches 197 pop by minute 16 and goes in for a huge push. The catch is it forgot to phase up (so still village phase by minute 18) and no siege. The huge push part is more similar to players in TG but the lack of siege and no formations are problems to be solved. 

  • Like 1
Link to comment
Share on other sites

 

On 07/04/2021 at 9:24 PM, Yekaterina said:

the majority of players are much better than even the Very Hard aggressive AI and find it easy to defeat

Citation needed!!! :D  In my impression, exactly the opposite occurs. Apparently, experienced users know "the tactic" of how to win 0 A.D. matches, but this is not something obvious or easily assimilated by most players, especially those who do not play regularly. Perhaps it is the case that we think about how to improve 0 A.D. video tutorials. 

  • Like 1
Link to comment
Share on other sites

@Yekaterina, I've become involved (a little) in developing our AI as well, lately. Feel free to create patches on phabricator!

7 hours ago, hyperion said:

For eco stopping the ai from walking 200m for some berries would help a lot. Generally the ai doesn't mind large distances much when gathering.

That is only (at least mostly) true for food gathering, since she doesn't calculate distances for that.

Link to comment
Share on other sites

1 hour ago, Yekaterina said:

I don't have the skills to write a whole new AI...

No need to write it from scratch, renaming is just so you can let it play against petra. Some old releases of 0ad had more than one ai bundled.

Wfg could also organize an AI tournament ...

  • Like 2
Link to comment
Share on other sites

1 minute ago, hyperion said:

No need to write it from scratch, renaming is just so you can let it play against petra.

Wfg could also organize an AI tournament ...

We could, but not sure many people would participate, though.

Quote

Some old releases of 0ad had more than one ai bundled.

Do you have an example? IIRC it was qbot, aegis, then petra.

Link to comment
Share on other sites

When I run the bot with the changed .js files a yellow warning came up and said bad values for priorities. The bot still run smoothly and used my strategies, but clearly whoever created petra bot doesn't like my strategy. :D

I feel like Petra Bot is quite aggressive and whoever designed it definitely liked rushes more than boom + push. The Ai also seems to hate heroes, champions and siege.

Another issue I spotted recently is idle siege units: the AI does not push with siege until it has got 8 or more rams... typically players can deal some decent damage with a swarm of infantry and 3-4 rams.  

Link to comment
Share on other sites

Would be great if the AI knows some surprising strategies such as continuous champion cavalry raid, sneaky clubmen and mass archer cav. 

Having some champions really increases your kd ratio...

Just don't mine with women and you will be able to afford them...

Link to comment
Share on other sites

I thought it was qbot and petra, but maybe qbot and aegis (around a13 to a15) would have to unpack some old tarballs to check though, quite a while since ...

Anyway having more than one bot bundled is a non issue for players as long as they aren't bugged. One could be more beginner and resource friendly for instance. Dozens wouldn't make sense though.

 

11 minutes ago, Stan` said:

We could, but not sure many people would participate, though.

Participants would be less an issue me thinks, get a few professors to just tell their students about it. I remember a similar competition that was held by the department and about half the students participated. My ai lost in the quarter finals back then. Fond memories ;) and a very good learning experience.

The issue is more that the engine needs some means to enforce max resources used by an ai to make such a tournament meaningful. This mechanism would be good irrespective of hosting such.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...