Jump to content

Arch AI Pack v0.1.3 ( 9 Arch based + 4 Petra based AI bots ) [a23]


Arch Bot
 Share

Recommended Posts

Hi again, this is my second contribution to the 0ad game, but a big one for me :)

As I promised on the ArchMod, I've developed a new AI architecture by modifying the original Petra bot. After a long (nearly 2 months) and exhausting development and testing period, it is now ready to be shared with the fans of 0ad.

I have to say that AI development is really a serious job and I have a full respect to the developers of the Petra AI. Thank you very much for your efforts to develop the Petra AI.

Arch AI Pack

Arch AI bots are distributed as a pack that consists 9 Arch based and 4 Petra based bots.

Arch Based AI Bots

Arch based AI bots use Arch AI architecture.

  • Admiral
  • Capitalist
  • Communist
  • Imperialist
  • Mason
  • Mercantilist
  • Patriot
  • Theocrat
  • Unitary

Petra Based AI Bots

Petra based AI bots use the original Petra AI architecture.

  • Imperialist
  • Patriot
  • Single Based
  • Unitary

Initial Release Bonus: Naval Attack + Mauyran AI can produce Support Elephants and use them effectively.

Capabilities: Arch AI can defeat Petra Bot except Very High Starting resources. Arch AI can start naval attacks.

Best faction for Arch AI: Mauyrans (Main faction for Arch AI development)

Tips: I advice to play with ArchMod. In ArchMod, you can set handicap levels for AIs. In addition, you can start with zero resources and play different game modes.

ArchMod Difficulty Support: Arch AI supports Archmod harder AI levels (Insane I-X) that are harder than Very Hard AI level.

Github page of the Arch AI: https://github.com/eserlxl/Arch-AI ( I'm waiting your bug reports and feedback :))

Challenge: Play against Mauyrans faction with Very Low or Zero ( ArchMod ) starting resources.

Installation:

You can download the latest Arch AI Pack from here.

Extract the release version and copy the ArchAIPack directory to the mods directory ( ../0ad/data/mods/ ).

P.S. to Developers: If you give file read/write ability to the AI like readJSON/writeJSON access from the Engine, I can develop a learning AI.

I hope you will enjoy when playing against Arch AI bots :)

 

 

Edited by Arch Bot
v0.1.3 release
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

This sounds really promising, I'll certainly try it out later!

Looking at  https://github.com/eserlxl/Arch-AI/tree/master/simulation/ai/arch-dev , it seems you basically took Petra's files and improved them to create your own version, i.e. yours does not need Petra to work, correct?

Have you considered making your AI compatible with the svn development version (A24)?

One minor thing, 0 A.D. is released under the GPLv2 licence, which means anything can be reused and rereleased under the same or later licence. However, the reverse is strictly speaking not true: GPLv3 files can't be used by 0 A.D. You released your files under GPLv3, which is perfectly fine, but it means they can't be legally incorporated into the public mod.

  • Like 2
Link to comment
Share on other sites

1 hour ago, Nescio said:

This sounds really promising, I'll certainly try it out later!

Looking at  https://github.com/eserlxl/Arch-AI/tree/master/simulation/ai/arch-dev , it seems you basically took Petra's files and improved them to create your own version, i.e. yours does not need Petra to work, correct?

Have you considered making your AI compatible with the svn development version (A24)?

One minor thing, 0 A.D. is released under the GPLv2 licence, which means anything can be reused and rereleased under the same or later licence. However, the reverse is strictly speaking not true: GPLv3 files can't be used by 0 A.D. You released your files under GPLv3, which is perfectly fine, but it means they can't be legally incorporated into the public mod.

Exactly, Arch does not need Petra to run. I will check A24 source asap and try to update Arch AI to be compatible with the A24.

I stated only modified and new files are under GPLv3 on the top of _archbot.js. I considered Arch AI Pack as a separate mod. Therefore, I don't think it is really necessary. But, if it will be packed into the public mod, you are right. Anyway, it's very easy to degrade to GPLv2. I've fixed it. Thank you very much for your feedback.

Edited by Arch Bot
Task completed: Degraded to GPLv2
Link to comment
Share on other sites

On 7/21/2020 at 8:12 PM, Arch Bot said:

I will check A24 source asap and try to update Arch AI to be compatible with the A24.

Please be aware of class renaming that was done in a24. For example these two https://code.wildfiregames.com/rP22328 and https://code.wildfiregames.com/rP23853.
Also I am not sure if your petra will be compatible with a24 aside classes because this one: https://code.wildfiregames.com/rP22527.

I generally do not think you should spend much time getting it compatible with a24 while you actively develop under a23b. But sure once you are happy with state of your ai, you can make it a24 compatible but I would suggest fork your ai and do not try to make it work under both 0ad versions.

Also you can make use of this.debug in Config and if your debuging code with it so you have easier time making dev version to release one.

Happy coding :)

  • Like 1
Link to comment
Share on other sites

@asterix - thanks for the ping!

 

On 7/22/2020 at 9:35 AM, Freagarach said:

You may like D2199. You can take a look and perhaps even test and give feedback there.

I am a bit biased but I think D2199 has a bit of promise :) I have an example repo where I have been training the AI to micro (mostly focused on kiting) here. Essentially, this enables you to create OpenAI Gym environments (a few have been created in the earlier link) and use RL to try to solve the task. I also made a bigger post on the topic a little while back here: 

Alternatively, you could also start with a simpler form of learning and simply perform derivative-free optimization of some of the hyper parameters of the AI (#7 from the earlier post). I played around with this a bit in the past and was able to improve a few of the parameters (though I didn't do a good job of contacting the community or anything :/). Essentially, I updated the code so I could pass parameters to the AI (I copied petra into "petra-param") from the command line. Then I was able to use CMAES to learn the optimal value for these parameters where the fitness function was determined by the win/loss of the agent when playing against the original petra agent on the hardest difficulty.

Hmm... I thought I had made a separate branch with just the beforementioned changes but it looks like it is filled with a bunch of of other explorations into writing AI in Python (before the creation of D2199). Anyway, you can browse the code with just the ability to pass command line params to the AI here: https://github.com/brollb/0ad/tree/a15250e34db352ddbeec7134952e1bfec23a2597

Let me know if you have any questions about either of these that I could help with!

Edited by irishninja
Remove extra spaces
  • Like 1
Link to comment
Share on other sites

This looks interesting :)

As one of the older AI devs (Mostly on Aegis, which was the intermediate between qBot and our current Petra), I think you might want to focus on a single bot with configurability. Improving capabilities and having distinct personalities are somewhat orthogonal concerns.

I see two options for getting this in-game:

- Propose incremental changes as patches.

- If the bot becomes impossibly different, you can always request that we package yours alongside Petra at some point once it's stable enough.

Link to comment
Share on other sites

  • 5 months later...

Hi @Arch Bot,
dont know if you are still around.
I gave your bot another try against my Kiara on mainland maps. I ran them both on medium, balanced.

Your bot was pretty tough to beat because it outproduced mine at some point :) . Though, when I changed my strategy, two early cavalry rushes, set your bot back.
I do not know if you plan to improve it more, but here are three things I noticed and you could improve:

Your bot has quite a lot of women at the start, Kiara lost 8 cav and got 30 kills in one raid and just because she is dumm to keep cav alive ;).

Your bot is sending women to the attack.

After your bot lost cc, it did not try to rebuild it.

I look forward for your update, it would be fun to do bot matches at some point.

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...