Results 1 to 10 of 10

Thread: Targeting algorithm: why is it so worthless?

  1. #1
    Trainee
    Join Date
    Sep 2014
    Posts
    15

    Targeting algorithm, and why it needs updated.

    I have been playing for about 2 years now, on and off, and my clan has heard nothing but complaining from me concerning this. So, they urged me to start a thread.

    Why does the targeting algorithm appear as though it was coded in a middle school computer sciences class? It's so incredibly basic and therefore extremely outdated compared to everything else dealing with CoC.

    There are many other similar base building games that have very good targeting mechanics (I won't name them, but I'm sure you know). Units and buildings don't waste their attacks en masse on the exact same unit/building, unlike CoC. Do you know how ridiculous it is for 20 or 30 (or however many) troops and heroes alike to all attempt attacking the same archer?

    Case in point, I attacked a base with a clan castle full of archers (25 to be exact), and even with a heal and rage, it took about 20 seconds for the 2 pekkas, 3 wizards, and lv10 king and his 8 lackies to clear them out, because they were all targeting the exact same archer every single time. Had the wizards' attacks actually counted (which they didn't because their target died before they could fire), the whole group of archers would've died instantly, but the barbs were the only ones actually doing ANYTHING. My raid was blown because of the useless targeting mechanisms in place, that haven't even been updated once in the entire life of CoC... You've really got to do something about this!

    Balloons have a similarly awful targeting system made worse by their slow attack timer. There is no symmetry in their attacks. One time, the moment they get above their target they attack, other times 1 balloon dies right as it was attacking and the others sit there like idiots waiting for someone else to start an animation, eventually all dying because the one randomly chosen to attack first dies before doing anything. How on earth is this "working as intended"?

    Why can't the targeting mechanism allow only the attacks that would kill/destroy the target, any other attackers would focus on another nearby object or continue on toward something else?

    I would really like to hear other's thoughts on this issue, as I'm certain I'm not the only one perturbed by it.

    I love CoC, it has so much more going for it than these other city builders, but this is a major flaw in the game that other games have got right.
    Last edited by NightsReign; April 7th, 2015 at 08:39 PM. Reason: Making it less abrasive

  2. #2
    Forum Elder Deadtoast15's Avatar
    Join Date
    Jun 2014
    Location
    Laying In A Toaster
    Posts
    2,105
    I Actually agree with this. It is quite silly for all your troops to target just one of theirs.
    CoC| Level 212|Town hall 12| | Working on Maxing
    CR| Level 10 | Hog Mountain |
    Quote Originally Posted by xSnippy View Post
    Ah, Deadtoast... 'keeping the forums clean... since June 2014.'
    Avatar made by ClashofHolmes

  3. #3
    Senior Member Penguin9990's Avatar
    Join Date
    Dec 2014
    Posts
    423
    Your right. It is annoying. But how do you suggest it is fixed? I made a thread with a sort of misleading title to attract attention, but in our I suggested that splash damage troops target groups. They would still target the same way, but after they select their target they would mark any other troop inside is area of effect. That way, no wizards would just be sitting there doing nothing because other troops kill their targets. Unfortunately that thread fell out of favor, but I hope you have better luck.

  4. #4
    Trainee
    Join Date
    Sep 2014
    Posts
    15
    My suggestion was in the OP. If a target is slated to die by the current volley of attacks, no further units will target them, unless of course one or more of the units attacking are about to die themselves. But, that part could be added in later.

    A simple Boolean if/then/else phrase would clear up the majority of these problems.

    Each attacking unit would go through this checklist before firing off any attacks.
    IF target hp > 1 attack.
    AND current attack volley =/= kill target.
    OR current attacker(s) = dead.
    THEN attack target.
    ELSE seek other target.

    It's been a while since I worked with Boolean phrases regularly, so I'm a little rusty.
    Last edited by NightsReign; April 7th, 2015 at 10:08 PM.

  5. #5
    Super Member
    Join Date
    Dec 2014
    Posts
    919
    Quote Originally Posted by NightsReign View Post
    My suggestion was in the OP. If a target is slated to die by the current volley of attacks, no further units will target them, unless of course one or more of the units attacking are about to die themselves. But, that part could be added in later.

    A simple Boolean if/then/else phrase would clear up the majority of these problems.

    Each attacking unit would go through this checklist before firing off any attacks.
    IF target hp > 1 attack.
    AND current attack volley =/= kill target.
    OR current attacker(s) = dead.
    THEN attack target.
    ELSE seek other target.

    It's been a while since I worked with Boolean phrases regularly, so I'm a little rusty.
    I think part of the issue is that it would make the AI more complicated, and possibly introduce scenarios where not enough units attack a specific enemy unit, so that unit ends up living.

    I think a better solution is to not have every single troop target the same troop. I swear I've seen situations where I surround a group of troops with archers, and every single archer targets the same troop, even though clearly some archers are closer to one troop, and some are closer to another.

    When troops target building, you can have 20 troops of the same type (barbs, balloons, hogs, etc.) standing on a single tile, and they might target 2-3 different buildings. But when targeting troops, they do the opposite: multiple types of troops standing on multiple spots almost invariably target the same troop.

    Maybe if they just made the troops split up the effort a little?

    And back to someone else's point, the troops with splash damage need to be smart enough to not cancel their attack if the primary target dies, provided there are still enemy troops within the splash radius. It can be unbelievably frustrating to watch a wizard or dragon try over and over and over to get a shot off, but never be able to. That's just bad game design. It's some bizarre combination of the slower attack speed (understandable), and the slower buildup to the attack (understandable), and the funky targeting AI (lame but understandable). Any of these issues would be understandable on its own, but the way they combine to effectively neuter two of the most powerful units in the game, is just bad. Embarrassingly bad. Needs to be fixed.
    Dragons: You either love them or hate them. Well, or maybe both... Or maybe you don't care...
    Regardless of how you feel about dragons, please see this suggestion for Rebalancing Town Hall 7, which is primarily focused around rebalancing dragons.

  6. #6
    Forum All-Star
    Join Date
    Nov 2014
    Posts
    4,402
    Even just this one thing would nearly solve this.

    Wizards should fire their fireball even if the target dies.

  7. #7
    Senior Member
    Join Date
    Feb 2015
    Posts
    300
    Quote Originally Posted by Penguin9990 View Post
    Your right. It is annoying. But how do you suggest it is fixed? I made a thread with a sort of misleading title to attract attention, but in our I suggested that splash damage troops target groups. They would still target the same way, but after they select their target they would mark any other troop inside is area of effect. That way, no wizards would just be sitting there doing nothing because other troops kill their targets. Unfortunately that thread fell out of favor, but I hope you have better luck.
    This goes both ways though. Once wizzards and dragons are programed to attack the largest groups, mortars and wiz towers will be too. Cannons and archer towers will also attack multiple low-health targets at once. In the end, it might not be worth it.

  8. #8
    Trainee
    Join Date
    Sep 2014
    Posts
    15
    Quote Originally Posted by Xitra View Post
    I think part of the issue is that it would make the AI more complicated, and possibly introduce scenarios where not enough units attack a specific enemy unit, so that unit ends up living.
    I don't know if it would make the AI much more complicated. Troops would still target the closest viable thing, unless otherwise indicated (as per the update). AND, I'd imagine they could tweak it so, for instance, there could be an overflow buffer of say 25% extra damage potential being allowed to continue targeting X to ensure it dies.

    Quote Originally Posted by Xitra View Post
    And back to someone else's point, the troops with splash damage need to be smart enough to not cancel their attack if the primary target dies, provided there are still enemy troops within the splash radius.

    Any of these issues would be understandable on its own, but the way they combine to effectively neuter two of the most powerful units in the game, is just bad. Embarrassingly bad. Needs to be fixed.
    This is definitely something needed immediately. It's such an unnecessary bottleneck.

    Maybe if AoE troops targeted the location of the target, rather than the target itself might alleviate a bit of this issue. Though, it's still a major problem when referring to single target attackers.

    How many times have you watched a group of wizards chase a target or group (especially in war attacks) getting off an attack each time, but the target has moved out of their range by that point so the attack is only cosmetic...? So, I've already effectively negated my previous suggestion with this scenario...

    I'm sure someone can come up with a method of implementation that would work.

  9. #9
    Banned
    Join Date
    Jan 2015
    Posts
    144
    It's trivially easy to fix in code. Scan for nearby units, if a friendly is already attacking a unit and it will die within the next second / one hit then don't attack and move on to another target. Repeat for all troops.

    The poor AI in this game is by far the worst part. I give a million gems to have a "push to TH" button to direct troops to not be completely ♥♥♥♥♥♥ed.

  10. #10
    Senior Member
    Join Date
    Dec 2014
    Location
    India
    Posts
    245

    Higher algorithms may lag the game maybe . .

    Quote Originally Posted by AnonymousVillager View Post
    It's trivially easy to fix in code. Scan for nearby units, if a friendly is already attacking a unit and it will die within the next second / one hit then don't attack and move on to another target. Repeat for all troops.
    I guess i see the game and attack lagging if the Ai' has to even compute the damage delt on single target is equal/greater than the hit points of the target. And then calculating whether it will die or not. And then it has to take into account the spells (heal spells) or healer units . . that add hit-points to target.

    I think it will created unwanted lagg in the game during attacks. Again I'm not a code writer or anything just my viewpoint.

    I would really like to see some improvements in the game attack mechanics of a few troops. ( my worst experience being wizards targeting walls of an empty compartment at 99% when the army camp was just outside the compartment and costing 1 star and the war).


    It is annoying but then I guess everyone (all players have the same issue) so it's not keeping few at relatively better advantage or disadvantage. But yes improvement in this line will get us less frustrated, and we might also loose some laughs over it :/

    Regards
    Scorpio

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •