Monster shadow

VIDEO

Fun with Formations - Game Dev Adventure

Description:
I had some fun in Unity building army formations. Let me know what you think and where they could be improved! Scripts: https://github.com/Matthew-J-Spencer/Formations Package: https://bit.ly/2UhpizN
ADD A COMMENT

Tarodev
Did you enjoy this video? *Let me know* so I can continue to make awesome content for you :)
VMEcycle6
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.
君莫思归
Pretty interesting.
justcallmedoggie
this is awesome! Please keep doing what you doing. Your content is simply amazing.
emin Algül
Hello!! Thanks for video ,really useful . How should we write a code to add 1 object to the army?
Tarodev
Do you mean add more units? The code I provided should do that for you right out of the box :)
M Touseef
Hey do you know you are awsome :)
Tarodev
I do now 😊
Basic Dog Trainings
Hey bro thanks for creating this video because i am a solo developer and i need this things so far,thanks TaroDev 😀
Basic Dog Trainings
@Tarodev Thanks
Tarodev
Glad you enjoyed it! ❤️
Asin Zhang
i‘m more intrested on transtion that parameter changed
Tarodev
Sorry, what do you mean?
Awera Mu
Your Fonts is very cool? What is name your text fonts bro.
Tarodev
The thin font is simply called 'Blueprint'. The chunky boi is called "Bluprint", without the e. Very imaginative names :P
Vaibhav Jaiswal
Can you give a step by step tutorial of this
Makra
your videos are ASMR to the ears
MadLibberator
I'm getting some slight Sebastian Lague vibes. I like it
Tarodev
Compliment of the highest calibur ♥️
Mario Rossi
Really great, thank you!
ɯop pᴉlopɐllɐʌ
go lil chibby go!
Ryan
Wow this man puts out banger after banger
Tarodev
Thanks my guy
VanillaHoward
Fun video, thanks!
Anqry
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.
Anqry
@Darkranium I'll look into it, thanks.
Darkranium
You can try the Hungarian Algorithm to assign positions so they don't cross over each other's path.
Anqry
@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.
Tarodev
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...
Jugibur
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
😊
SEE ALL COMMENTS


Transcript:

before we begin in case you wanted to follow along i've included some of the
code snippets used here in the description as well as a unity package
you can throw right into your scene in this video i'll be discussing two
types of formations the box formation
and the radial formation [Music]
but we'll start with the box formation without any of the bells and whistles
i'll be showing you shortly the code is quite simple if you've seen my grid
tutorial this should look familiar to you we're just looping over our unit
width which we'll call x and inside that we're looping over our unit depth which
we'll call z then we're returning a vector using our
current x and z in the end it will give you something
like this [Music]
we can add some simple purlin noise to the mix to give it a bit of chaos
[Music] next i added the ability to hollow out
the box by only returning the outer edges
[Music] a spread value was added which just
multiplies their position to allow more control over the distance between units
lastly a way to offset every second row [Music]
i added a toggle to determine if my army should move in a uniform militant sense
or if each unit should have its own personality
this gives it a bit more of a realistic feel
here is the final code for the box formation
pause the video if you'd like to inspect how i achieved each modification
[Music] okay let's bring these radial boys back
in [Music]
instead of the width and height values for radial we use amount and radius
[Music] we can get some pretty interesting
results by adding additional rotations to the circle as well as an offset
[Music] [Music]
i added support for additional rings as well as an offset for every second
ring [Music]
you can make some seriously weird formations by just messing around with
the values don't even ask me what's going on here
[Music] i hope you enjoyed this little video
give it a thumbs up if you did and let me know what you think could be improved
in the comments [Music]
you