No video

(PATCHED) The Curious Mystery of Walls' Villager Distribution in AoE2

  Рет қаралды 125,651

Hjörleif - Age of Empires 2

Hjörleif - Age of Empires 2

Күн бұрын

In this video I investigate and find out what is actually the key to perfectly balanced villager distribution to absurdly long quickwalls in AoE2 and the reasons for why it doesn't work when it doesn't work as well as the reasons for why it does work when it does work.
Table of content
00:00 Intro
00:40 Hypothesis 1: Creation Order
01:00 Hypothesis 2: Selection Order
02:12 Hypothesis 3: Placement Order
02:36 Conclusion
03:28 Outro
Age of Empires II © Microsoft Corporation. This video was created under Microsoft's "Game Content Usage Rules" using assets from Age of Empires II and Age of Empires II: Definitive Edition, and it is not endorsed by or affiliated with Microsoft. www.xbox.com/en-us/developers... Leave a tip to show support for more content: streamelements.com/hjoerleif/tip

Пікірлер: 98
@Hjoerleif
@Hjoerleif 7 ай бұрын
Developers patched this behaviour in update 81058 (April 11, 2023): kzfaq.info/get/bejne/ntF8e8l7nMuzmIE.htmlsi=KgSxs5O4fTxjf8yH
@IAmBael
@IAmBael Жыл бұрын
In a more technical sense, the villagers are stored in an array upon group selection, starting at index 0. When the walls are drag-placed, they too are stored in an array, and the villager at index 0 of the villager array will build the wall piece at index 0 of the wall array, villager 1 will build wall piece 1, and so on. So what we're answering here is what order the units are stored in said array. 😊
@valk_7233
@valk_7233 Жыл бұрын
Oh a fellow computing engineer 👋
@RebekahParkhurst
@RebekahParkhurst Жыл бұрын
This is the most straightforward interpretation for sure! Next question is: when there are more walls than villagers, or more villagers than walls, how does the indexing work for the overflow?
@nickclassicno1012
@nickclassicno1012 Жыл бұрын
Is it concurrency programming ?
@MikeWasteland
@MikeWasteland Жыл бұрын
@@RebekahParkhurst The villagers are evenly distributed along the wall. Try it!
@fcbole6983
@fcbole6983 Жыл бұрын
@@MikeWasteland ok let's say 5 villagers along an 8 tile wall. How do you distribute?
@timothysime3123
@timothysime3123 Жыл бұрын
Very interesting, love how people are still analysing this game to such depth! I'm going to think of this video everytime I fail a quickwall
@nottud
@nottud Жыл бұрын
Developers should use stable marriage algorithm to pair up the villagers to wall piece so distance walked overall is minimised. This should make it work regardless of ordering.
@yalassa1
@yalassa1 Жыл бұрын
This is interesting to remove dependency on ordering and certainly efficient but if I understand it right stable marriage algorithms wouldn't necessarily minimize overall walked distance. Taking as an example two villagers and two wall pieces on a grid when villagers don't exactly face the wall but are shifted on one side: ----------- Villager A ---- Villager B | | | Wall C -------- Wall D ---------- In this case the "stable" solution sends A to D and B to C which is overall longer than sending A to C and B to D. It gets worse with more villagers and wall pieces because the last villager (on the right) is always sent to the first wall piece (on the left). In this kind of problem it would probably make more sense to try to minimize the maximum distance walked by one villager to reduce the time needed to build the whole wall. Keeping the marriage model there must exist algorithms which solve this problem and try to avoid making the "worst" marriage.
@nottud
@nottud Жыл бұрын
@@yalassa1 I think you can solve that by making the distance weighting penalty quadratic - so that two medium distances is better than a small and large distance.
@hory-portier
@hory-portier Жыл бұрын
@@nottud yet you often might want the wall to start being built faster and not care about efficiency for the whole building process. Generally better algorithm isn't necessary better in specific use case. Imagine you're building a wall from right to left. Half of your workers are right at the start of the wall and other half is at longer distance at your base to the right. We would prefer those close ones to start building the closest walls in hopes they would finish before the others even come to help.
@nankinink
@nankinink Жыл бұрын
I'd guess that calculating the distance of every villager and every wall would be very slow, the algorithm could be optimized but still needs computation. Sticking to the array matching sounds a bit faster. We also should take when the game came out, PCs weren't the monsters of today. Some vector calculations might not be that fast on those old processors. I might be wrong tho.
@elliejohnson2786
@elliejohnson2786 Жыл бұрын
I wish there was a "Build-move" like the attack-move where villagers build everything in the path between them and their target, prioritising the edges of buildings closest to them.
@Hjoerleif
@Hjoerleif Жыл бұрын
11
@weirdfunnyvideos1289
@weirdfunnyvideos1289 Жыл бұрын
ending is also very cool with dramatic music
@jewellui
@jewellui Жыл бұрын
I'm amazed there's such content to be made about a game as old as AoE2 :O
@krellin
@krellin Жыл бұрын
i love that people make entire videos about finding how how Microsoft developer wrote his for loop :D
@titansbane
@titansbane Жыл бұрын
Well ... this blew my mind, quite an interesting discovery. Thanks for sharing! 🤯
@Jeromemas
@Jeromemas Жыл бұрын
Thanks for this Video Hjörleif 😊
@nem841bal
@nem841bal 5 ай бұрын
This literally kept me wake at one night, trying to figure out what would be an optimal algoritm for this :D even after the patch, removing the selection order, i am not sure if going to the closest point will achieve the quickest finish of the wall. though maybe for quickwalling objective (no need to actually finish ever) the current implementation is the best.
@beetrootstrootsbee2019
@beetrootstrootsbee2019 Жыл бұрын
this is the kind of videos that will make your channel grows I'm sure of it
@1AEGIS
@1AEGIS Жыл бұрын
The content just keeps getting better. No cap, I dont think I've ever seen anything shown on other channels with this quality
@hrushikeshj8810
@hrushikeshj8810 Жыл бұрын
Great video! Super cool and super specific. You should continue with villager behaviour in farms or attacking each other etc. I don't know just throwing out random suggestions :)
@TJanzen
@TJanzen Жыл бұрын
Been playing the game since it came out This is literally a game changer lol!
@RAMMY237
@RAMMY237 Жыл бұрын
Thanks for the research on this, btw, love it!
@garlicohen960
@garlicohen960 Жыл бұрын
My dumbass brain won't be able to process all the information and make a judgment where to drag when quickwalling, but thank you for the in depth analysis!
@padpai_
@padpai_ Жыл бұрын
damn almost at 100k views, congrats Hjörleif :)
@jessekessler189
@jessekessler189 Жыл бұрын
This was so satisfying to watch.
@adrianbyg5553
@adrianbyg5553 Жыл бұрын
03:38 your vills when the enemy is rushing you in ranked
@davidparkersteyn2666
@davidparkersteyn2666 Жыл бұрын
Doing a select all kind of boils down to the algorithm the game uses to select things. In terms of programming, likely they have 2 lists, 1 of selected units, 2 of wall placements, and just iterate through both lists without any care for order (which is computationally more efficient than building some sort of allocation algorithm). I'd wager that if you did a select all of all units, and then killed them one by one (not sure if this is possible anymore in AOE2), and the units dying were consistent, then you'd have your answer. You might also try doing this by using a bunch of production buildings and queueing units up past the pop cap and see which buildings are successful.
@naklimancoffeeshop
@naklimancoffeeshop Жыл бұрын
Yeaaah Mr. Hjörleif! Science!
@nagatidur3254
@nagatidur3254 Жыл бұрын
yes of course love this tips
@skyacaniadev2229
@skyacaniadev2229 Жыл бұрын
Maybe selection of double click is based on creation time? Then all three hypotheses are correct.
@MrGarg10may
@MrGarg10may Жыл бұрын
Now I can rest in peace.
@Polarwolf-WenXin
@Polarwolf-WenXin Жыл бұрын
interesting information👍
@EduardR10
@EduardR10 Жыл бұрын
Excelente trabajo :O
@sergeykwk4761
@sergeykwk4761 Жыл бұрын
I think you forgot to tell in the beginning "Hey guys, Spirit of the Law here"))
@green_beard
@green_beard Жыл бұрын
such fire video
@pumpkinpie8235
@pumpkinpie8235 Жыл бұрын
Nice one
@Lahdyn
@Lahdyn Жыл бұрын
Simply when you select, the villagers are ordered from top to down (and then left to right if same level) then assigned the wall pieces in the order you lay the wall squares ... so first villager takes first piece and second villager in the selection takes second piece and so on ...
@Hjoerleif
@Hjoerleif Жыл бұрын
If drag-box is the selection method, yes. Control groups and double-click do not order the selection simply from North to South nor from left to right.
@hiperblaszter
@hiperblaszter Жыл бұрын
double click select all, orders them by their age.
@Hjoerleif
@Hjoerleif Жыл бұрын
That doesn't seem consistent to what I observed when I tested it. At any rate, I might make a second video about selection order where I test out double-click more
@gomul13
@gomul13 Жыл бұрын
@@Hjoerleif could it be that it selects first the unit you clicked on then the closest ones to that unit?
@Hjoerleif
@Hjoerleif Жыл бұрын
@@gomul13 The first unit being the clicked one is correct. But at first it seemed that the southern-most is the second, followed by a North-South order for the rest. But this assumption didn't hold consistently as I tested it repeatedly. So I didn't see anything conclusive enough to state in this video
@puchomuc
@puchomuc Жыл бұрын
Fascinating
@CptManboobs
@CptManboobs Жыл бұрын
This is actually some really cool Tech
@Sheyk871
@Sheyk871 Жыл бұрын
This information Is gold That could be great recieved years before hahahah
@oscargoth
@oscargoth Жыл бұрын
Good scientific observation.
@RAMMY237
@RAMMY237 Жыл бұрын
3:00 isn't it because you dragged the selection box from left to right? And if you drag the opposite direction, the ordering will be reversed as well?
@Hjoerleif
@Hjoerleif Жыл бұрын
No, even if you drag the box from down to up, the selection will still be ordered top-down. I realise now I should have demonstrated and told this too since originally I assumed the same as you but I didn't think to include it in the video
@RAMMY237
@RAMMY237 Жыл бұрын
@@Hjoerleif It's ok, that's why we have comments section here, right? ;) Thanks for your accurate explanations!.
@Beliserius1
@Beliserius1 Жыл бұрын
@@Hjoerleif 3:15, you selected them from right to left, bottom to top, and wall in the same direction and worked.
@Hjoerleif
@Hjoerleif Жыл бұрын
@@Beliserius1 I did. Probably subconsciously due to the assumption I held earlier that that's necessary. Or more likely, footage from a time where I believed that was the case. I even had it in the script that it depends on which way you drag the box until I realised that's actually not the case when I recorded to demonstrate that it will fail if you place the walls in the other direction from which it dragged. But it worked all the same, showing that drag-box will order them North-South either way. Unfortunately, I just scrapped that part instead of addressing the (apparently insignificant) role of which way the box is dragged. I will go into more of what I didn't focus on this video in another video soon. If you're too impatient for that and own a copy of AoE2DE, it should take no more than a minute to check for yourself in the scenario editor whether a line of villagers behave differently depending on which way you drag the box selection.
@TheNewMaxico
@TheNewMaxico Жыл бұрын
Your living room looks nice
@rickyortiz2463
@rickyortiz2463 Жыл бұрын
Did TheViper know this? If he did he withheld this info from us on purpose!!
@steretsjaaj2368
@steretsjaaj2368 Жыл бұрын
interesting man, so interesting actually that Sotl has a new rival now imo
@styrkur9210
@styrkur9210 Жыл бұрын
someone needs to show red the attack move hotkey. He could have massively damaged blue's eco
@daniloalves1139
@daniloalves1139 Жыл бұрын
nice
@APIEngineering
@APIEngineering Жыл бұрын
OMG you may have just stopped me from my 21 year old habit of double clicking them before building. BUT, is there a way to click drag and exclude military units and only get the vils? Also, I wonder if selection order has an effect on behavior of military units, like how they go in to attack. And then there's garrisoning to think about! This could help my island raids go better, with just a change in habits, and some practice of doing it a new way. All the way back to how I select my armies by control groups?! GOD, WE'VE BEEN DOING IT WRONG ALL ALONG!! AOE GODS FORGIVE US!! **wailing and crying**
@Hjoerleif
@Hjoerleif Жыл бұрын
I don't know what difference the selection order could make with military units. There is an option to only have military units be caught by drag-box selection but there is not a setting for the inverse that I'm aware of.
@weirdfunnyvideos1289
@weirdfunnyvideos1289 Жыл бұрын
@@Hjoerleif it is... in options, i made regular dragging only select military and alt+drag only select viligars
@Deeem2031
@Deeem2031 Жыл бұрын
@@weirdfunnyvideos1289 I think Alt+drag is the default for that. Making regular drag only select military units sounds useful for mid/ late-game. I'll have to try that
@MoRDekai1364
@MoRDekai1364 Жыл бұрын
they have added this option in DE right before the Indian patch
@SammyJoseph06
@SammyJoseph06 Жыл бұрын
ALT for vills only and CTRL for military only
@miguelmolano6611
@miguelmolano6611 Жыл бұрын
What if the wall is longer than the amount of builders? None sends that many builders to build a wall.
@danielbentley7117
@danielbentley7117 Жыл бұрын
I wish there was a way to stop villagers walking to the wrong side of the wall while walling
@ramonantoniolli7379
@ramonantoniolli7379 Жыл бұрын
what u did to have such small life bars? is it a mod or an option in game? I would like to have smaller health bars.
@Hjoerleif
@Hjoerleif Жыл бұрын
I just have default health bar settings I think. They might appear small when I'm zoomed out a lot
@thegoldenrenesus9740
@thegoldenrenesus9740 Жыл бұрын
Very interesting! Also that like button in the end was not getting pressed 11 how much do we need to p p p p p p push it? 1111
@abualborz
@abualborz Жыл бұрын
imagne you play a game since 2002 and then a dude comes around and tells you something you never know it exists in game ! hahah. very nice.
@SebaD147
@SebaD147 Жыл бұрын
if you doble click the vills, the wall will be build in the order of creations of the vills?
@Hjoerleif
@Hjoerleif Жыл бұрын
Not quite. It seems at least that villager 1 is always the unit that was clicked but I was not able to determine how exactly the others are ordered. I will look into this more to hopefully settle it in another video
@miguelinileugim
@miguelinileugim Жыл бұрын
You didn't do the feat at the end of the video :(
@Hjoerleif
@Hjoerleif Жыл бұрын
I thought it redundant since it's already in the beginning of the video. I've also uploaded it as a separate video: kzfaq.info/get/bejne/l7uUfsahrJ22fZc.html
@miguelinileugim
@miguelinileugim Жыл бұрын
@@Hjoerleif Thanks!
@UraNuSGM
@UraNuSGM Жыл бұрын
nice curiosity....
@TERRYLEE923
@TERRYLEE923 Жыл бұрын
How to position villagers in a line that’s also important. Can you teach us?
@Hjoerleif
@Hjoerleif Жыл бұрын
Honestly, this would never realistically come up in an actual competitive match so this is quite trivial knowledge. But if you do decide to do it, all you need is a terrain grid, you can enable it in the game options. Then you place one villaget in each tile of a row of tiles.
@u9vata
@u9vata Жыл бұрын
@@Hjoerleif I think it is still good to keep in mind to always: - Select with group selection with mouse - Build all walls from top-to-bottom - When having few vills, it might be helpful to build the wall up in "smaller sections" as action (not strictly needed, but if you have apm.....) On avarage with my testing it works better this way than double-click and all kind of other quickwalls so this is still useful lore in practice as far as I see from my tests...
@Hjoerleif
@Hjoerleif Жыл бұрын
@@u9vata indeed. I'm still not convinced it's worthwhile to place one villager per tile in a perfect line if you're playing eg. ranked though 11
@SoLowKaspar
@SoLowKaspar Жыл бұрын
my brain. owie
@Luisin88
@Luisin88 Жыл бұрын
Does this work on HD edition?
@Hjoerleif
@Hjoerleif Жыл бұрын
I would expect so, yes. But I'm not entirely sure. I will check that for the next video
@billlam7756
@billlam7756 Жыл бұрын
Wall and buildings should cost alot more stone/wood. Should have way more hitpoint as well and siege should be cap to like 10 max. I hate playing a game where siege is like 50+% of the unit comp
@Hjoerleif
@Hjoerleif Жыл бұрын
I think AoE4 is a bit like how you describe
@billlam7756
@billlam7756 Жыл бұрын
@@Hjoerleif it's annoying when all people ever spam is scorpion and trebuchet
@Hjoerleif
@Hjoerleif Жыл бұрын
@@billlam7756 the best way to avoid having to deal with that is probably attacking them earlier. Scorpions and trebs are quite a late game composition
@EmperorMato
@EmperorMato Жыл бұрын
That disastrous outro is so painful to watch!!
@Hjoerleif
@Hjoerleif Жыл бұрын
11 thank you for watching all the way through to enjoy my outro and also leaving a comment!
@filthyfilter2798
@filthyfilter2798 Жыл бұрын
thats why i never became a programmer xD
@tag180rotax
@tag180rotax Жыл бұрын
TIFO
@VITAS874
@VITAS874 Жыл бұрын
Just use cheat 😂
@Hjoerleif
@Hjoerleif Жыл бұрын
Which cheat can we use to guide our villagers to the closest wall tile?
@VITAS874
@VITAS874 Жыл бұрын
aegis
@personious_k
@personious_k Жыл бұрын
nice
Quickwall in AoE2 explained in 48 seconds or less
0:48
Hjörleif - Age of Empires 2
Рет қаралды 18 М.
The 6 Most Useless AoE2 Unique Techs
13:11
T90Official - Age Of Empires 2
Рет қаралды 156 М.
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 91 МЛН
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 143 МЛН
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 4,5 МЛН
😳 Все русские уже знают итальянский?🇮🇹
00:15
Best Booming Civs in AoE2
13:07
Spirit Of The Law
Рет қаралды 277 М.
Ranking the trebuchet bonuses/techs (Aoe2)
13:20
Spirit Of The Law
Рет қаралды 148 М.
Top 5 Army Control Tips To Improve Your Micro | Aoe2
14:30
Hera - Age of Empires 2
Рет қаралды 123 М.
Age of Empires DE - Babylonians vs. Babylonians - Hard ai
32:47
The Pursuer T-103
Рет қаралды 33
How To Defend vs A Forward Castle | AoE2
9:33
Hera - Age of Empires 2
Рет қаралды 47 М.
30 More Tips and Tricks to Improve in AOE2 - Part 2
8:33
TheViper
Рет қаралды 186 М.
10 Tricks I use to play faster [AoE2]
9:28
Spirit Of The Law
Рет қаралды 676 М.
Freeing Cloud Capacity in AoE2DE Taught in 15 Seconds or Less
0:16
Hjörleif - Age of Empires 2
Рет қаралды 584
How to Attack Your Opponent [Age of Empires 2]
22:20
Survivalist
Рет қаралды 78 М.
Why Is He Unhappy…?
00:26
Alan Chikin Chow
Рет қаралды 91 МЛН