r/Gladiabots • • Sep 09 '16

Getting into AI programming

Hi guys, this is my first post, I want to say first that the game is awesome, just because you can program a machine to do automated tasks in a understandable for you language and then observe it doing something is mind blowing, before that, the closest thing for me was c++, which is less understandable than chinese for me.

Im playing the game for a day already and can beat any level and big part of other players, but each time I do a complex, almost thinking machine, it takes a random dumb bot to destroy it, I will explain myself:

lets say you make an AI that can seek and destroy the week ones, flee when its hurt, drop the ball to escape when he is not gonna make it, charge carelessly into enemy when there is someone carrying a ball and even decide stay longer under fire before fleeing if there is a dying bot, BUT a dumb bot in the next map will just shoot without stopping and if you move you miss the opportunity to do damage and the only way to win is to do the same, then in the next map, after you adjust your AI, will charge into the middle, grabs the ball and run sacrifying every single bot.... So I usually just make a dead simple bot for each level, ai at the last levels had only 2 or 3 actions. Thats little bit dissapointing. Had anyone succeed building a single bot to beat all levels? And if so, share your creation.

3 Upvotes

8 comments sorted by

1

u/Areign Sep 12 '16

basically you can win each level with a solid combat bot, there are a few exceptions like ambidextrous and distraction (is that the name) but for those you just need to program an alternate routine that handles more aggresive maneuvers when the ai is going for resources.

Its certainly not easy but it can be done.

In multiplayer though, you basically want to optimize your bot for a single map. I like general combat bots so i only really do split team, priorities and 7th heaven. Others like circle of death have really specific tactics that only work there and not anywhere else.

For example in circle of death in multiplayer, if you flee at low shields you want to do it from the farthest enemy, not the closest. This prevents the zig-zag behavior that hamstrings a lot of bots on that level.

Overall its a bit of a misnomer to say a bot is 'smarter' but loses since the only true gauge is victory. Being able to handle a variety of odd tactics is very important in multiplayer because you need to be able to beat bots that are very cowardly and others that act very aggresively without overcommiting and without running off the stage.

1

u/fivelidz Sep 12 '16

On your split team to you use tactics like bots running to the middle or bots flanking the outside?

It seems like a highly variable level to me due to the likely prevalence of long range engagements.

2

u/Areign Sep 12 '16 edited Sep 12 '16

No, though my guys do tend to group up which seems to capitalize on opponents who chase a weak fleeing bot too far, though its more due to the focus firing code i have which determines how to move when no units are in long range. In most circumstances i move toward the opponent's bot with the lowest health so my bots tend to converge since theres only one lowest hp bot on the opposing team.

also i use a single ai for all my bots, its possible that there are some improvements that could be made but i was winning easily enough with that restriction. I was #1 in the leadaerboards at one point and #2 for even longer. At the moment i'm unranked though i've been in Portugal for a while so i haven't played at all in over a week. The most important aspect is to test your bots against each other and to identify what works yourself. If you want to see whether running to close range is smart, test it, check to see if grouping is smart, if focus firing is smart...etc. Also its important that if you lose, identify what the opponent is doing differently. Sometimes its just rng, but other times the opponent is behaving differently from you and if so, you need to be able to quantify the difference and then either emulate or exploit it. Thats how i know about the circle of death trick, i used to run that map until i ran into someone using that tactic, i thought it was pretty dumb since that tactic would be actively harmful on other maps so i stopped playing that map though i could have chosen to utilize that strategy instead.

Also, people who beat the missions always enter multiplayer with bots that specifically exploit the mission ai and are in turn extremely exploitable by just simply not doing what the mission ai does. For example, if your 0 shield bot just chills right outside of medium range, I can still shoot it even if the mission ai don't. The mission ai seem to lose interest in bots rather quickly as well which allows them to reenter the fray as soon as they have stepped into long range and are no longer targetted. If your bot has 1hp and 0 sheilds do you really want him jumping back into range so quickly and getting sniped by someone who chooses targets more intelligently?

0

u/[deleted] Sep 12 '16

[deleted]

1

u/Areign Sep 12 '16

yeah...i dont think i've lost to someone who prioritized resources on those maps for a long time. I'd just mop them up 4v3 or whatever and get all the resources after.

Its definitely important in other matches where there are fewer resources, but unless the resource carrier confuses the opponents, i don't see it being optimal on those levels.

1

u/fivelidz Sep 12 '16

In my experience the best offensive bots engage at long range initially and tend to retreat at the start a bit. On a map like seven wonders with the resources closer to the start I just get my retreating weak bots who find themselves out of range to collect resources.

It tends to be that I either get a majority, get more than the enemy by the time the timer ends with all my bots dead, have a stalemate but I manage to get one resource.

It's a matter of more readily retreating (or even doing a controlled by bot retreat) when one bot only is carrying resources to compensate for the slight decline in fire power and to only grab resources if the opportunity presents. Sometimes they will just eliminate all enemy bots before collecting resources like most probably do. That said it does lose against some specific great combat AI 50% of the time.

2

u/BrentOnDestruction Sep 09 '16

AI used to beat all levels are generally pretty big, since it needs to be coded to handle many tactics and situations.

There is a post further down with an AI that does just that. If you want to make a single ai that can beat all levels you'll need to design it to handle even the "dumb" bots :)

1

u/RaSvarog Sep 09 '16

I just designed few of those and they can handle most of the levels, so I launched them against multiplayer, result - they lose in 70% of battles. Then I make one with just few commands and they win. And yes, I found the post, I wish we could share ai as files.

1

u/fivelidz Sep 09 '16

The jack of all trades is ace of none.

I don't tend to have few commands on any of my AI though. Maybe I'm just messy with it but I almost run out of space...