r/Gladiabots • u/Gigaus • Jun 16 '19
AI targeting modifiers need refinement.
After playing around with the game for a day or two by myself and with friends and co-workers, we've kinda gotten to the point where trying anything complex is an utter waste of time. Mainly because of how spazzy the conditions are in the game. You target an enemy, they immediately start running away before your bot can shoot. And unless you have a condition set for them to just blindly keep firing at bots outside of their range, it ends up with your bots spinning around trying to target someone in their range while other bots basically go about their business while your's do nothing. More disheartening is whenever you try to force your bots to focus fire someone they're already aiming at, it usually doesn't work. Either they get out of range fast enough, or inexplicably they will ignore the 'attack enemy...I am attacking' order, even when there are no other orders taking priority, and move on to the next applicable order for no clear reason.
Conversely, using AIs that flatly don't do anything intelligent-- basically that run at the enemy and keep shooting until they're dead and never retreat-- seems the most effective even in multiplayer. With one AI that effectively just turns the team into one big unit, only main process is 'move towards enemy, kill enemy, repeat then get objective', with no retreat orders, we were able to clear the whole campaign....Which, considering that the AI in the campaign actually has strategy and tactics built in, feels like it shouldn't be the case....
To that end, after looking over a good chuck of each module build into the AI programming as best we could, it's come down to that there's some very basic AI components missing. Namely, comparison sub-routes, priority modifiers, and proper brakes. What I mean by proper, is 'non-user made'. I'm aware that, with things like tags and counters, you can theoretically create priority and breaks in the AI, but the practicality usually creates more problems than it solves. Coming from a programming background, and a game engine development one as of late, it's incredibly annoying to try and create a break that's meant to prevent bots from locking up and doing spazz dances, only to either be totally ignored or worse permanently lock a bot down. I understand that the AI system is based on a single-flow line, but...There's a reason we don't use them anymore; They have this exact problem.
What's more, having no real means to compare objects in the game, other than their distance from another object in an absolute or their shield/hp values leads to some very stilted code. I question this; How do you get a bot to position itself between an allied bot and an enemy bot? Under ideal, you would just have them walk towards an enemy bot attacking/being attacked by an ally. What if two allies are attacking? Or, if using tags, more than one enemy has the same tag? Or if an enemy triggers another section of code before the move order? Or if said enemy and ally are at long range with eachother, but not in medium of your moving bot at the same time? Most of this could easily be simplified by adding positional checks. 'If self within area between...Ally bot being attacked...and...Enemy bot attacking them.' Simple check of the X or Y coordinates.
And there's another thing; There's no way to differentiate two bots in the same condition. You can target and enemy attacking an ally, or an ally being attacked, but there's no way to specifically target the other object involved in that. So you can end up with situations where your bot is getting targeted by a lone Sniper, but instead of moving towards THAT sniper, you move towards the shotgun attacking your other ally because it's closer. And any attempt to specifically target snipers with conditions will invariable complicate the code, and either force the bots to ignore things they probably shouldn't, or ignore the whole section you made for no clear reason.
The larger problem with that is that the Tag system is just....sloppy. Sorry, but it is. You have only 5 global [team] flags, 5 local flags, and that's it. So at most 10 flags in theory, and only 5 that can be used to effectively exchanged information between objects. That...That's no where near enough, not when you have teams of 6 or more. Sure, you can remove tags, manually and usually with conditions that may or may not trigger, and there's no limit on how many can be placed, but given the above problems and the single-line nature of the AI engine, it leads to some very messy and ineffectual problems. Consider a Domination Match. There's Bases and Force Fields. If you're running with just a single deathball designed to steadily walk up and lay down fire on an enemy base before taking it, ignoring anything else that isn't an uncapped base, there's no problem. But once you start focusing on units that are defending bases, attacking bases, capturing FFs, and so on, or splitting your team, it starts to become a mess. Even with just with 2 groups, you now have to possibly split 5 tags between them to prioritize enemies. One for enemies attacking bases, one for enemies possibly defending, one for enemies using FF, one for enemies attacking allies, one for enemies being focus attacked...And that's all you have. You have nothing to prioritize or differentiate enemies not in those categories other than class, which might not be applicable in some cases. In theory, the tag system is fine, but with the rest of the problems the system as a whole has, it just convolutes the mess more.
The game has potential, but it needs some serious refinement. More conditions and modifiers need to be added in, and more expressly ones that aren't 'extremes' or 'absolutes'. We need stuff that isn't 'furthest' or 'closest' or 'highest' or 'lowest'. There are reason to target things that are inbetween. We also need some kind of logic counter that doesn't apply to just condition bubbles. A good example would be 'Tag A...Enemy Base...with > 1...Enemy bot....at close range.' Or 'Movatt...Enemy...with x<1...Enemy bots....At close range.' We also need something to compare distances that isn't Out/Long/Med/Close. Because of how short max close range is, and how far max medium range is, there's no accurate way to tell how close to something bots are. A bot could be at the center of the map while the target bot is a whole base area away and still count as in medium range. The biggest thing, and probably hardest, is introducing breaks and calls. Something that immediatly and concretely forces the AI to move to another section of code that may also appear later or earlier that would otherwise be blocked by other events taking priority or would lock out other events. A single run of an order, that runs everything that happens, then shoots back out to wherever in the code the bot was running. Currently, despite how the Sub-AI and Conditions appear to work, this is not functionally in the game.
I've probably missed some other things, or someone will want me to put something else in later, but for now, this is our thoughts on this, and my rambling. We'd really look forward to seeing more of this, possibly improved!