No video

Attack Move logic and Search Radius

  Рет қаралды 75,698

Spirit Of The Law

Spirit Of The Law

Күн бұрын

Another exploration into the secret ways that AoE2 units are excellent decision makers, as well as the weird implications of search radius.
0:30 Unit targeting basics
1:40 Can units account for obstacles?
3:00 It's not just the closest enemy
4:45 Buildings
6:30 Attack move and patrol
7:20 Line of sight and search radius
9:35 Search radius for economic units
___________________________________________________________
Patreon: / spiritofthelaw
Background music from Epidemic Sound: www.epidemicsou...
Game: Age of Empires II Definitive Edition

Пікірлер: 293
@christopherg2347
@christopherg2347 2 жыл бұрын
8:00 The two most common issues in programming are: - Naming things - Cache invalidation - Off by one errors
@dojelnotmyrealname4018
@dojelnotmyrealname4018 2 жыл бұрын
Lol I love it
@stooge_mobile
@stooge_mobile 2 жыл бұрын
Thts genius my man
@christopherg2347
@christopherg2347 2 жыл бұрын
@@stooge_mobile I can not take credit for it, but I do mention it a lot 🙂
@robertlewis6915
@robertlewis6915 2 жыл бұрын
I don't get the joke. BTW you have too many items on that list- you said two, you have three.
@thurlogus
@thurlogus 2 жыл бұрын
Two mistakes + the 3rd point is off by one error. That's a good one m8. 10/10
@iceee420
@iceee420 2 жыл бұрын
I don't even play this game but these are always entertaining
@AngeloFZ
@AngeloFZ 2 жыл бұрын
You're missing out some masterpiece of a game!
@iceee420
@iceee420 2 жыл бұрын
@@AngeloFZ clearly, just not enough hours in the day for me
@saf23303
@saf23303 2 жыл бұрын
@@AngeloFZ 20 years man, 20 years
@veebuk8522
@veebuk8522 2 жыл бұрын
Same
@Abhishek-hs8zi
@Abhishek-hs8zi 2 жыл бұрын
Once you into it you never get bored of it doesn't matter how many matches you played
@mileoinc9337
@mileoinc9337 2 жыл бұрын
So does this mean that the Franks extra line of sight on Knights causes them to get hung up less and find proper targets in enemy towns more often? Cause that might make their team bonus a bit more valuable than what it appears at face value.
@genericpersonx333
@genericpersonx333 2 жыл бұрын
Something to bear in mind is that there are fewer bottlenecks in the processing potential of Age of Empires 2 Definitive Edition than existed in 1999 when Age of Empires 2 came out. 1.) CPUs are far more powerful these days, ensuring you can afford to commit more calculations per second to each entity AI. 2.) You don't have a hard-cap on internet speed potential like you had in the age of Dial-Up modems (56.6k), so you don't have to limit the data flow to allow functional online multiplayer anymore. 3.) The ratio of processing power required to run AOE2:DE's graphics is far better than it was in 1999 when you didn't have GPUs as standard in all computers and processing power overall lower. AOE2 used to have to commit more CPU to rendering the pixels, so fewer calculations could be committed to AI. 4.) The present AI is able to build iteratively on older AI scripts and more complex calculations coded with confidence than before. If a mistake is made, it can be patched in moments over the internet. It can be tested more quickly for bugs with more effective data collection than ever before. Because the old scripts are available for reference and a script-writer can talk to almost any other script-writer within moments using network communications like email or texting, it is much easier to develop new scripts than having to make everything entirely on one's own. As Sandy Petersen notes, much of the original AI was basically him, not a dedicated coder, writing miles of "If A, then X scripts." Much of the reason he did that was the code had to work nearly bug-free before they printed the CDs, because once printed, they either had to print new CDs with fixed code or you spent possibly hours downloading them over internet that was not universally available. You wanted AI scripts to be simple and easy to proof-read. You only had a small team of developers doing everything, often from scratch because they were the first to make this thing. Heck, even the computers they were using were much slower in every way, so just getting started on writing scripts often meant waiting five minutes for the PC to boot up! Long and short, appreciate the marvels of modern technology and how AOE2:DE's development team has managed to use modern technology to make the game better without losing game's soul in the process!
@wansdich
@wansdich 2 жыл бұрын
I suspect the 1 tile larger search radius would be for large group of units patrolling. Imagine you send a dozen of pikemen on patrol/attack move. there is a group of knight sitting right at the edge of their line of sight radius on the way. if they don't see them, oh well, the pikemen will still continue. But if you catch just a glimpse of them, if you DON'T have that feature, only the pikemen at the edge of your group will go and attack, which would weaken them a lot for the fight. However, with this, as soon as they see them, a better chunk of them will go for the attack. I don't know if it was intentional, but if it was, I think that's why.
@KalinGames
@KalinGames 2 жыл бұрын
10:17 Interestingly the shepherds and the hunters took a couple of seconds to start waking. That specific check seems to be slower then the rest, maybe to not be as intense on the server? Very good video m'man
@Runescapeman818
@Runescapeman818 2 жыл бұрын
As a very active player, you often forget how Incredibly complex this game actually is and how much work the devs have been putting into this masterpiece starting over 20 years ago and even up until now ❤️ Yes there still are some flaws that should not be kept secrets, but nonetheless we as a community should appreciate the game for how well all these little mechanics and calculations work in real time ❤️
@kylethompson8348
@kylethompson8348 2 жыл бұрын
best game ever
@ChocolateMilkCultLeader
@ChocolateMilkCultLeader 2 жыл бұрын
The way Spirit always eliminates hidden variables is masterful
@smudassarh97
@smudassarh97 2 жыл бұрын
I play this game for almost 18 years now and there are still soo many things I nvr thought existed... That's the reason I love this game 🔥
@Yamaazaka
@Yamaazaka 2 жыл бұрын
I like intentionally not selecting all my units and manually clicking on the TC to attack, when the rest of my army is still on attack move aggressive in the area for villager cleanup
@jefffinkbonner9551
@jefffinkbonner9551 2 жыл бұрын
Yeah I feel like cleaning up all those loose villagers before they slip away is way more important than razing the TC. It's easy to come back to it and finish it off. Villagers can garrison in other buildings or run off and reboom.
@johncouzens5321
@johncouzens5321 2 жыл бұрын
Just before we get right into this, wanted to express happiness at new sotl vid.
@FacundoTupac
@FacundoTupac 2 жыл бұрын
:)
@annaairahala9462
@annaairahala9462 2 жыл бұрын
4:55 small correction, rams will auto-target other rams as well. I'm not sure if this i just rams or all siege, I think it does for trebs too but I'm not sure
@Tocaraca
@Tocaraca 2 жыл бұрын
Rams automatically attack other rams and also other trebs. Trebs automatically attack other trebs too, but not any other unit
@rodrigotolosa590
@rodrigotolosa590 2 жыл бұрын
Could it be that the line of sight stat takes into account the tile the unit is standing on and the search radius doesn't? 4 tiles of line of sight would be your tile + 3 tiles. 4 tiles of search radius would be your tile + 4 tiles.
@SpiritOfTheLaw
@SpiritOfTheLaw 2 жыл бұрын
That would make a lot of sense, but if you test it, a 4 tile line of sight unit reveals the tile they're on plus 4 more in each direction (eg. the knight at 8:45). A search radius of 4 finds units 5 tiles away from their patrol tile (eg. 8:00). It's very peculiar.
@yuven437
@yuven437 2 жыл бұрын
@@SpiritOfTheLaw they can probably hear the extra step :'D
@Thescott16
@Thescott16 2 жыл бұрын
@@yuven437 Spirit's voice has the Morgan Freeman effect; you can hear him reading words just by thinking that he's reading the words.
@Garryl367
@Garryl367 2 жыл бұрын
@@SpiritOfTheLaw Could it be some sort of shared ally alert system? When you placed the house and outpost to reveal the champion near the patrolling knight, was the champion within their search radii?
@rodrigotolosa590
@rodrigotolosa590 2 жыл бұрын
@@SpiritOfTheLaw Then I'm at a loss. AoE2 coding sometimes feels like it was made by people who were working in different offices and put together their work 5 minutes before shipping the game.
@T-West
@T-West 2 жыл бұрын
I think Search Radius also affects the distance at which Monks maintain their conversion while chasing units. You can see units briefly leave a Monk's 9 line of sight but remain within the Search Radius of 11, then the Monk can get a "fast" conversion if he catches up to the unit.
@shnoogums1
@shnoogums1 2 жыл бұрын
The half tile attacking is probably because they round the tile distance to a whole number
@mscbijles1256
@mscbijles1256 2 жыл бұрын
Then it would be interesting to investigate whether it’s rounding or flooring the number!
@MaxRavenclaw
@MaxRavenclaw 2 жыл бұрын
Yeah, I was guessing that they just only count whole tiles instead. The weaker units were still technically in the third tile from the knights.
@Captain1nsaneo
@Captain1nsaneo 2 жыл бұрын
Was just about to post this. Probably a property of what's holding the number in the code.
@gibbeldon
@gibbeldon 2 жыл бұрын
But in the previous test being half a tile closer was already enough to always prefer that unit. And it doesn't work if they are any further away. So neither rounding nor flooring can be the whole answer here.
@johnfist206
@johnfist206 2 жыл бұрын
@@gibbeldon theory: Units select target in the following priority: 1: Closest unit(s), rounded to an integer number of tiles 2: Of the above, select unit(s) that would make the easiest kill 3: Of the above, select the closest unit, not rounded. In other words, the unrounded numbers are only used if there are still multiple possible targets after the second priority. This is only my hypothesis for an explanation
@HistoricalWeapons
@HistoricalWeapons 2 жыл бұрын
Man I dunno how long we can play aoe2 before the world ends
@XtReMz98
@XtReMz98 2 жыл бұрын
Ladies, to summarize whar SotL said, if you are soft, weak and in close proximity, you will attract a knight in shining armor. Follow SotL for more dating tips.
@Trojanponey
@Trojanponey 2 жыл бұрын
lol your closing song is the most Canadian thing I've ever heard. I feel like I'm driving through Alberta when I hear it.
@padam_hussein8952
@padam_hussein8952 2 жыл бұрын
A few thoughts/ questions: - When a unit 'picks' it's next target, it doesn't appear to re-choose unless that target dies / exits your COMBINED LOS, even if another weaker/closer target appears - Do units take into account speed or movement direction when 'choosing' new targets? I don't think so - How do gold/stone miners/lumberjacks walk seemingly large distances once they've depleted their resource. Is their search radius massive? - How does it work with boars, i.e. you can be outside the boars search radius but inside GAIA's LOS and it'll still attack. I think that works with units, once they lock on, unit has to leave combined LOS...
@ArawnOfAnnwn
@ArawnOfAnnwn 2 жыл бұрын
- They don't re-choose, and in fact don't re-assess their choices at all when already on the move somewhere, because if they did we'd have endless bugs with units just spinning in place all the time during battles. Afaik the only thing that makes units reconsider their choices midway without player input is Defensive Stance and LoS, both of which makes them stop, not re-choose. - Nope. - I think Spirit already has a video about this, but I'm not sure. It was a long time ago, and about unit (or just villager?) pathfinding. - Unit behavior is mostly determined by their individual attributes rather than that of the players overall. Should be the same for Gaia.
@alexstewart9592
@alexstewart9592 2 жыл бұрын
Aggressive Gaia units have increased search radius for specifically Villagers if the AI difficulty is higher than Standard, and this makes that setting have an effect even if there are no proper AI players on the map (note that Gaia units are otherwise unaffected in both stats and quantity).
@itsrudetostare673
@itsrudetostare673 2 жыл бұрын
Just wanted to say how much I love these vids Spirit. I havn't played AOE2 for about 12 years but there's just something about these vids that makes my day, I can't get enough of the civ breakdowns.
@unearthlyenemy
@unearthlyenemy 2 жыл бұрын
this video and those numbers just proved that this game was hardcoded to be fun
@forsakenquery
@forsakenquery 2 жыл бұрын
That cleared up so many minor frustrations and turned them to respect
@elliejohnson2786
@elliejohnson2786 2 жыл бұрын
0:45 how did that hawk flip? I thought hawks never changed direction
@davidturner5285
@davidturner5285 2 жыл бұрын
When you said there was one unique unit that has a large search but a small LOS… I was waiting for the Japanese samurai of course
@dojelnotmyrealname4018
@dojelnotmyrealname4018 2 жыл бұрын
I kinda wonder if the unit specifically calculates how long it'll take to kill the unit, rather than just how strong/weak the unit is, in making a decision. Like, INCLUDING travel time.
@TheEamz
@TheEamz 2 жыл бұрын
This is exactly what I was thinking...
@AlessAbreu
@AlessAbreu 2 жыл бұрын
Thanks for answering the questions I never asked and get amased by the original AoE2 devs
@SRNF
@SRNF 2 жыл бұрын
Wife "Why are you still up playing that empire game" Spirit "Playing? GAME?! This is real life to me !"
@johnornelas
@johnornelas 2 жыл бұрын
i watched a real fascinating video about how starcraft 2 units searched for enemies around them. they didn't just check everything in range, they sent out like a pulse wave that started at the center of the unit and made its way outward in a ring. this meant that a unit could be in range to attack, but your unit wouldn't start attacking if their search pulse was still close to your unit. This added a bit of randomness to which unit would attack first if both came into range at the same time. it also did a bunch of other cool things, like making groups of units not all shooting at the same target in big team fights. its just cool to see how much thought goes into all these things most people dont even notice.
@DjAtmaWeapon
@DjAtmaWeapon 2 жыл бұрын
All your vids make me feel bad about stopping playing AOE2 in 2016, I should start again.
@Altarknight
@Altarknight 2 жыл бұрын
keep going man! you are the only Content creator where i cant say nothing bad , or troll , is just love your videos! and plus they all time give a lot info the game what i still play (max 1-2 hour /day)
@mikelivingood7797
@mikelivingood7797 2 жыл бұрын
Outstanding video, so inciteful. Please keep up the great work.
@CyberHak
@CyberHak Жыл бұрын
Line of sight should be much larger for everything to make it more realistic, while still maintaining the differences between civs. That said, it's nice how much is going on. Thanks for sharing.
@theOGSG
@theOGSG 2 жыл бұрын
Very unique topic. Well done
@PauxloE
@PauxloE 2 жыл бұрын
For the "they take their pathing into account when picking a target": could it be that they are just going towards the nearest unit, but when they on the way get nearer to another unit, switch target then? (This should be possible to test by having the second-nearest unit in the other direction.)
@chingamfong
@chingamfong 2 жыл бұрын
I believe they don't do path finding calculation while on the way. Which is reasonable since having all units search for targets all the time is very computationally intensive.
@xarin42
@xarin42 2 жыл бұрын
2:43 this version of the test would result in them spinning circles if they did path finding while on the move while trying to go towards the nearest target. other similar obstacles in actual maps could cause similar problems in that case.
@watchman835
@watchman835 2 жыл бұрын
No, codings are done in a modularised way, so writing code saying based on “travelling distance” is not that difficult.
@gravity8120
@gravity8120 2 жыл бұрын
For the Siege Ram example, it means that the Knight would change his mind about which Champion to go for midway if one of the Siege Rams initially blocking his path to the top-left Champion got destroyed. Or if the Rams were moving and bumping against eachother, the Knight would constantly be calculating "There's a gap between them I could run through and-- oh no there's no gap anymore...no wait there is!...It's gone again again" etc.
@ajbdkla3652
@ajbdkla3652 2 жыл бұрын
So cool that the villagers have different search radius by job!
@MadnessTW
@MadnessTW 2 жыл бұрын
Knowing that there's a separate search radius is really helpful. Now I don't have to wonder why my fishing ships and builders appear to be geniuses and just so much more self-reliant than any of my military. Thanks.
@BleachFan2588
@BleachFan2588 2 жыл бұрын
This brings up a few new questions: When do units re-prioritize? How far will they chase an equally fast unit running away, as closer units pass them by? Or what if the distance changes by, for example, rams moving in the way creating a longer path? And a question regular players likely know the answer to: how do units react to getting attacked from outside their LoS? And is this different from outside their search radius?
@markus5507
@markus5507 2 жыл бұрын
9:58 damn, that was smooth
@niklaswulff2474
@niklaswulff2474 2 жыл бұрын
Man I love your videos. Even thoug this probably has limited practical relevance it's amazing to take these courses at your AOE2 academy!
@hbarudi
@hbarudi 2 жыл бұрын
So this code is why the ai prefers to walk around my paladins and to the archers behind them.
@henke37
@henke37 2 жыл бұрын
It smells like the priority list is more using a scoring function than a series of priorities. The distance has the greatest scoring factor, while killing time has a lower scoring factor.
@oliverwilson11
@oliverwilson11 2 жыл бұрын
It would be nice if when you tell an army to attack move, it reduced the search radius of all units in the army to the lowest search radius out of all those units until they either complete the order or enter combat. Sometimes I will attack move an army across the map and then find out that my archers are stuck on a building while my knights have charged in and died to pikes.
@hommhommhomm
@hommhommhomm Жыл бұрын
2:45 it's probably using the D* algorhitm where it searches in all directions and stops when first one is found, considering multiple targets if they are at equal distance. So there's no need to run A* to each target ;)
@anwyl42
@anwyl42 2 жыл бұрын
I doubt they check pathing distance between each pair of units. They probably use the tiles to run a breadth first search bounded by search radius which kinda flows pathfinding out from the unit until it finds a distance with enemy units. Once it finds tiles with units it checks which ones are best targets, then if there's still a tie uses distance within the tile. The key difference would be that checking against all units in the area would take processing time proportional to the square of the number of units, where BFS would be linear.
@DariushMJ
@DariushMJ 2 жыл бұрын
Exactly my thought
@tshddx
@tshddx 2 жыл бұрын
That could also explain the "half-tile wiggle room." If there is one enemy 2 tiles away and another enemy 2.5 tiles away (and no closer enemies), and the BFS is simply finding all units between 2 and 3 tiles away and first comparing their strengths, you'd see exactly what we do see. It should be easy to run the same test with enemies 2.5 tiles away and 3 tiles away and see if that "wiggle room" disappears (I suspect it will).
@ceroenblanco
@ceroenblanco 2 жыл бұрын
As a wanna be game developer and a rts fanboy I want to say thank you... This is better than videogame school xD
@datirishboyo
@datirishboyo 2 жыл бұрын
This is the content I subscribed for
@killyekfael4909
@killyekfael4909 2 жыл бұрын
The year is 10191, and Spirit of the Law has no more video about ages of empires 2 to publish.
@jokitlueng4468
@jokitlueng4468 2 жыл бұрын
Thank you SOTL for making these videos! Here is an interesting idea following along with the unit attack logic. I'm wondering how the guard stance works for melee/archer units when combined with aggressive/defensive/stand ground stance as compared to simply using the petrol/attack move command. Does the unit stuttering/bumping issue increase or decrease when microing once before the battle and also when microing a lot (over microing) during the battle. I find lots of resources on comparing petrol and attack move, but only very few videos studying guard stance in-depth.
@PCgamer238
@PCgamer238 2 жыл бұрын
7:45 While tinkering, I noticed that "marco polo" doesn't work the same way "All Explored" setting does. What I mean is, if you "marco polo" the map, you can't build in fog of war as if it was still visible to you, whereas if you play with "all explored" map setting, you can build anywhere right from the get go. Is unit line of sight/search radius also tied differently to "all explored" map setting? I don't know if I'm making sense, but that's the best I can describe it lmao. Unrelated, but it's actually very annoying because I can't sometimes conveniently test editor scenarios because of invisible fog of war building restriction.
@GarkKahn
@GarkKahn 2 жыл бұрын
Yeah the fow is gone for you with the cheat code, yet not for the units/buildings
@kemosonicfan123lbp
@kemosonicfan123lbp 2 жыл бұрын
if you marco polo and check statistics, your "Map Explored" won't be 100%
@michalszymanski5796
@michalszymanski5796 2 жыл бұрын
You might be onto something here because the game might distinguish between an explored tile vs one you can see. It would depend on how the game is programmed but it would be possible for that behavior to exist.
@Tpoleful
@Tpoleful 2 жыл бұрын
This is a legacy feature from Aok. I was an avid cheater and it was always frustrating for me since I often couldn't tell where I could build.
@Flababoo
@Flababoo 2 жыл бұрын
Awesome content as always. Thanks SotL
@light_david7
@light_david7 2 жыл бұрын
3:00 wow, the kid on the right is so brave, he is playing on normal exploration! (as opposed to my self on the left)
@shadowwind18
@shadowwind18 6 ай бұрын
@Spirit Of The Law, is the only difference between patrol and attack move, the fact the units are patrolling? I wouldn't be surprised if there were some minor deeper differences and would be interested to have that content included in a video soon.
@EliasHasle
@EliasHasle 8 ай бұрын
The results of the tests starting at 1:52 can also be explained by retargeting while on the way to the nearest enemy unit. The prioritization of weak units at slightly higher distance could indicate that there is some objective function that weights distance more than hits to kill, rather than an absolute preference for distance. Is the search radius the same for attack move and patrol? And how does it interact with stances? In an ideal world, I would like defensive stance to never deviate more than five tiles from its patrol route to pursue enemies, and stand ground units on patrol should never leave their route at all.
@nicolasojedamora
@nicolasojedamora 2 жыл бұрын
That Airplane! reference is pure gold
@mohitmishra2713
@mohitmishra2713 2 жыл бұрын
The Devs were waaay ahead of their time!
@Dankey_King
@Dankey_King 2 жыл бұрын
What is the process for gold/stone miners and woodcutters, seems they can find resources much further away, as long as they were scouted earlier?
@gravity8120
@gravity8120 2 жыл бұрын
Perhaps what the units are doing isn't simply choosing the closest target, but rather they're choosing the target that they can defeat the quickest (which usually is the closest, but with a Villager/Arbalester half a tile away, the Knight can still defeat them quicker than they could a Champion despite the extra travel distance). I can't remember if this was tested in the previous video about target prioritisation, admittedly.
@jemand8462
@jemand8462 2 жыл бұрын
I wish they would implement a function where you can predetermine, which unit type attacks which other unit types. For example tell the skirmishers that if they see archers, they should attack them instead of huskarls.
@Zyhmet
@Zyhmet 2 жыл бұрын
Possible reason for Villagers being attacked while being .5 tiles farther away My guess is that the distance is calculated and the result rounded. If they calculated it in float then they couldnt compare it to equality (never compare floats to each other for equal) So they round it first to the next int, and only then compare on equal. After which they look for the best target. A test that would proof that would be to see what happens soldier: 2 tiles away - vil: 2.5 -> attack vil soldier 2.4 - vil: 2.6 -> attack soldier if its just some wiggle room, then this shouldnt happen. If it is a round() then this happens soldier 1.6 - vil: 2 -> attack soldier
@harshawardhanthopate487
@harshawardhanthopate487 2 жыл бұрын
The deer kindly co-operated
@parag1489
@parag1489 2 жыл бұрын
To be specific it looks like they are using a floor function on the path discretized by tile. floor(2.9)=2 Compute floor distance, select the week unit.
@nicolasmolina7202
@nicolasmolina7202 2 жыл бұрын
This blew my mind
@laservsvecchiette
@laservsvecchiette 2 жыл бұрын
When I tell a scout to attack a villager, it automatically swtiches to attack the closest one. I noticed this happening mostly with scouts Vs villagers during feudal rushes. I do not know if it happens to others, but it looks like to me the searching routine does keeps working
@Memphisko
@Memphisko 2 жыл бұрын
Also happens with militia rushes. It is infuriating because low hp vills have a chance to escape you, because your scouts/militia keep changing targets despite your direct orders. Argh!
@Tocaraca
@Tocaraca 2 жыл бұрын
The last patch added a feature to circumvent this, the ctrl+click mechanic, that makes your unit(s) always go for the unit you targeted no matter what
@Memphisko
@Memphisko 2 жыл бұрын
@@Tocaraca wonderful, thanks!
@bluesight_
@bluesight_ 2 жыл бұрын
I think you have to right click + Control key to make units attack an exact target
@GunsoftheArchangels
@GunsoftheArchangels 2 жыл бұрын
We gotta get T-West to look at the source code. I wanna see some of the programming logic behind all this!
@sheepsy90
@sheepsy90 2 жыл бұрын
You can check A* algorithm which combines distance and grid search.
@scout4996
@scout4996 2 жыл бұрын
Rise of nations has a pretty interesting stance system, where alongside offensive defensive stand ground, there's also two more to give priority to units or buildings. I wish aoe2 had something similar. They already took the autoexplore from that game as well so
@Ratciclefan
@Ratciclefan 2 жыл бұрын
Yeah I agree I also wish changing trebs to no fighting stance didn't make me have to manually pack, unpack, and attack every time I want to keep a building and destroy others.
@gregsadler968
@gregsadler968 2 жыл бұрын
Can you do a video on how worth it is to tower an enemies tree line? Taking into account the cost of the tower, idling your villagers and how much idle time you force.
@Fr33zerg
@Fr33zerg 2 жыл бұрын
With the distance, I think it is something else going on. Unit calculates its DPS, and tries to keep it high at all times. It's not that they prefer the closer enemy, it is that BECAUSE the enemy is closer it helps them get to them quicker, thus increasing the potential dps done. If the more squishy target happens to be nearby (you can try modding it with bonus damage against various units), they should deriviate even more from the normal path, just to apply this extra damage
@CG-eh6oe
@CG-eh6oe 2 жыл бұрын
It surely is not about DPS, because increasing the HP (which does not alter DPS) did make them change targets.
@Fr33zerg
@Fr33zerg 2 жыл бұрын
​ @C G It is, because it is directed towards dealing the most percentage health damage, not flat damage. I can't believe you missed this
@CG-eh6oe
@CG-eh6oe 2 жыл бұрын
@@Fr33zerg WEll thats not DPS then. Not my fault you're using a common expression wrong.
@Fr33zerg
@Fr33zerg 2 жыл бұрын
@@CG-eh6oe Not my fault you can't grasp simple concept immediatelly, and I need to explain it to you especialy. It's not the wording that is wrong, it still calculates dps.
@TWITCH.JAVASAR
@TWITCH.JAVASAR 2 жыл бұрын
Is there something about adding Ctrl to a click to make units favor units over buildings or something like that?
@Clairvoire
@Clairvoire 2 жыл бұрын
The distance calculation probably matters a lot more in melee fights when the distance to multiple targets around you is effectively 0 or close to 0. Having the distance truncated is likely just a way of letting that preference also work when they're 1 tile away too, and isn't meant to matter much beyond that I imagine?
@Greywander87
@Greywander87 2 жыл бұрын
I wonder if the "attack the closest enemy" is doing some shenanigans with converting floats to integers, in which case _I think_ something that was 2.9 tiles away would round to an integer of 2. Some things you might do for further testing: - Push a weak enemy like a villager as far away as possible, but keeping it less than a full tile beyond the other, strong units. - Try putting a really tough unit (e.g. 9999 HP) closer and a really weak unit (e.g. 1 HP) a bit farther; maybe it's figuring in travel time to the time it takes to defeat the enemy. - Try putting very similar units (e.g. two archers, but one with one extra HP) at slightly different distances, to see if it prefers targeting the weaker one even if half a tile further away.
@GummieI
@GummieI 2 жыл бұрын
Yeah I was thinking the half tile would maybe be because it included the travel time in the calculation in the TTK for the units, I wish he had dug a bit deeper there)
@arnavnandan
@arnavnandan 2 жыл бұрын
Spirit: Bodkin arrow Captions: Vodka arrow
@Pierre-Jonqueres
@Pierre-Jonqueres 2 жыл бұрын
Yeah, I actually realized pretty fast without all your precisions and your data that the targeting and pathing of the AI with what the engine was proposing as tools were quite smart and good. But not for range units, they still overkill units one by one, having ridiculous situations of 50 longbowmen targeting the same skirmisher before all targeting the same next one and so on ^^
@Pierre-Jonqueres
@Pierre-Jonqueres 2 жыл бұрын
8:35 I suspect the search radius doesn't count the tile the unit is on turning it to line of sight +1
@thomaspaine7107
@thomaspaine7107 2 жыл бұрын
It's kind of crazy to think about how much of this knowledge the top players intuitively have through experience, regardless of their ability to articulate it outside of gameplay. Like a musician who doesn't know music theory, or a home cook who doesn't know what the maillard reaction is.
@camfunme
@camfunme 2 жыл бұрын
I assume it is rounding / flooring the path distance to the nearest tile. This would explain the half tile + weaker target priority behaviour.
@elliejohnson2786
@elliejohnson2786 2 жыл бұрын
I have a few questions related to some specific things I noticed: 1. How long do units chase their target for? For instance, if I have a a unit within 2 tiles and other units around it at 2.5 tiles, they knight will attack the 2 tile unit. If that 2 tile unit is extremely fast and runs away immediately, does the knight continue to give chase? Do they give up once it leaves line of sight, or search radius, or do they keep going forever? 2. Search radius seems to almost consistently increase by 1 tile, but units also take up roughly kind of vaguely 1 tile. Is it possible that search radius is from the edge of the unit's hitbox, rather than the unit's starting position? If so, would a unit with hitbox diameter 3 have an increased 1 tile search radius, looking for units 1 tile further away than a comparable unit? I have no idea how to modify this specific value, so I have no way of testing it or suggesting a test. Elephant hitboxes still only stay within 1 tile.
@ArawnOfAnnwn
@ArawnOfAnnwn 2 жыл бұрын
The answer to your first question is determined by the units' Stance. On Aggressive stance they'll chase indefinitely as long as the unit stays within their Line of Sight. But yes, if it leaves Line of Sight they'll stop. On Defensive, they chase it for a certain number of tiles (forget how many) from their starting location, and if it's beyond that they won't continue - AND will return to where they were. Of course Stand Ground means they only attack units in range (just 1 tile for melee units) and No Attack means they won't attack.
@alligatorjack2583
@alligatorjack2583 2 жыл бұрын
Great video, thanks a lot, Spirit of the Law! :)´
@Yamaazaka
@Yamaazaka 2 жыл бұрын
Very helpful vid!! ty
@stephen6272
@stephen6272 2 жыл бұрын
It would be so easy to have the units not do pathing when there is a huge 4v4 battle. It's crazy that they do that, that would obviously destroy the framerate. I wonder if they turn that off when there is a big enough pop... but it seems likely that that is the explanation. And it could be so easily fixed.
@MagnumForce51
@MagnumForce51 2 жыл бұрын
A bit unrelated to the topic of this video but you mentioned patrols. I noticed I could shift key in multiple patrol way points (much how one does waypoints for when having a unit go somewhere) to have my armies go on more complex patrol routes but I noticed for this to work, I have to hit escape after I place the final way point else it cancels and only patrols to the first way point. (I'm referring to AOEII DE when I speak about this FYI). Is this an intended feature, or is shift key way pointing patrol points an unintended feature due to unexpected combination of several hotkey/UI elements? Could one do anything useful with more then the usual 2 patrol patrols or is it better to just keep to the usual 2 patrol way points I've seen most people using?
@Iqdppb
@Iqdppb 2 жыл бұрын
I wonder what would happen if you make attack move finding a non defensive building, and then an enemy vil builds a defensive one within the unit's search radius, being the vil out of sight. Will it change to the foundation? And when he approach it and sees the vil?
@khankhomrad8855
@khankhomrad8855 2 жыл бұрын
It all depends on how the AI Logic for re-targeting works. If the priority list that Spirit shows is recalculated whenever a new target pops into range, than it would be natural for the unit for re-target from the non-defensive building to the defensive building for two reasons: 1) The foundation will be considerably weaker than the building that is already under attack (9/10 times); 2) Defensive buildings have a higher priority than non-defensive so it will see that there is a higher priority target nearby and re-target. Question is: Does the Logic differentiate between completed building and foundation?
@sergeantcrwhips9437
@sergeantcrwhips9437 2 жыл бұрын
but defesive and aggressie stance also factor into this it seems, if there is a unit just at the edge of the line of sight, but the unit is on defensive, it wont engage, but it would on aggressive
@michaelandreipalon359
@michaelandreipalon359 2 жыл бұрын
1:51: Looks like somebody watched and played a lot of Airplane! and Call of Duty 4: Modern Warfare. 10:00: Bye-bye, guiding font. 10:25: Bless that willing deer.
@brotendochill7053
@brotendochill7053 2 жыл бұрын
@spirit of the law If you think time as a function of dmg output and distance, couldn't it be that "as a military unit, I'll target the unit I can take down in the shortest time"? Doesn't seem to apply to buildings, maybe buildings are another function(?)
@TerahAsh
@TerahAsh 2 жыл бұрын
I wish you were doing this for AoE 3 DE.
@gokhanY
@gokhanY 2 жыл бұрын
2:31 that knight is smart.
@lideruploader6577
@lideruploader6577 2 жыл бұрын
AMAZING LEARN 🤓
@derelbenkoenig
@derelbenkoenig 2 жыл бұрын
How does the unit stance affect the behavior with patrol and attack move? I've noticed that archers patrolling on stand ground will stop to shoot but not deviate from their path to get into range. But I haven't figured out if patrol (or attack move) on aggressive differs from patrol on defensive
@SSRisk007
@SSRisk007 2 жыл бұрын
I'm not sure about archers, but something I notice is when patrolling in defense mode the unit will return to the patrol path after deviating some distance, and when the unit is on aggressive they keep attacking unit after unitl despite the distance, but it would be good if SoTL shows how they behaives
@dragovern
@dragovern 2 жыл бұрын
will need to test with magyars extra LOS
@VarenvelDarakus
@VarenvelDarakus 2 жыл бұрын
crazy how much effort they put into this game , considering how many devs these dats doing half ass jobs with relesing really buggy/unfinished games
@Fyrgon
@Fyrgon 2 жыл бұрын
But what about attack, defence and stand ground stances? Are those different when choosing targets or attacking close by targets? :) Thx for the great video
@namshimaru
@namshimaru 2 жыл бұрын
Impressive
@ruludos1977
@ruludos1977 2 жыл бұрын
I wonder how difficult/useful a "use simpler ai" toggle would be for those massive post-imp trashfires?
@daveralph123456
@daveralph123456 2 жыл бұрын
Hypothesis: Unit targeting attempts to find the unit with the minimum combined travel-time + combat-time within the search radius Experiment: Are faster moving units more willing to travel further to reach a weak unit than slower units?
@CG-eh6oe
@CG-eh6oe 2 жыл бұрын
Pretty obviously wrong, as elephants would be always ignored then - no matter how far other targets are, combat-time vs ele is so high it wont matter.
@ayushtiwari2959
@ayushtiwari2959 2 жыл бұрын
man aoe2 is so well designed
@XmrdX
@XmrdX 2 жыл бұрын
Does this also somehow explain why units so easily lose focus on kings they are ordered to attack?
@khankhomrad8855
@khankhomrad8855 2 жыл бұрын
Kings are 75HP and 0/0 so they should be what? mid priority for most targets? The only things easier to kill than a king for most units would be pikes, monks, vils, archers and skirms.
@WyattGoslingIsCool
@WyattGoslingIsCool 2 жыл бұрын
For the scenario at 3:28: Is it always a half tile distance? If you moved the champions to be twice as far away, would the villagers have that extra half tile buffer or would they get a full tile buffer?
@danielscott4349
@danielscott4349 2 жыл бұрын
10:24 That deer is the G.O.A.T.
@rjskrobola
@rjskrobola 2 жыл бұрын
Dude no, it's a d.e.e.r.
@ehk5948
@ehk5948 2 жыл бұрын
Did SotL ever make a video about fishing traps and how to do them efficiently?
@omargoodman2999
@omargoodman2999 2 жыл бұрын
Is it possible that those first two items in the priority list, pathing distance and time-to-kill, are actually one item: time-to-reach-and-kill? It may be calculating how many seconds it would take to kill the target, including travel time to it, which can lead to rounding errors.
@Jondiceful
@Jondiceful 2 жыл бұрын
I'm getting to this video 23 hours late. What can I say? Except that it has only now entered my LOS.😜
How good is the Saracen market bonus?
9:54
Spirit Of The Law
Рет қаралды 105 М.
Why is it so hard to place TCs??
11:12
Spirit Of The Law
Рет қаралды 196 М.
Nurse's Mission: Bringing Joy to Young Lives #shorts
00:17
Fabiosa Stories
Рет қаралды 4,6 МЛН
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
Are Poles and Bohemians too strong?
11:33
Spirit Of The Law
Рет қаралды 143 М.
Do You Have to Build Extra Town Centers? ft. Hera
20:01
Spirit Of The Law
Рет қаралды 256 М.
Defensive Stance, Guard, and Follow: What's the difference?
13:06
Spirit Of The Law
Рет қаралды 114 М.
Trample, Splash, & Blast Damage: What's the difference?
9:43
Spirit Of The Law
Рет қаралды 128 М.
AoE2 Eco Upgrades
13:46
Spirit Of The Law
Рет қаралды 257 М.
Should You Garrison Archers In Towers?
11:15
Spirit Of The Law
Рет қаралды 722 М.
Why does late game suck?
23:53
Lemon Cake
Рет қаралды 358 М.
Someone Dead Ruined My Life… Again.
21:32
CGP Grey
Рет қаралды 8 МЛН
How Good are Longboats? (AoE2)
10:55
Spirit Of The Law
Рет қаралды 147 М.
7 Fates Worse Than Death You Gave Your Unlucky Enemies
12:29
outsidexbox
Рет қаралды 3,1 МЛН