Here is the ultimate AI for beginners

User avatar
PEW
Script
Script
Posts: 35
Contact:

Here is the ultimate AI for beginners

Post#1 » 21 Apr 2017, 19:12

Gladiabots is a fantastic game but unfortunately it may be hard for some beginners. E.g. some may play way to aggressive but win anyways, which makes it difficult to find a balanced strategy, so I see very different strategies everywhere except in Grand Master League. The top players act more similar and have found a solid base. As a 1900+ player and currently number 8 on the Leaderboard I wanted to create "SimpleBot", a very simple but powerful AI that has all but only the important parts of a successful strategy and a great base to start optimizing for beginners but also for advanced players to test their AI against. I improved SimpleBot quite long and tested it against various different AIs, the practice mode and some multiplayer matches. In some situations it even beats my main AI with hundreds of nodes by using only 16 nodes! It is seriously strong and also bug free. With some minor improvements I'll mention below, this AI should bring you straight into the Grand Master League.

So here it is:
http://imgur.com/OV1OA13
(Updated version by MrLunk: https://imgur.com/gallery/OXqNDkQ)

Preview
Image
(Updated version by MrLunk)

Replay-IDs
I played three multiplayer matches with SimpleBot:

  • Seven Wonders against mrchris (1993): 570732
  • Kingmaker against mrchris (1963): 570800
  • Seven Wonders against TalonZa (1454):570829
Obviously I lost the matches against mrchris, who is a 1900+ and has highly optimized AIs per bot and map, but as you can see, it were close matches nearly at the same level. The match against the 1400+ was a win and I guess without any additional improvements you might land somewhere close to that in career mode.

Explanation
The AI is split into some modules:

  • Blue: The retreat module
  • Yellow: The shooting module (with priority A)
  • Green: The resource module
  • Red: The pushing module
  • Pink: The shooting module (with priority B)
  • And the rest of things with low priority

The order of modules is very important, for instance you always flee, if you are in danger. This is in the very most situations stronger than any over aggressive behavior (except in Mind Game). Splitting the shooting module also results in a huge advantage:
If you are not in danger, you shoot, if you can hit the enemy some serious damage. Else (e.g. every enemy is far away) and you feel well, you catch resources or push. But if you don't feel that well you still can shoot some enemys with less chances to big damage.

Recommended improvements
I made many updates and improvements on SimpleBot, but I don't want to share them in a written AI, because otherwise players using this AI would have too big advantages against other players and I don't wanted to take away the whole fun of optimizing an AI. But here is a list of things you should definitely consider to put into your AI:

  • 1. More conditions to the push module: You might see after some matches that you push too far and get damage because of that. Try to find a simple and universal solution for that. Edit: Compare with the comments below.
  • 2. Focus more at enemys moving to or carrying resources: Just edit the shooting module with a few nodes. Try to find out if it fit's better in priority A or B ;)
  • 3. Split the resource and push modul: Sometimes (not too often) it is better to push than collecting resources.

If you leveled higher up, here are some other thing you can do:

  • 4. Put each module into a separated subtree: If your AI grows over 100 nodes, the game starts bugging and slowing down a lot.
  • 5. Add a rush module: Rushing is extreme and aggressive pushing and it's usually only useful if there is only one single and weaker enemy (at some range), or good at Mind Game.
  • 6. Bot optimization: Once you've unlocked different types of bots, you may notice their different advantages and disadvantages. E.g. you should push more with a Shotgun and less with a Sniper. Also a Sniper should not differentiate to much between medium and long range when it comes to shooting.
  • 7. Map optimization: Check out some successful Replays IDs of the top 10 players to find out how they behave at the very beginning of each map. This costs a lot of time and you should only do it if you have a solid core AI.

Annotations
  • SimpleBot uses some target filters. You unlock them once you reached level 3, which can be achieved pretty quickly.
  • You can actually leave out the node If self is carrying resource as this doesn't do anything anyways. I just kept it in to make thinks easier to understand.

Edit by GFX47: updated preview
Last edited by PEW on 23 Apr 2017, 22:24, edited 3 times in total.

pier4r
Skynet
Skynet
Posts: 3390

Re: Here is the ultimate AI for beginners

Post#2 » 21 Apr 2017, 19:29

Nice effort! Great. I post it on reddit.

https://www.reddit.com/r/Gladiabots/com ... t_an_idea/
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
neoliminal
Algorithm
Algorithm
Posts: 78

Re: Here is the ultimate AI for beginners

Post#3 » 22 Apr 2017, 03:49

Thank you for the work. This is not entirely different then the system I created from scratch, although I prioritized shooting over retreating (which later got conditionals to resolve.)

I like the way you handle resource and pushing as one... very clever.

The retreat module also handles dropping the resource, something new players often forget. So that's also a nice touch.

This looks like a great starting point! Thanks. I've learned from looking it over even though I'm well past this stage of my AI creation.
[Target closest post where post is type Sniper.]

User avatar
PEW
Script
Script
Posts: 35
Contact:

Re: Here is the ultimate AI for beginners

Post#4 » 22 Apr 2017, 19:03

Thank you for the positive feedback :) Did you try to fight your AI against this one? Would be interesting to see who would win.

User avatar
LuBeNo
Autonomous Entity
Autonomous Entity
Posts: 532

Re: Here is the ultimate AI for beginners

Post#5 » 22 Apr 2017, 19:16

I ask myself what several fights on different maps between your ultimative AI for beginners (16 Nodes) and my Grand Master Bot (30 Nodes) would look like.
Image
My algorithm of life: if(self.tired) sleep(); else if(self.hungry) eat(); else follow(Jesus);

User avatar
Ritter Runkel
Neural Network
Neural Network
Posts: 498

Re: Here is the ultimate AI for beginners

Post#6 » 22 Apr 2017, 20:41

Very nice description. I just tested it on my standard test setting (ambidextrous) and it's working fine for such a small and smart AI.

PEW, thx for sharing


Team red is using this AI

Screenshot_2017-04-22-20-32-01__1492886426_93.235.205.178.jpg
Screenshot_2017-04-22-20-32-01__1492886426_93.235.205.178.jpg (71.02 KiB) Viewed 21542 times

User avatar
PEW
Script
Script
Posts: 35
Contact:

Re: Here is the ultimate AI for beginners

Post#7 » 22 Apr 2017, 21:32

LuBeNo wrote:I ask myself what several fights on different maps between your ultimative AI for beginners (16 Nodes) and my Grand Master Bot (30 Nodes) would look like.


I just tested them. That's also a great and compact AI, funny that we use exactly the same retreat module.


  • Seven Wonders: SimpleBot is definitely not optimized for snipers, so if both teams don't use a Sniper, or I make a small update and use the pushing/resource tree only if self botclass is not sniper (one node), SimpleBot wins. But actually your AI beats my main AI at 7W :D
  • Barred Spiral:Depends a bit on the setup but with the sniper optimization mentioned above, SimpleBot wins.
  • Set your Priorities: SimpleBot wins.
  • Kingmaker: SimpleBot wins again.
  • Mind Game: Depends on the setup, so I'll count that as a draw.
  • Split Team: SimpleBot wins with the update.

I have not testet Circle of Death or Meeting point yet, but I'd say without the sniper update and both teams with snipers, your AI would win, while with the update SimpleBot is stronger. Well maybe I should remove the "for beginners" of this post title, if this is at least at the same level as some AI that made it into the Grand Master League. :lol:

User avatar
PEW
Script
Script
Posts: 35
Contact:

Re: Here is the ultimate AI for beginners

Post#8 » 22 Apr 2017, 21:46

Ritter Runkel wrote:Very nice description. I just tested it on my standard test setting (ambidextrous) and it's working fine for such a small and smart AI.

PEW, thx for sharing


Team red is using this AI

Screenshot_2017-04-22-20-32-01__1492886426_93.235.205.178.jpg


Cool, who wins if you implement the sniper optimization node? Because according to the screenshot I lost a bot but have a way better position (close to the resources and a pincer formation) and good shilds. On this map this 16 node AI actually beats my main AI... :o

User avatar
Ritter Runkel
Neural Network
Neural Network
Posts: 498

Re: Here is the ultimate AI for beginners

Post#9 » 22 Apr 2017, 22:01

They almost got a draw, I didn't expected that:

Screenshot_2017-04-22-21-58-13__1492891168_93.235.205.178.jpg
Screenshot_2017-04-22-21-58-13__1492891168_93.235.205.178.jpg (83.7 KiB) Viewed 21531 times

User avatar
Ritter Runkel
Neural Network
Neural Network
Posts: 498

Re: Here is the ultimate AI for beginners

Post#10 » 22 Apr 2017, 22:04

And even on split team they harmed some of my bots. They started to lose even the middle bot vanished.

mcompany
Autonomous Entity
Autonomous Entity
Posts: 872

Re: Here is the ultimate AI for beginners

Post#11 » 22 Apr 2017, 22:33

Wow, this AI seems to just melt through my rush AI. At least now I have some test data to go with. Also I did some very minor changes to it (such as removing the ”if self carrying resource” condition that does nothing)

pier4r
Skynet
Skynet
Posts: 3390

Re: Here is the ultimate AI for beginners

Post#12 » 22 Apr 2017, 23:17

mcompany wrote:Wow, this AI seems to just melt through my rush AI.


This is unexpected. Nice that sharing for newcomers helps everyone.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
Bombafat
Script
Script
Posts: 40

Re: Here is the ultimate AI for beginners

Post#13 » 22 Apr 2017, 23:28

Very intresting! I weil try it tomorrow against my ai on several maps. And I am sure that I can learn from it.

User avatar
Bombafat
Script
Script
Posts: 40

Re: Here is the ultimate AI for beginners

Post#14 » 23 Apr 2017, 15:03

Here are my results from your Simple AI (modified with the suggested Sniper node) against my AI (137 nodes) and I feel destroyed. :o Both teams were placed symmetrically with my standard setup at each map.

Your AI won against mine at
  • Seven wonders 4:3 ressources
  • Set your Priorities 3:2 ressources
  • Split team

My AI won against yours at
  • Meeting point
  • Circle of Death
  • Mind game (obvious since highly specialised here)
  • Kingmaker 6:1
  • Barred Spiral

My AI has specialised AI's for every bot class and I didn't expected to loose 3 maps! Now I feel like I do not deserve my place in Grand Master :oops: and I need to rethink alot of my AI. You did a really good job there!

User avatar
Kanishka
Skynet
Skynet
Posts: 1421
Contact:

Re: Here is the ultimate AI for beginners

Post#15 » 23 Apr 2017, 17:59

XPRMNT Alpha was obliterated by PEW's AI. Both teams all assaults, Seven Wonders. Thing is, I don't use pure XPRMNT Alpha.
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

User avatar
Kanishka
Skynet
Skynet
Posts: 1421
Contact:

Re: Here is the ultimate AI for beginners

Post#16 » 23 Apr 2017, 19:10

Calling an AI the ultimate is very misleading. In case you, the reader, want to defeat SimpleBot, use the Multi-Tasker Zero Edition. Absolutely minimized node count... You might want to add a Drop Resource in the retreat part. Tested to be working for full assault teams.
Attachments
MT Zero Edition.png
MT Zero Edition.png (194.72 KiB) Viewed 21470 times
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

pier4r
Skynet
Skynet
Posts: 3390

Re: Here is the ultimate AI for beginners

Post#17 » 23 Apr 2017, 20:55

How do those AI fare against those listed here: viewtopic.php?f=7&t=451 ?
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
PEW
Script
Script
Posts: 35
Contact:

Re: Here is the ultimate AI for beginners

Post#18 » 23 Apr 2017, 22:03

Bombafat wrote:Here are my results from your Simple AI (modified with the suggested Sniper node) against my AI (137 nodes) and I feel destroyed. :o Both teams were placed symmetrically with my standard setup at each map.
(...)


Thanks for testing and sharing the result, Bombafat! I did not expect that SimpleBot could win against someone in the top 20 in multiple maps.

Captain Spock (Castlevania)
Automaton
Automaton
Posts: 177

Re: Here is the ultimate AI for beginners

Post#19 » 23 Apr 2017, 22:09

Kanishka wrote:Calling an AI the ultimate is very misleading.


This AI really recapitulate the essential of this game very well. It is simple but at the same time found a good structure to expand. Although obviously not perfect, I would like to accept it as "ultimate" "for beginners". :lol:

User avatar
PEW
Script
Script
Posts: 35
Contact:

Re: Here is the ultimate AI for beginners

Post#20 » 23 Apr 2017, 22:12

Kanishka wrote:Calling an AI the ultimate is very misleading. In case you, the reader, want to defeat SimpleBot, use the Multi-Tasker Zero Edition. Absolutely minimized node count... You might want to add a Drop Resource in the retreat part. Tested to be working for full assault teams.


Well I think it is a very great starter baser, you can differentiate between each module which means easier to evolve and it seriously kicks some ass, even in Grand Master League. Of corse it is definitely not the best AI out there, but it is not designed for being that.

In which maps did your AI win? Did you try to use other bots than assaults?

Return to “Strategies”

Who is online

Users browsing this forum: No registered users and 1 guest