AoE2 units are a lot smarter than you think

Поділитися
Вставка
  • Опубліковано 3 лип 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
  • Ігри

КОМЕНТАРІ • 667

  • @literalvampirepotbellygobl5629
    @literalvampirepotbellygobl5629 3 роки тому +600

    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 3 роки тому +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 3 роки тому +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 3 роки тому +1

      i will also block my comrades

    • @Ratciclefan
      @Ratciclefan 2 роки тому

      XD

    • @daveinthemicrowave
      @daveinthemicrowave 10 місяців тому

      Units are smart but pathfinding make them look dumb.

  • @zakpodo
    @zakpodo 3 роки тому +1387

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

    • @ghaznavid
      @ghaznavid 3 роки тому +53

      But the real question is - do they?

    • @AnimeCritical
      @AnimeCritical 3 роки тому +5

      Can you explain how he managed to do that?

    • @ghaznavid
      @ghaznavid 3 роки тому +57

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

    • @geebster.
      @geebster. 3 роки тому +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 3 роки тому +30

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

  • @SirSpartAfterDark
    @SirSpartAfterDark 3 роки тому +473

    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 3 роки тому +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 3 роки тому +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 3 роки тому +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 2 роки тому +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.

  • @SandyofCthulhu
    @SandyofCthulhu 3 роки тому +298

    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 2 роки тому +6

      oh i think we got a crossover over here

  • @thyrussendria8198
    @thyrussendria8198 3 роки тому +770

    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 3 роки тому +59

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

    • @RheaMainz
      @RheaMainz 3 роки тому +44

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

    • @azh698
      @azh698 3 роки тому +9

      @@RheaMainz Mongols "Nope".

    • @RheaMainz
      @RheaMainz 3 роки тому +2

      @@azh698 Huns!

    • @azh698
      @azh698 3 роки тому +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 3 роки тому +568

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

    • @busTedOaS
      @busTedOaS 3 роки тому +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 3 роки тому +6

      @bustedoas i like that u said this

    • @llSuperSnivyll
      @llSuperSnivyll 3 роки тому

      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 3 роки тому

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

    • @theotv5522
      @theotv5522 2 роки тому

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

  • @Flavourius
    @Flavourius 3 роки тому +899

    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 3 роки тому +10

      Indeed

    • @Cecilia-ky3uw
      @Cecilia-ky3uw 3 роки тому +14

      filial piety is a useless value

    • @jaspermay5813
      @jaspermay5813 3 роки тому +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 3 роки тому +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 3 роки тому +3

      @@jaspermay5813 I am no christian

  • @Greywander87
    @Greywander87 3 роки тому +464

    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 3 роки тому +54

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

    • @venatus5243
      @venatus5243 3 роки тому +3

      They seek duel first then the strongest i

    • @ichtyorniscretace9624
      @ichtyorniscretace9624 3 роки тому +6

      @@sethheristal9561 that's a bit xenophobic

    • @sethheristal9561
      @sethheristal9561 3 роки тому +4

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

    • @agihammerthief8953
      @agihammerthief8953 3 роки тому +9

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

  • @casusincorrabilis1584
    @casusincorrabilis1584 3 роки тому +111

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

  • @BallisticAero
    @BallisticAero 3 роки тому +89

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

    • @ghaznavid
      @ghaznavid 3 роки тому +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.

  • @Longknife
    @Longknife 3 роки тому +212

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

    • @nikeayuiop
      @nikeayuiop 3 роки тому +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 3 роки тому +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 3 роки тому +5

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

    • @TheMuffinman191
      @TheMuffinman191 3 роки тому +13

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

    • @VK-sz4it
      @VK-sz4it 3 роки тому +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.

  • @DanielBerke
    @DanielBerke 3 роки тому +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.

  • @Sephyroth97
    @Sephyroth97 3 роки тому +15

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

  • @ashclaw2306
    @ashclaw2306 3 роки тому +38

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

    • @SirPraiseSun
      @SirPraiseSun 3 роки тому +2

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

  • @DanyF02
    @DanyF02 3 роки тому +13

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

  • @chrisl9112
    @chrisl9112 3 роки тому +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 3 роки тому +2

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

    • @nikolozgilles
      @nikolozgilles 2 роки тому

      genius*

    • @amoththatthinks
      @amoththatthinks Рік тому

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

  • @hardikpande6970
    @hardikpande6970 3 роки тому +30

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

    • @roebbiej
      @roebbiej 3 роки тому +1

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

  • @sarveshseri
    @sarveshseri 3 роки тому +69

    Meanwhile... Archers : Lets kill that RAM.

    • @officialromanhours
      @officialromanhours 3 роки тому +3

      No wonder it always crashes

    • @anhdunghisinh
      @anhdunghisinh 3 роки тому +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 3 роки тому +1

      ram close
      archer far
      therefore:
      MUST SHOOT RAM

    • @affanhasby822
      @affanhasby822 3 роки тому

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

    • @anhdunghisinh
      @anhdunghisinh 3 роки тому

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

  • @karlheber23
    @karlheber23 3 роки тому +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 3 роки тому +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 3 роки тому

      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 3 роки тому +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 3 роки тому +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 3 роки тому +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.

  • @UngattTrann
    @UngattTrann 3 роки тому +183

    This Champion's name was Albert Einstein

  • @ethribin4188
    @ethribin4188 3 роки тому +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 3 роки тому +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 Рік тому +1

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

  • @cynthiathornton5762
    @cynthiathornton5762 3 роки тому +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.

  • @Alias_Anybody
    @Alias_Anybody 3 роки тому +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 3 роки тому +2

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

    • @DecagonPorygon
      @DecagonPorygon 3 роки тому +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 3 роки тому

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

  • @jordanottesen1186
    @jordanottesen1186 3 роки тому +1

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

  • @glenrobinson9963
    @glenrobinson9963 3 роки тому

    Love your thorough experimentation.

  • @premmagar1170
    @premmagar1170 3 роки тому

    Great video!! That's very detailed video indeed

  • @dennisjonker4804
    @dennisjonker4804 3 роки тому

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

  • @3snoW_
    @3snoW_ 3 роки тому +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 2 роки тому +1

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

  • @KeeteleKeet
    @KeeteleKeet 3 роки тому

    Great video!
    Thank you for the info.

  • @NikitaOnline17
    @NikitaOnline17 3 роки тому

    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

  • @buildingman
    @buildingman 3 роки тому

    Always nice to get a new SoL video.

  • @claudius6527
    @claudius6527 3 роки тому +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 3 роки тому +5

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

    • @zerothveratross9975
      @zerothveratross9975 3 роки тому +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 3 роки тому +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 3 роки тому

      @@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 3 роки тому

      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.

  • @miiiiiiiiiiii
    @miiiiiiiiiiii 3 роки тому +1

    Great vid Spirit

  • @Azhureus
    @Azhureus 3 роки тому

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

  • @munsters2
    @munsters2 3 роки тому

    Thank you. That is really useful information.

  • @fastfat08024
    @fastfat08024 3 роки тому

    Awesome content keep it going 😉

  • @TheNezperdian
    @TheNezperdian 3 роки тому

    Amazing video!

  • @Zilto1d
    @Zilto1d 3 роки тому

    Great video!

  • @ramsessiereveld2824
    @ramsessiereveld2824 3 роки тому

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

  • @BrackishBrit
    @BrackishBrit 3 роки тому

    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!

  • @Tocaraca
    @Tocaraca 3 роки тому +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.

  • @marksway57
    @marksway57 3 роки тому

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

  • @3xperiment8
    @3xperiment8 3 роки тому +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

  • @Dsnake5
    @Dsnake5 3 роки тому

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

  • @manendralodhi
    @manendralodhi 3 роки тому

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

  • @Vordikk
    @Vordikk 2 місяці тому

    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.

  • @JoeKnaggs
    @JoeKnaggs 3 роки тому

    Great video, thanks :)

  • @JJBeauregard1
    @JJBeauregard1 3 роки тому +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

  • @OriginalZethrel
    @OriginalZethrel 2 роки тому

    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

  • @Just4Bboying
    @Just4Bboying 3 роки тому

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

  • @Emperor_Hood1994
    @Emperor_Hood1994 2 роки тому

    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 ^^

  • @boejiden1942
    @boejiden1942 3 роки тому

    Well thought out

  • @devangnivatkar2649
    @devangnivatkar2649 3 роки тому +1

    Whoa, this was amazing to know!

  • @shaunroberts2037
    @shaunroberts2037 3 роки тому +4

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

  • @ThmSphone
    @ThmSphone 3 роки тому

    That's why I'm subscribed, nice

  • @marwanbensaud548
    @marwanbensaud548 3 роки тому

    love these details

  • @GarthOJ
    @GarthOJ 3 роки тому +2

    I'm getting really emotionally invested in this champion.

  • @-Raylight
    @-Raylight 3 роки тому +32

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

    • @rao5108
      @rao5108 3 роки тому +5

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

  • @UrukKing
    @UrukKing 3 роки тому

    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.

  • @spockamania
    @spockamania 3 роки тому

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

  • @marcgomez8391
    @marcgomez8391 3 роки тому +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 3 роки тому +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 3 роки тому +3

      How does one "remove" that mechanic?

  • @ananass8030
    @ananass8030 2 роки тому

    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

  • @alastairshaw3311
    @alastairshaw3311 3 роки тому

    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!

  • @roym2185
    @roym2185 3 роки тому

    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.

  • @therealrucleshe7662
    @therealrucleshe7662 3 роки тому

    really enjoyable vid

  • @inwector
    @inwector 3 роки тому

    This is the most satisfying video you have ever made.

  • @Mine4dayzz
    @Mine4dayzz 3 роки тому

    This has really made me appreciate my units more!

  • @Ashasverus
    @Ashasverus 2 роки тому

    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.

  • @blakelivesay
    @blakelivesay 2 роки тому

    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.

  • @andenkiroghan896
    @andenkiroghan896 3 роки тому

    You are so methodic, I love it. Pls make broodwar units analysis, we need you.

  • @ianwong411
    @ianwong411 3 роки тому

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

  • @mauromasterx
    @mauromasterx 3 роки тому

    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

  • @dalemac89
    @dalemac89 3 роки тому

    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!

  • @VraccasVII
    @VraccasVII 3 роки тому

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

  • @nilsp9426
    @nilsp9426 3 роки тому +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 3 роки тому +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 3 роки тому +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 3 роки тому +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 3 роки тому +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 3 роки тому

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

  • @srilemobitelsrile8809
    @srilemobitelsrile8809 3 роки тому +13

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

  • @kartiksaraf4676
    @kartiksaraf4676 3 роки тому +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

  • @d0nutwaffle
    @d0nutwaffle 3 роки тому

    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

  • @jeffreyblack666
    @jeffreyblack666 2 роки тому

    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.

  • @Kieva_Storm
    @Kieva_Storm 3 роки тому

    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.

  • @commanderkeen4971
    @commanderkeen4971 3 роки тому

    I love that everyone of your patreons has a normal name except ILickToesAtNight :-D comedy gold

  • @magpiepicapica1427
    @magpiepicapica1427 3 роки тому

    this fight in the end was beautiful

  • @checktaschu4492
    @checktaschu4492 2 роки тому

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

  • @Xenotric
    @Xenotric 3 роки тому +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 3 роки тому

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

  • @MajoraZero
    @MajoraZero 3 роки тому +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.

  • @legendaryvicius
    @legendaryvicius 3 роки тому

    I see through you Spirit! All the while i was thinking "what is gonna get at here?" and then BUM! Samurai comes into the picture! You just can't help yourself, can you? Lol

  • @zakpodo
    @zakpodo 3 роки тому

    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.

  • @HammerspaceCreature
    @HammerspaceCreature 2 роки тому

    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.

  • @abacaxi.maldoso
    @abacaxi.maldoso 3 роки тому

    Those guys are philosophers! Starter than me!!

  • @ivanstrydom8417
    @ivanstrydom8417 3 роки тому

    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.

  • @inseerlink3511
    @inseerlink3511 3 роки тому

    Nice!

  • @youtubeuser6978
    @youtubeuser6978 3 роки тому

    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.

  • @theonlysoham733
    @theonlysoham733 3 роки тому

    Great video can you do a walk-through on the story mode on hardest difficulty

  • @Sputnik5790
    @Sputnik5790 3 роки тому

    The endscreen Transport Tycoon musik is so nostalgic.

  • @oscarvozzi7548
    @oscarvozzi7548 3 роки тому

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

  • @Badcrow7713
    @Badcrow7713 2 роки тому

    Complete knowledge of Effective HP, good to know

  • @AkosJaccik
    @AkosJaccik 3 роки тому +1

    "I prefer elephants." - Champion, 2021

  • @ChocolateMilkCultLeader
    @ChocolateMilkCultLeader 3 роки тому

    This is soo cool

  • @PowermadNavigator
    @PowermadNavigator 3 роки тому

    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...

  • @AdrickBruno
    @AdrickBruno 3 роки тому

    I thought they might attack based on proximity of my own TC, not the oldest, maybe I'll check that, anyway nice job man