Army Formations in Unity

  Рет қаралды 37,614

Tarodev

Tarodev

2 жыл бұрын

I had some fun in Unity building army formations. Let me know what you think and where they could be improved!
Scripts: github.com/Matthew-J-Spencer/...
Package: bit.ly/2UhpizN
❤️ Become a Tarobro on Patreon: / tarodev
=========
🔔 SUBSCRIBE: bit.ly/3eqG1Z6
🗨️ DISCORD: / discord
✅ MORE TUTORIALS: / tarodev

Пікірлер: 110
@Tarodev
@Tarodev 2 жыл бұрын
Did you enjoy this video? *Let me know* so I can continue to make awesome content for you :)
@VMEcycle6
@VMEcycle6 2 жыл бұрын
Great tutorial.👍👍 Well I was working on something very similar six month ago. And I started with a similar approach. But then I realize that when some soldiers got killed in combat. Having other soldiers fill in the gap may trigger all the soldiers to swap their locations, thus will mess up your formation during combat. So I studied flocking algorithm. I let all the soldiers repelling each other, also having the formation "box" attracts all the soldiers. Then calculate a combined vector for each soldier which will determine where a soldier should move. It's kinda hard to have a perfect formation with this method, but it also came with some realism... sort of. Also if a soldier got killed, all you need is just shrink the formation box size to make a tighter formation.
@Tarodev
@Tarodev 2 жыл бұрын
@@VMEcycle6 you could also just cheat. When a unit dies, the positions are recalculated and the remaining units find the closest new position to them and walk to it.
@xanaramus
@xanaramus 2 жыл бұрын
Looks like phyllotaxis, that could be usefull too
@Tarodev
@Tarodev 2 жыл бұрын
@@xanaramus I had to google that. You're right, it does! You can find nature in everything :)
@gralcio
@gralcio 2 жыл бұрын
It's amazing. Add such a mini-thing to your game lobby and no one will be bored waiting for challengers.
@libberator5891
@libberator5891 2 жыл бұрын
I'm getting some slight Sebastian Lague vibes. I like it
@Tarodev
@Tarodev 2 жыл бұрын
Compliment of the highest calibur ♥️
@sima19995
@sima19995 Жыл бұрын
The attention to detail at 1:09 with the beat is just mind blowing.
@Tarodev
@Tarodev Жыл бұрын
I'm glad somebody finally appreciated that 😜
@arkobanerjee5166
@arkobanerjee5166 6 ай бұрын
Yeah bro that is so cool
@omega_dip_wod
@omega_dip_wod 2 жыл бұрын
Wow this man puts out banger after banger
@Tarodev
@Tarodev 2 жыл бұрын
Thanks my guy
@TREXYT
@TREXYT 9 ай бұрын
you cant imagine how helpfull you are! thanks friend!
@jugibur2117
@jugibur2117 2 жыл бұрын
Wow, good job, so much in the way of settings. I don't need something like that right now, but it was interesting to see how you implemented it. Thanks for that!
@Tarodev
@Tarodev 2 жыл бұрын
😊
@makoto4541
@makoto4541 Жыл бұрын
Looking for radial instantiation and your video was quite low on the recommended list, but as soon as I saw it was from you, I ignored all other videos and went straight to this one. Your content is reliable, the code is generic, the possibilities are extensive and the explanation is concrete. I find myself often checking first if you have covered the topic before looking elsewhere. Thank you
@Tarodev
@Tarodev Жыл бұрын
High praise 🙏 thanks for being a supporter
@honokiii
@honokiii 2 жыл бұрын
I am looking for a crowd formation method for my current project and saw this. It is not what I am looking for but it is so interesting! Thank you for the idea!
@youcancallmedoggie
@youcancallmedoggie 2 жыл бұрын
this is awesome! Please keep doing what you doing. Your content is simply amazing.
@cyqry
@cyqry 2 жыл бұрын
Looks good as far as function goes and the presentation really nice too. I'm working on a squad-based game and I got to say procedural formations are damned hard so kudos for this. Only thing that comes to mind for improvements is cleaning up how the formation reforms when characters are added or removed. I could never figure out how to improve it and it always felt weird seeing characters sprint from one end of the line to the other instead of just bolting onto the closest end.
@Tarodev
@Tarodev 2 жыл бұрын
So true. Ideally it should detect if any units are close to a new position and re index them to save long walks. Or at the very least give the unit a speed boost when reforming...
@cyqry
@cyqry 2 жыл бұрын
@@Tarodev For sure. Reindexing sounds like the way to go in this case, I will give that a go on my project when I get some spare time and see how well it works.
@TheDarkranium
@TheDarkranium 2 жыл бұрын
You can try the Hungarian Algorithm to assign positions so they don't cross over each other's path.
@cyqry
@cyqry 2 жыл бұрын
@@TheDarkranium I'll look into it, thanks.
@lonebeaver9535
@lonebeaver9535 2 жыл бұрын
Woah I just came here from your reddit post. I just got done implementing box formations in my game and your algorithm is so much more elegant than mine and I was wondering how to achieve radial formations thank you very much!
@makra42069
@makra42069 2 жыл бұрын
your videos are ASMR to the ears
@eliaskarlsson9017
@eliaskarlsson9017 Жыл бұрын
Thank you so much, this is exactly what i needed
@zZLibikiZz
@zZLibikiZz Жыл бұрын
this is simply amazing!
@NekomGiorgio
@NekomGiorgio 2 жыл бұрын
Really great, thank you!
@castlecodersltd
@castlecodersltd Жыл бұрын
Brilliant video. Thanks for sharing ☺
@tomkc516
@tomkc516 2 жыл бұрын
This video was extremely visually appealing.
@Tarodev
@Tarodev 2 жыл бұрын
Thanks Thomasssssssss
@171694
@171694 2 күн бұрын
Amazing!
@talha5930
@talha5930 Жыл бұрын
Amazing tutorial thumbs up for this 😊
@rhow9724
@rhow9724 2 жыл бұрын
Fun video, thanks!
@_dr_crusher
@_dr_crusher 10 ай бұрын
Awesome video - was hoping to see more about the Uniform functionality and the movement you have in the video. Not seeing it in the scripts though. Thanks for your time!
@bestdaddyoftheyear
@bestdaddyoftheyear 2 жыл бұрын
enjoyed watching
@am-apps-games
@am-apps-games 2 жыл бұрын
Many thanks for this one! Really usefull!
@Tarodev
@Tarodev 2 жыл бұрын
Glad it was helpful!
@Malryni
@Malryni 11 ай бұрын
OMG man, I love u So awesome script
@bluzenkk
@bluzenkk 2 жыл бұрын
you are awesome... i was trying to archeive the same thing a year ago but failed.. Thanks~~
@basicdogtrainings9389
@basicdogtrainings9389 2 жыл бұрын
Hey bro thanks for creating this video because i am a solo developer and i need this things so far,thanks TaroDev 😀
@Tarodev
@Tarodev 2 жыл бұрын
Glad you enjoyed it! ❤️
@basicdogtrainings9389
@basicdogtrainings9389 2 жыл бұрын
@@Tarodev Thanks
@itzmrjerry7067
@itzmrjerry7067 Жыл бұрын
Great video! and thanks alot for this amazing script but i do have one problem in your video you talk about the toggle for uniform armys but i can't seem to find it. Could you help me with this?
@manji2023
@manji2023 2 жыл бұрын
Pretty interesting.
@JitendraKumar-xv4kt
@JitendraKumar-xv4kt Жыл бұрын
Die-hard fan of you 🙌
@muammar88
@muammar88 Жыл бұрын
I love the reference to the I'm a legend zombies gathering in the dark scene haha! ps. you're a Legend ;)
@mayhem5036
@mayhem5036 2 жыл бұрын
Great vid, I'm wondering if you could add a flocking componet and would that be ideal to stop clipping between models?
@YuriNoirProductions
@YuriNoirProductions 2 жыл бұрын
Do you have any video where you explain how you actually made the individual units wobbly? i only know the concept of having a animated unit and a physical unit that tries to mimic the first one but i have little to know idea how to execute it
@hyperv4758
@hyperv4758 5 ай бұрын
great video how you are avoiding collision between them? or this is not there?
@_dr_crusher
@_dr_crusher 10 ай бұрын
Or alternatively, maybe a little insight as to the best way to move around the whole group the same way that you went about it. Super appreciated! Thank you
@shenshaw5345
@shenshaw5345 20 күн бұрын
did you ever figure this out?
@LinhNguyen-zt3mg
@LinhNguyen-zt3mg 2 жыл бұрын
so great (heart)!
@LeviAckerman-xt7dx
@LeviAckerman-xt7dx 2 жыл бұрын
This actually looks fun. Can I use this for my commercial mobile game?
@Tarodev
@Tarodev 2 жыл бұрын
Yup, use any code I release :) Let me know if you make anything cool!
@vaibhavjaiswal799
@vaibhavjaiswal799 2 жыл бұрын
Can you give a step by step tutorial of this
@germiyanbey1
@germiyanbey1 Жыл бұрын
How to rotate the Formation, any ideas? When I rotate transformY of ExampleArmy (or UnitParent), the formation is overridden to stay same.
@germiyanbey1
@germiyanbey1 Жыл бұрын
Okay, I found out, change each transform.position to transform.localPosition in Line 44 (that starts with "_spawnedUnits[i].transform.position") in ExampleArmy.cs. The formation will rotate properly by rotating Y of Example Army gameObj.
@kamolovfintch8341
@kamolovfintch8341 Жыл бұрын
Great video! and thanks alot for this amazing script but i do have one problem in your video you talk about the toggle for uniform armys but i can't seem to find it. ❤❤❤❤❤❤❤❤
@adil0028
@adil0028 Жыл бұрын
Tarodev, could you provide the shader you used? Or atleast make a tutorial on it? I've been trying to make a game using an art style similar to that, but haven't figured it out yet.
@denis4096
@denis4096 10 ай бұрын
The character asset/model is great. Where can I get that?
@prietinho6690
@prietinho6690 2 жыл бұрын
Do you know where I can download these types of materials to prepare your playtesting scene? I mean the blue boxes ty
@Abdulwahab-vb6he
@Abdulwahab-vb6he 2 жыл бұрын
cool!
@Tarodev
@Tarodev 2 жыл бұрын
You're cool :)
@kukisj2752
@kukisj2752 2 жыл бұрын
Sorry, but these little guys and their sacrifices have stolen the show ;) I just miss to see them dancing in circles at the end. Great content!
@Tarodev
@Tarodev 2 жыл бұрын
They blow themselves up for your entertainment
@romazriaz5141
@romazriaz5141 2 жыл бұрын
Damn🔥
@eminalgul1678
@eminalgul1678 2 жыл бұрын
Hello!! Thanks for video ,really useful . How should we write a code to add 1 object to the army?
@Tarodev
@Tarodev 2 жыл бұрын
Do you mean add more units? The code I provided should do that for you right out of the box :)
@TheKr0ckeR
@TheKr0ckeR Жыл бұрын
Wow... thats... incredible... i mean..the presentation is UBER-SUPER MEGA COOL.
@Tarodev
@Tarodev Жыл бұрын
Thanks pal :)
@tubephega
@tubephega 2 жыл бұрын
go lil chibby go!
@whidzee
@whidzee 2 жыл бұрын
How hard would it be to take this and make it into a basic sporting game? I'm thinking something like rugby where the defensive team always retreats back 10m and stands in a line and then moves forwards roughly together
@awsbasim8240
@awsbasim8240 Жыл бұрын
How do you make the whole formation move How do u add pathfinding to it
@fortnitegiftcard8541
@fortnitegiftcard8541 2 жыл бұрын
I’m trying to make a flying game, how could I change the height of the ai plane in formation to make it look realistic and not a massive straight line
@bio17
@bio17 2 жыл бұрын
I like your concise implemetation. Can I ask you why it's better to return an IEnumerable instead of a List in the script BoxFormation?
@Tarodev
@Tarodev 2 жыл бұрын
It simply gives you more performance options. For example you may only want to grab 3 positions, or just loop the first 5. Keeping it an ienumerable means you can simply grab 5 and stop the loop without it grabbing every position. I have a video coming out about ienumerable if that is a little bit confusing.
@bio17
@bio17 2 жыл бұрын
@@Tarodev thanks. I'm eagerly waiting for your video about this!
@archamondearchenwold8084
@archamondearchenwold8084 2 жыл бұрын
feels like u could turn these into RTS unit formations
@Tarodev
@Tarodev 2 жыл бұрын
It would be fun commanding these floppy little guys
@Conquership
@Conquership 2 жыл бұрын
thats what im trying to do!
@TREXYT
@TREXYT Ай бұрын
hi, there is an annoying bug where when there is around 17 players or more and you set up _rings to 2 in the inspector then _amount value change every +2, why that ? radial formation is not centred, please fix bro, thanks!
@lemuelapperson853
@lemuelapperson853 2 жыл бұрын
They're not wear pants? JK This is very cool. Part of the radial patterns you were seeing is a known math phenomenon. It gives rise to such things as Moiré patterns.
@Tarodev
@Tarodev 2 жыл бұрын
They need to run free 😉 Just googled Moiré patterns, very interesting!
@moetsi7122
@moetsi7122 2 жыл бұрын
Awesome video! where is the link to the source code?
@shirosurfer8864
@shirosurfer8864 2 жыл бұрын
What's the animation style name of the wiggly guys
@aweramu7107
@aweramu7107 2 жыл бұрын
Your Fonts is very cool? What is name your text fonts bro.
@Tarodev
@Tarodev 2 жыл бұрын
The thin font is simply called 'Blueprint'. The chunky boi is called "Bluprint", without the e. Very imaginative names :P
@MSI2k
@MSI2k 2 жыл бұрын
What's the music 2:50 and onwards?
@mtouseef1821
@mtouseef1821 2 жыл бұрын
Hey do you know you are awsome :)
@Tarodev
@Tarodev 2 жыл бұрын
I do now 😊
@asinzhang8791
@asinzhang8791 2 жыл бұрын
i‘m more intrested on transtion that parameter changed
@Tarodev
@Tarodev 2 жыл бұрын
Sorry, what do you mean?
@SykerElRulas
@SykerElRulas 3 ай бұрын
Hii , i would so cool if one unit dies, the formation reorganizes to fill the gap , im trying it but so far im not geting it
@DrHeinzDoofenshmirtz
@DrHeinzDoofenshmirtz Жыл бұрын
Is this using the NavMesh system? Please tag me if someone answers :)
@devlasutriv
@devlasutriv 2 жыл бұрын
Someone send this to AOE IV devs.
@braindead2813
@braindead2813 27 күн бұрын
I am not following where is the instantiate() function?
@publicalias8172
@publicalias8172 3 ай бұрын
The only problem is this just scales with rows and columns, not individual units added/removed.
@Tarodev
@Tarodev 3 ай бұрын
There are more problems than that, I can assure you. This is just a nice little starting point 😊
@bluzenkk
@bluzenkk 2 жыл бұрын
oh, you forgot to make a triangle formation.
@Tarodev
@Tarodev 2 жыл бұрын
Ohhh, that would have been fun
@lanzheng0728
@lanzheng0728 10 ай бұрын
do you mind share the source code in patreon?
@Tarodev
@Tarodev 10 ай бұрын
I have the formation source code in the description my man. Or are you after something else?
@lanzheng0728
@lanzheng0728 10 ай бұрын
@@Tarodev yes,i'm pretty interesting the chalk mark style UI, how did u with that ?
@Tarodev
@Tarodev 10 ай бұрын
@@lanzheng0728 that's as simple as a textmeshpro laid flat on the ground 😊
@lanzheng0728
@lanzheng0728 10 ай бұрын
@@Tarodev 😂sure
@stefanocristoni
@stefanocristoni 2 жыл бұрын
I done something like this 1 month ago...worse and less powerful
How to make a menu in Unity - UI Tutorial
26:27
Tarodev
Рет қаралды 178 М.
Just Boids | Useless Game Dev
12:10
Useless Game Dev
Рет қаралды 56 М.
Ну Лилит))) прода в онк: завидные котики
00:51
Can you beat this impossible game?
00:13
LOL
Рет қаралды 52 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 12 МЛН
Master the Art of REDUX TOOLKIT | Create TODO LIST
16:42
I made Action-Adventure into an RTS!
14:59
Code Monkey
Рет қаралды 35 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
How many AI Agents can Unity handle?
6:18
Brackeys
Рет қаралды 1,7 МЛН
Coding Adventure: Boids
8:35
Sebastian Lague
Рет қаралды 1,5 МЛН
I Made a Game Using ChatGPT
9:51
Rye
Рет қаралды 2,6 МЛН
10 Things You NEED to Be Doing in Unity
11:40
Tarodev
Рет қаралды 125 М.
I Made an RTS Game with Unity DOTS + ECS
16:56
Turbo Makes Games
Рет қаралды 23 М.
Building a Camera Controller for a Strategy Game
17:48
Game Dev Guide
Рет қаралды 190 М.
你们家里有这么调皮可爱的孩子吗? #袋鼠妈妈
0:41
袋鼠妈妈育儿记
Рет қаралды 12 МЛН
ХОРОШО ЧТО ПЕРЕПРОВЕРИЛ😂😂😂 #юмор #пранк
0:44
СЕМЬЯ СТАРОВОЙТОВЫХ 💖 Starovoitov.family
Рет қаралды 3,1 МЛН
A comical and humorous family
0:43
昕昕一家人
Рет қаралды 21 МЛН
ПАРАЗИТОВ МНОГО, НО ОН ОДИН!❤❤❤
1:00
Chapitosiki
Рет қаралды 2,6 МЛН
Мама оставила меня в машине одну
0:26
Даша Боровик
Рет қаралды 1,2 МЛН