AoE2 units are a lot smarter than you think

Sdílet
Vložit
  • čas přidán 3. 07. 2021
  • Choosing new targets may seem like a pretty simple decision, but it's not always straight forward, and it turns out AoE2 units have some excellent decision-making skills.
    0:25 How units pick targets 99% of the time
    0:55 What if two units are EXACTLY the same distance away?
    2:38 Are armor, hills, and bonus damage factored in?
    5:05 Any difference for ranged units or size?
    5:40 How units choose which building to attack?
    6:50 "Samurai seek out the strongest enemy units"?
    _____________________________________________________________________
    Patreon: / spiritofthelaw
    Background music from Epidemic Sound: www.epidemicsound.com
    Game: Age of Empires II Definitive Edition
  • Hry

Komentáře • 666

  • @SirSpartAfterDark
    @SirSpartAfterDark Před 2 lety +471

    Step 1: Just attack the closest guy
    Step 2: Analyze the armor, the amount of health left, the civilization, the hill bonus, the windspeed, the water depth, the time of day, the technological advancements, the time and date of birth, the alignment of the stars, and attack the one you'd kill the fastest.

    • @ghaznavid
      @ghaznavid Před 2 lety +36

      They did that with priority fire on tanks in WW2. Shoot the vehicle that is a threat but will be destroyed easiest first. That's why the US army put the Sherman M4A3E2 Jumbo tank at the head of the column - it looked like a regular M4A3, but had much thicker armour.

    • @sniperdubey
      @sniperdubey Před 2 lety +17

      Step 2 is actually run the damage function on every equidistant unit and pick the highest % damage. That's why it takes everything into account.

    • @Murzac
      @Murzac Před 2 lety +9

      @@sniperdubey Yeah, the math for that is nothing for the game, considering that it's going to have to do that math any time a unit strikes another one, so doing the math a few times in the case of a tie to get the damage amount, then calculating how many hits it takes to kill the unit and picking the smallest one seems like a very good and simple way to go about doing this.

    • @user-xs9oo9gc7u
      @user-xs9oo9gc7u Před 2 lety +1

      I wonder what "the closest" is considered in the actual game. In the actual game units can't be placed with 0 pexel difference.

  • @zakpodo
    @zakpodo Před 2 lety +1385

    Props to "@ILickToesAtNight" for making spirit say that at the end of all his videos.

    • @ghaznavid
      @ghaznavid Před 2 lety +53

      But the real question is - do they?

    • @AnimeCritical
      @AnimeCritical Před 2 lety +5

      Can you explain how he managed to do that?

    • @ghaznavid
      @ghaznavid Před 2 lety +57

      @@AnimeCritical I assume it isn't his own toes - but the name doesn't clarify.

    • @geebster.
      @geebster. Před 2 lety +39

      @@AnimeCritical if you support him on patreon he reads out your name at the end of the videos. someone named themselves that and so he has to say that

    • @ramiel7666
      @ramiel7666 Před 2 lety +30

      ...I heard it as " I lactose at night"......

  • @literalvampirepotbellygobl5629

    AoE2 units: I can do complex calculations in my head in a fraction of a second, but I'll be damned if I can figure out how to walk around this villager.

    • @RevWoody
      @RevWoody Před 2 lety +6

      Agree. They should probably build in a 2 tile range and de prioritize pure distance--run the complex calculus with units in your area, not just the exact tied for closest ones, you dummy.

    • @schmid1.079
      @schmid1.079 Před 2 lety +23

      @@RevWoody That would make larger battles horrendous. Imagine your units trying to go to the weakest enemy unit 2 tiles across, getting blocked by other units while itself is beeing attacked. No way.

    • @mahatmaniggandhi2898
      @mahatmaniggandhi2898 Před 2 lety

      i will also block my comrades

    • @Ratciclefan
      @Ratciclefan Před 2 lety

      XD

    • @daveinthemicrowave4810
      @daveinthemicrowave4810 Před 9 měsíci

      Units are smart but pathfinding make them look dumb.

  • @SandyofCthulhu
    @SandyofCthulhu Před 2 lety +293

    I want to say that 100% of the awesome unit AI is from the programmers (such as Dave Pottinger & co.) and zero is from the designers (such as me).

    • @jocapoc
      @jocapoc Před 2 lety +6

      oh i think we got a crossover over here

  • @Flavourius
    @Flavourius Před 2 lety +900

    Real life Barracks: How to wield a sword, to attack, knowledge about art of war until you call yourself a soldier.
    AoE2 Barracks: How to know about hit points, armor, hill bonus, bonus damage and the biggest knowledge of all: Having no respect towards elders.

    • @eesaubaydullah4231
      @eesaubaydullah4231 Před 2 lety +10

      Indeed

    • @Cecilia-ky3uw
      @Cecilia-ky3uw Před 2 lety +14

      filial piety is a useless value

    • @jaspermay5813
      @jaspermay5813 Před 2 lety +2

      @@Cecilia-ky3uw "Children, obey your parents in the Lord, for this is just. Honour thy father and thy mother, which is the first commandment with a promise: *That it may be well with thee, and thou mayest be long lived upon earth.* And you, fathers, provoke not your children to anger; but bring them up in the discipline and correction of the Lord." Ephesians 6:1-4.

    • @SchrodingerMil
      @SchrodingerMil Před 2 lety +9

      Nah they’re the same.
      In a real Barracks you’ll be taught about target prioritization, how to identify an enemies armor, the benefits of fighting from the high ground, how to counter an enemies advantage (such as a swordsman switching to a mordhau grip to better handle plate armor), and off the battlefield, soldiers don’t give a damn who’s the oldest and who has the most experience, they’re all just in the Army.

    • @Cecilia-ky3uw
      @Cecilia-ky3uw Před 2 lety +3

      @@jaspermay5813 I am no christian

  • @thyrussendria8198
    @thyrussendria8198 Před 2 lety +771

    The targeting priority for building is understandable as towers, castles and TCs have a certain thing in common other buildings don't: They attack back

    • @GummieI
      @GummieI Před 2 lety +59

      Still should imo at least target unit producing buildings over houses as well at least

    • @RheaMainz
      @RheaMainz Před 2 lety +44

      @@GummieI
      ai: "No population, no production!"

    • @azh698
      @azh698 Před 2 lety +9

      @@RheaMainz Mongols "Nope".

    • @RheaMainz
      @RheaMainz Před 2 lety +2

      @@azh698 Huns!

    • @azh698
      @azh698 Před 2 lety +7

      @@RheaMainz Huns don't build houses, Mongols do but if you research their unique technology they don't lose pop cap if they get destroyed.

  • @airbornefilip9139
    @airbornefilip9139 Před 2 lety +568

    They "think" more than I do while chosing targets.

    • @busTedOaS
      @busTedOaS Před 2 lety +29

      hard to say, your brain is not an algorithm but it does do some impressive things, most of the time intuitively without your awareness.

    • @englandrasmussen3111
      @englandrasmussen3111 Před 2 lety +6

      @bustedoas i like that u said this

    • @llSuperSnivyll
      @llSuperSnivyll Před 2 lety

      They don't think nearly as much as you think. In the big mess that is a battle, the "weakest unit" target priority will rarely come up.

    • @kooroshrostami27
      @kooroshrostami27 Před 2 lety

      so you micro down siege rams when other units are around?

    • @theotv5522
      @theotv5522 Před 2 lety

      @@kooroshrostami27 Well, yeah. Those are expensive, big and slow. It catches people's attention faster.

  • @Greywander87
    @Greywander87 Před 2 lety +465

    Samurai: "I am the strongest warrior. I will prove this by crushing the enemy with my superior strength, starting with their weakest and ending with their strongest."
    Samurai: "Ah yes, an enemy samurai. What a weakling. I'll start here and work my way up to something that poses a real challenge. Like that spearman, for example."

    • @sethheristal9561
      @sethheristal9561 Před 2 lety +54

      I can't imagine a more fitting piece of characteristic Japanese pride/delusion/lack of self-esteem

    • @venatus5243
      @venatus5243 Před 2 lety +3

      They seek duel first then the strongest i

    • @ichtyorniscretace9624
      @ichtyorniscretace9624 Před 2 lety +6

      @@sethheristal9561 that's a bit xenophobic

    • @sethheristal9561
      @sethheristal9561 Před 2 lety +4

      ​@@ichtyorniscretace9624 maybe. I don't think it's offensive nor I have issues with it tho :D

    • @agihammerthief8953
      @agihammerthief8953 Před 2 lety +9

      Weak samurai fears the superior reach of the pointy stick. Glorious ashigaru win yet again.

  • @DanielBerke
    @DanielBerke Před 2 lety +38

    I'd assume the preference for the oldest units (all other things being equal) is simply because units get added to some sort of list in code which gets iterated through for checking things like which unit to attack, and if there's nothing else to distinguish between it just takes the first unit it comes to in the list.

  • @Longknife
    @Longknife Před 2 lety +212

    The rule of attacking the closest sinks all of their expertise though...

    • @nikeayuiop
      @nikeayuiop Před 2 lety +59

      Your army worths when lands a hit
      It is irrelevant the life of your opponent if you can not reach him, if he can out run you
      So the criteria of going to the closest one is indeed a better argument than going for the one with less life

    • @mohammadhmaidan1217
      @mohammadhmaidan1217 Před 2 lety +19

      At first, yes. But once the two armies interlock and the first victims fall down this deciding mechanism will do its work just fine.

    • @namekiannameless2752
      @namekiannameless2752 Před 2 lety +5

      If they actually do this complex calculation for all the units it won't work for 90s computer.

    • @TheMuffinman191
      @TheMuffinman191 Před 2 lety +13

      @@namekiannameless2752 Its not really that hard a calculation, just some basic arithmetic.

    • @VK-sz4it
      @VK-sz4it Před 2 lety +4

      @@TheMuffinman191 calculate distance between target unit and all other, choose those that has min. If >1 Then for all them calculate number needed to kill and choose min if>1 use id.

  • @casusincorrabilis1584
    @casusincorrabilis1584 Před 2 lety +111

    AOE units are so smart they even tricked us by singing: "I'm bad, I'm bad!".

  • @BallisticAero
    @BallisticAero Před 2 lety +89

    The amount of work you put into these is very appreciated. "The more you know"

    • @ghaznavid
      @ghaznavid Před 2 lety +3

      There's plenty of things I've changed in my gameplay from SotL videos. Unless I expect a game to go super long, I don't research crop rotation or the final wood upgrade. I use his advice on when to get wheelbarrow etc.

  • @Sephyroth97
    @Sephyroth97 Před 2 lety +15

    Imagine being angry at someone but he's equally distant to an old man so you just punch him instead.

  • @DanyF02
    @DanyF02 Před 2 lety +13

    "Omg I have so many reasons to attack this guy! Oh wait, that other guy is 2 inches closer."

  • @ashclaw2306
    @ashclaw2306 Před 2 lety +38

    Even after all this time I learn new things about this game...

    • @SirPraiseSun
      @SirPraiseSun Před 2 lety +2

      Yea this game is actually deeper than dota or.just as deep

  • @karlheber23
    @karlheber23 Před 2 lety +142

    Maybe this explains how laggy it gets in the late game. Units aren't just calculating unit damage interactions, but also hypothetical unit damage interactions every time a choice has to be made. I bet the developers wish they could redo some of the optimization bottlenecks in that code...

    • @CMZneu
      @CMZneu Před 2 lety +44

      While every little bit adds up I think computationally speaking the equation is fairly fast and computers are very efficient at these things, especially now a days, in fact I would even go as far to say the damage calculation is way faster than the distance calculation it has to do at first since that is comparatively more costly.

    • @tcsiyic3584
      @tcsiyic3584 Před 2 lety

      This seems very likely now that you mentioned it D:
      I wonder if the pro players know this optimization the devs made and would appreciate it more

    • @mrankitanks
      @mrankitanks Před 2 lety +13

      They do those calcs only when two or more enemies are exactly equidistant. So the code is probably slower due to other reasons. As for what this does in practice, it probably only adds a few lines of code inside an if loop that is never used.

    • @CMZneu
      @CMZneu Před 2 lety +15

      I forgot to say that this would not actually lag the game because chances are units are almost never getting to this calculation in the code because 99.9% of the time there is one unit that is closest and as long as one is closer than the others there is no need for it to do the math. So no this isn't increasing lag.

    • @preachey
      @preachey Před 2 lety +2

      I assume that decision is on an IF, so it's not all getting evaluated unless the distance check is a tie. So 99.9% of the time it's probably not an issue.

  • @chrisl9112
    @chrisl9112 Před 2 lety +14

    I'm so proud of my son, the Champion. He's always been a straight A's student. It brings a tear to my eye

    • @kooroshrostami27
      @kooroshrostami27 Před 2 lety +2

      a duellant who picks a badly wounded opponent over a healthy one. What a coward!

    • @nikolozgilles
      @nikolozgilles Před 2 lety

      genius*

    • @amoththatthinks
      @amoththatthinks Před rokem

      @@kooroshrostami27 atleast being a coward will make him live whereas your brave men are rotting in the ground while their families sob!

  • @hardikpande6970
    @hardikpande6970 Před 2 lety +30

    That champion has more brain cells than me in my maths test

    • @roebbiej
      @roebbiej Před 2 lety +1

      We all know that during a math test the amount of active braincells temporarily reduces drastically

  • @sarveshseri
    @sarveshseri Před 2 lety +69

    Meanwhile... Archers : Lets kill that RAM.

    • @officialromanhours
      @officialromanhours Před 2 lety +3

      No wonder it always crashes

    • @anhdunghisinh
      @anhdunghisinh Před 2 lety +1

      Nah, archers only prefer to atk a ram over the other units if it stays in front of enemies units. In the end they still stick with the 1st rule always attack the closest one

    • @agihammerthief8953
      @agihammerthief8953 Před 2 lety +1

      ram close
      archer far
      therefore:
      MUST SHOOT RAM

    • @affanhasby822
      @affanhasby822 Před 2 lety

      We can still target other units right? why is this become a problem? I'm new to AoE, pls help

    • @anhdunghisinh
      @anhdunghisinh Před 2 lety

      @@affanhasby822 you have to click each enemy unit at a time, which is not useful in large battle, cuz you will highly overkill

  • @cynthiathornton5762
    @cynthiathornton5762 Před 2 lety +3

    There's a small book that came with my brother's version of the game that has a lot of information, and it says that Samurai "sought out high-ranking enemies on the battlefield for personal duels" Maybe that's what you remember, but it's written in the historical part of their description, and it doesn't seem to be talking about gameplay at all.

  • @UngattTrann
    @UngattTrann Před 2 lety +183

    This Champion's name was Albert Einstein

  • @Alias_Anybody
    @Alias_Anybody Před 2 lety +37

    The priority of the buildings is actually the most interesting thing. I assume they always attack TCs first even if they don't shoot arrows at them? Or do they always prioritize the buildings attacking them?

    • @peterfrenzke6251
      @peterfrenzke6251 Před 2 lety +2

      I don't like that bombard cannons prefere units over buildings.

    • @DecagonPorygon
      @DecagonPorygon Před 2 lety +3

      @@peterfrenzke6251 It makes sense, bombards are commonly utilized against archers and other siege. Microing them to attack units over buildings is much more difficult than microing them to attach buildings over units.

    • @hrogarfyrninga3238
      @hrogarfyrninga3238 Před 2 lety

      @@DecagonPorygon in a recent multiplayer team game, I killed 2000 units with (Portugese) bombard cannons 11. They are very important on Amazon Tunnel.

  • @ethribin4188
    @ethribin4188 Před 2 lety +19

    I honestly believe the aoe2 AI should be THE example onto how to make AI for strategy games.
    Yes, it comeswith the huge caviat of needing the players to find optimal strategies, so the AI can learn from them (aka the programmers tell it what to do based on what human players do)
    But that still leads to extreemly good results!!

    • @sevenpolar3483
      @sevenpolar3483 Před 2 lety +12

      You have to remember that it has taken almost 20 years to get to this point, really what we learnt was that if you make your AI easy to mod, the community will create a really good AI.

    • @shizukousapostle1stapostle710
      @shizukousapostle1stapostle710 Před rokem +1

      Unless you are talking about the pathing in which case dear god

  • @3snoW_
    @3snoW_ Před 2 lety +12

    It would be a lot more interesting if it wasn't just a tie breaker, i would bet that in practice this almost never happens in real games since the probability of having the 2 closest enemies at the exact same distance is close to 0.

    • @davidnaylor83
      @davidnaylor83 Před 2 lety +1

      Yes, like if units would consider going walking slightly further for an easy kill.

  • @Tocaraca
    @Tocaraca Před 2 lety +2

    I’ve noticed this in big patrol fights before, when sometimes units actually change their targets mid-fight to prioritise killing the lower HP unit first. Provided they are equidistant.

  • @jordanottesen1186
    @jordanottesen1186 Před 2 lety +1

    I’m always in awe at how well you deliver extremely clever jokes while maintaining perfect flow as if they’re simply fact.

  • @claudius6527
    @claudius6527 Před 2 lety +16

    Looking at ranged units would have been interesting as well. Because knowing all this, it seems like an oversight that rams can be used to counter archers although there are weaker units in range and the archer know this as well

    • @Lightning_Lance
      @Lightning_Lance Před 2 lety +5

      good point. maybe it's on purpose because ranged units would be too powerful if they automatically picked the perfect targets.

    • @zerothveratross9975
      @zerothveratross9975 Před 2 lety +10

      If the logic showcased in the video applies to all military units, then the Archers will target whichever unit is closest, so it makes sense for them to hit the ram. They will only target the unit that is faster to kill if it's at the same distance as the ram or closer.

    • @claudius6527
      @claudius6527 Před 2 lety +1

      @@zerothveratross9975 yes the rule applies to archers as well. but since the rule was probably invented to prevent melee units chasing low hp enemies it makes no sense that the same set of rules apply to both melee and ranged units equally

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Před 2 lety

      @@claudius6527 I think the essentially free micro from the AI choosing the targets differently for ranged units would be a balance issue, as well as take out some of the potential depth of the game

    • @Link1506
      @Link1506 Před 2 lety

      To expand on this even more - how do units with minimum range (like skirms) behave. My guess would be that they still attack a viable target, even if another unit is right next to them.

  • @glenrobinson9963
    @glenrobinson9963 Před 2 lety

    Love your thorough experimentation.

  • @dennisjonker4804
    @dennisjonker4804 Před 2 lety

    This has been very informative. This helps with my variable calculations with regards to attack move/patrol, vs directed action.

  • @3xperiment8
    @3xperiment8 Před 2 lety +18

    I was just thinking how addicted I am to this game on this rainy sunday and about to sit at my computer to have some multiplayer brawls

  • @nilsp9426
    @nilsp9426 Před 2 lety +38

    What about this scenario:
    A) Unit that is close but surrounded, so it cannot be attacked
    B) Unit that is close and can be attacked
    Or:
    A) Unit that is close but surrounded
    B) Unit that is further away but can be attacked
    Is there any anti-bump built into units?

    • @gonzalogoded2089
      @gonzalogoded2089 Před 2 lety +4

      Great examples, also I'd like to see if they will follow a fleeing unit that was originally closer, but goes away, or if they will switch targets.

    • @chingamfong
      @chingamfong Před 2 lety +9

      To add to that, do they use the nominal distance or actual pathing distance? For example if there's an obstacle between a unit and one of its target, is that one still the closest?

    • @laurenkirby97
      @laurenkirby97 Před 2 lety +2

      If the pathing is completely blocked I think it just skips to the next unit but what if the closer one is only mostly surrounded so the distance walked to reach it ends up being longer than the next closest one. In gameplay it seems like permanent obstacles factor in but if it's with units it could be different.

    • @alanea5860
      @alanea5860 Před 2 lety +1

      distance isnt measured directly ... but pathfinded around all obstacles
      so if you make maze it will still find shortest way
      if theres no way unit is ignored in favor of any other

    • @laurenkirby97
      @laurenkirby97 Před 2 lety

      @@alanea5860 Do non permanent obstacles get factored in the same way though?

  • @NikitaOnline17
    @NikitaOnline17 Před 2 lety

    brilliant video :D every time i saw one experiment and though "that's cool, but i wonder if-" the very next experiment answered my question

  • @manendralodhi
    @manendralodhi Před 2 lety

    I am telling you. We are a fan of SOTL video's fonts more than his actual content. What beautiful font Sir!!!

  • @buildingman
    @buildingman Před 2 lety

    Always nice to get a new SoL video.

  • @premmagar1170
    @premmagar1170 Před 2 lety

    Great video!! That's very detailed video indeed

  • @KeeteleKeet
    @KeeteleKeet Před 2 lety

    Great video!
    Thank you for the info.

  • @Just4Bboying
    @Just4Bboying Před 2 lety

    I work in a QA job and honestly I wish I had your mindset. You take everything into account.

  • @Azhureus
    @Azhureus Před 2 lety

    Great video dood. From now on, I gonna leave my units to decide their attacks !

  • @OriginalZethrel
    @OriginalZethrel Před 2 lety

    The auto generated subtitles here are just amazing!
    at 2:42 :
    weather has just do it well and motivate them with interviews with social workers

  • @JJBeauregard1
    @JJBeauregard1 Před 2 lety +1

    It's topics like these that are actually really important but nobody ever seriously thinks about because it all happens automatically i find very - sometimes even most - interesting. It's also a reason why i love Sotl's channel so much, despite all the math

  • @miiiiiiiiiiii
    @miiiiiiiiiiii Před 2 lety +1

    Great vid Spirit

  • @marksway57
    @marksway57 Před 2 lety

    All of this is really cool to know. Thank you.

  • @munsters2
    @munsters2 Před 2 lety

    Thank you. That is really useful information.

  • @Xenotric
    @Xenotric Před 2 lety +21

    I guess with the age thing is they lock on the moment something enters their range and dont swap unless certain conditions are met such as weaker or closer. Did you test putting the enemies down first then spawning the champion in the middle to theoretically remove that element?

    • @hedgehog3180
      @hedgehog3180 Před 2 lety

      They might also be choosing from a global list of enemy units.

  • @Vordikk
    @Vordikk Před měsícem

    Nice analysis! From it i can imagine and recreate target seeking logic in code if needed
    However, i'd like to add considering distance into account too.

  • @BrackishBrit
    @BrackishBrit Před 2 lety

    Been watching for like 2 years even though I didn't play AoE2 anymore. Picked up Definitive in the Steam summer sale and while your videos have helped take a bit of the edge off learning everything I can safely say I am still awful XD Thanks for the awesome content though Spirit!

  • @mauromasterx
    @mauromasterx Před 2 lety

    noticed archers doing it as well, probably another rabbithole there too Spirit, sometimes they even chase a bit the weakest guy before reengaging closer ones

  • @Ashasverus
    @Ashasverus Před 2 lety

    The fact that you thought to be aware of artifacts in the software in terms of the unit placement priority raises my estimation of your abilities.

  • @VraccasVII
    @VraccasVII Před 2 lety

    Just the fact that hills give a modifier blew my mind already, I never knew this when I played this back then

  • @UrukKing
    @UrukKing Před 2 lety

    I was sure you would be right, after reading the title, but now I'm more impressed with the unit behaviour than I thought I'd be.

  • @jeffreyblack666
    @jeffreyblack666 Před 2 lety

    In online multiplayer games, determinism can be quite good. Taking the oldest unit in a tie can be an easy way to get that determinism. It also makes sense programmatically if it is iterating through all units to find the one to attack. It reaches the oldest one first decides to attack it, and then gets no better target.

  • @ramsessiereveld2824
    @ramsessiereveld2824 Před 2 lety

    aah spirit, you always know exacly what game mechanic I did not know I needed to klnow about, but did. Well done sir!

  • @ianwong411
    @ianwong411 Před 2 lety

    wow. genius for figuring this out. me, i didnt even bother which unit my unit attacks during clashes

  • @TheNezperdian
    @TheNezperdian Před 2 lety

    Amazing video!

  • @kartiksaraf4676
    @kartiksaraf4676 Před 2 lety +2

    Based on this I would love to see a battle where the 1st step is removed, that is units DON'T attack the closest one. I imagine a 60 v 60 champion fight to actually never finish and it all being a formation match where units keep on realigning themselves and choosing new targets

  • @Zilto1d
    @Zilto1d Před 2 lety

    Great video!

  • @srilemobitelsrile8809
    @srilemobitelsrile8809 Před 2 lety +13

    So they think in distance and 'hits'. Nice.

  • @fastfat08024
    @fastfat08024 Před 2 lety

    Awesome content keep it going 😉

  • @devangnivatkar2649
    @devangnivatkar2649 Před 2 lety +1

    Whoa, this was amazing to know!

  • @spockamania
    @spockamania Před 2 lety

    I swear, every time I watch one of your videos, I want to learn how to play OpenTTD. It has such good music

  • @Emperor_Hood1994
    @Emperor_Hood1994 Před 2 lety

    Thats seriously impressive
    with my time when i was Younger and played this game after school up until now i have thousands of hours and still had absolutely no clue how impressive the AI actually is
    another reason to love AOE2 and to be hyped for AOE4 ( since i didnt like AOE3 )
    Great content mate ^^

  • @magpiepicapica1427
    @magpiepicapica1427 Před 2 lety

    this fight in the end was beautiful

  • @blakelivesay
    @blakelivesay Před 2 lety

    Super interesting, although I imagine many of us would prefer the targeting to prefer how quickly it would kill over nearest unit within reason. Taking into account damage that could be done to you would be helpful too.

  • @ananass8030
    @ananass8030 Před 2 lety

    Good video
    You forgot in the building target one very important unit trap, they auto target above *all* (except an enemy unit that pass really close to them, or even that not, I'm not sure) an enemy farm they're standing on, if they happen to just have killed another unit while on the farm

  • @boejiden1942
    @boejiden1942 Před 2 lety

    Well thought out

  • @marcgomez8391
    @marcgomez8391 Před 2 lety +24

    So you're telling me the game has this amazingly well-structured priority focus system that would make macro significantly more benefitial... only for them to prioritise closest targets anyway? lol what

    • @ryanergo754
      @ryanergo754 Před 2 lety +2

      Try the same experiment with 200 units on the battle field and remove the closest mechanic. I did once. Completely stopped the AI army with 17 archers.

    • @MrAbgeBrandt
      @MrAbgeBrandt Před 2 lety +3

      How does one "remove" that mechanic?

  • @dalemac89
    @dalemac89 Před 2 lety

    I'd have thought this would be some form of graph search function like Dijkstra or A*, with nodes weighted by distance, type, hp, armour, or any other relevant property. If not, it would be super fun to refactor into one of the afformentioned, nice problem to solve!

  • @alastairshaw3311
    @alastairshaw3311 Před 2 lety

    Love the video SotL! I assume its the same for Gia? The Boar always picks my weak villagers, or at least that's what it feels like!

  • @shaunroberts2037
    @shaunroberts2037 Před 2 lety +4

    Wow these champions are really well educated, they must have been taught by ancient AOE gold sages

  • @Mine4dayzz
    @Mine4dayzz Před 2 lety

    This has really made me appreciate my units more!

  • @JoeKnaggs
    @JoeKnaggs Před 2 lety

    Great video, thanks :)

  • @Dsnake5
    @Dsnake5 Před 2 lety

    OMG this is amazing, great video man. I'm a science person and this is incredible, keep them coming!

  • @ZeroGarth
    @ZeroGarth Před 2 lety +2

    I'm getting really emotionally invested in this champion.

  • @-Raylight
    @-Raylight Před 2 lety +32

    Glad to know that even AI prefers to attack to old and weak people xD

    • @rao5108
      @rao5108 Před 2 lety +5

      "even"?
      I am worried for all the elders around you...

  • @inwector
    @inwector Před 2 lety

    This is the most satisfying video you have ever made.

  • @erwinwendler4621
    @erwinwendler4621 Před 2 lety

    I also noticed that buildings like castles now instantly hit important buildings on the same radio of attack first, for example a tower or enemy tc instead of a closer house. Sadly they still get bugged and dont redirect the attack automatically to passing units, meaning you have to manually target them yourself

  • @d0nutwaffle
    @d0nutwaffle Před 2 lety

    You could make a vid on building target priority for trebs as well.
    The order seems to go something like
    TC
    towers
    castles
    everything else

  • @youtubeuser6978
    @youtubeuser6978 Před 2 lety

    Great video, as always! But have you ever thought how random "MegaRandom" actually is? Are there any rules the map generation follows, if so, what´s the limit? What is generally the best civ for random and why? I was wondering about that because Megarandom was added to the ranked queue again so I thought about it and couldn´t really settle on a civ I want to pick in case my enemy doesn't want to go random.

  • @Sputnik5790
    @Sputnik5790 Před 2 lety

    The endscreen Transport Tycoon musik is so nostalgic.

  • @ThmSphone
    @ThmSphone Před 2 lety

    That's why I'm subscribed, nice

  • @marwanbensaud548
    @marwanbensaud548 Před 2 lety

    love these details

  • @MajoraZero
    @MajoraZero Před 2 lety +1

    The target selection being entirely deterministic is very clearly a design goal of the process, in order for multiplayer to work correctly!
    Maybe something you could look into is what is actually random during an Age 2 match.

  • @zakpodo
    @zakpodo Před 2 lety +5

    What about ranged units? Does proximity matter if there are multiple units within range? My hunch is that it does not matter, unless they have to move to get within range of a target, but that's not based on anything.

    • @davidnaylor83
      @davidnaylor83 Před 2 lety

      Yes, good question. Would be interesting to see how ranges units pick their targets in another video.

  • @JackOpulski
    @JackOpulski Před 2 lety

    I noticed even trebuchets will automatically attack important targets (TC and castles). Although it stops right after they finished those, and they start attacking mining camps instead of military buildings that are at equal distance

  • @Kieva_Storm
    @Kieva_Storm Před 2 lety

    This is actually super cool information. One thing I would prefer to see from the unit AI, though, is to see a 'buffer zone' for the closest unit rule. Like if you have a 1-hit unit like 3 steps further than the full hp equivalent, that it would go for the 1-hit unit. Something to consider the efficiency of dropping off a unit that might take only an extra game second to reach.

  • @oscarvozzi7548
    @oscarvozzi7548 Před 2 lety

    Spirit of the law champion: calculating hp armor hill and bonus damage.
    Mine champion: following the same trade cart for 15 minutes.

  • @abacaxi.maldoso
    @abacaxi.maldoso Před 2 lety

    Those guys are philosophers! Starter than me!!

  • @HammerspaceCreature
    @HammerspaceCreature Před 2 lety

    The strengths and weaknesses of AI compared to humans in games are always very interesting. It reminds me of developing builds for the AI Heroes in Guild Wars 1. They weren't as smart as people but because they had perfect information they played like absolute gods at very specific things like Curses, where they would always know exactly which enemies had debuffs applied to them and would always refresh them the instant they ran out.

  • @lazyfurret
    @lazyfurret Před 2 lety

    here is an issue with the wonder logic: the decision tree might be based on the game mode it was defaulted to, so them not choosing a wonder might depend on that + it might actually depend on unit type and the type of damage it deals to different targets

  • @checktaschu4492
    @checktaschu4492 Před 2 lety

    some developer must be incredibly happy that his effort is finally recognized

  • @roym2185
    @roym2185 Před 2 lety

    Super smart tie-breakers there. Some interesting stuff. As always, great job SOTL.
    Would love your take on more practical game stuff from yourself. Like how much damage do you have to do to make a trush worth it... given you're sending 4 or 5 vills across the map. That'd be a nice series. Same can go for drush and scouts, etc. as you're investing military and could have just gone up to castle. How much damage do you need to do in order to make a drush or scout rush worth it? Another could be about laming - how much damage do you have to get in to make laming with a villager worth it... given Goth/Mayan/Chinese get loom first/immediately. Going forward with a vill and laming round resources. Similar comparisons.
    A final one... how much does forcing opponent to quickwall reduce their resources through inefficiency (like if they quickwall round berries or wood). Would love your stats and take on those.

  • @ivanstrydom8417
    @ivanstrydom8417 Před 2 lety

    I'm not sure if you already have, but could you make a video explaining how the Saracen market bonus works and compare it to how the Guilds tech works? Thank you for fun and enlightening content.

  • @PowermadNavigator
    @PowermadNavigator Před 2 lety

    Hmm... makes sense. I remember in AoE1 and its expansion, the CPU's units also frequently targeted my injured units. The logic there seemed flawed and seems to have been improved kinda. Those units would also prefer to hit ranged units if engaged by them first, ignoring others on their way even when taking hits from them. Even if shot first by another ranged unit, the enemy unit seemed likely to target another nearby unit, once it gets close, that is injured (if available). This is what I remember... was some time ago now, haha. More than some time actually...

  • @lloouuiissttaaii
    @lloouuiissttaaii Před 2 lety

    Yesterday I realised that the trebuchet did target Malay Habour as a priority target, then generic barracks.
    Maybe SOTL may make a video discussing the full Hierarchy of siege unit targeting? This time should include all buildings like habour, tower, TC, Castle, krepost, donjons.

  • @zanstaszek9
    @zanstaszek9 Před 2 lety

    5:20 it may work not exactly on the size of the unit, but how the distance is calculated between units.
    In some games it takes the distance to the center of another unit, in others it considers the distance to the edge. If the 2nd method is the case, when both enemy Champion and Elephant were at the same distance to the edge, the other factors (like effective health or order of placement) should be observed.

  • @MasterSonicKnight
    @MasterSonicKnight Před 2 lety +3

    do ranged units always attack the closest one too, or do they target the weakest one in their range?
    also it feels kinda impressive that they'd put so much work on something that would hardly ever matter in an actual match, since it's extremely rare for 2 units to be the perfectly exact distance from each other

  • @3irikur
    @3irikur Před 2 lety +1

    What about multiple units working together? Does potential damage from other friendly units factor into the decision of what unit to target? For example assume two blue champions (A1 and A2), and three red (B1, B2 and B3). Space these units out so that A1 is of an equal distance to B1 and B2, and A2 is of an equal distance to B2 and B3. Would the blue champions figure out to focus-fire B2, or would they chose their targets independently from each other?

  • @whydoyougottahavthis
    @whydoyougottahavthis Před 2 lety

    I ponder a guess that it attacks top then left when given a forced choice, oxymoron lol, I postulate that it is because the program is crunching the numbers including sub pixels and such in a way that includes the angle at which the game is played at, and it somehow takes that into account

  • @zakpodo
    @zakpodo Před 2 lety

    This is amazing by the way, quite a lot of complexity added simply to create a mechanic that has extremely little impact on gameplay (such that 20 years later most of us are unaware of its existence).
    As an aside, it is kind of true that samurai do target stronger units. At least relative to other units and to the extent that uniques are strong. As their bonus will make them comparatively faster to kill.

  • @pranavchoudhary5746
    @pranavchoudhary5746 Před 2 lety

    Should have included trebuchet's target selection as well in this video. Seemingly my trebs always prefer to bring down enemy market first when I leave them unpacked in the middle of the enemy's base.