Unity Architecture for Noobs - Game Structure

preview_player
Показать описание
Unity Architecture is one of those things which can completely overwhelm new devs. This video will introduce you to a handful of architectural design patterns, which shy away from over-engineering, allowing you to learn the basics and get on with developing your game. Simple patterns are perfectly fine for most projects solo devs and small teams set their sights on.

=========

0:00 - Intro
0:50 - Hierarchy (Scene structure)
2:17 - Project (Folder structure)
3:00 - Singleton Managers
3:58 - Game Manager
5:47 - Unit Manager
6:12 - Scriptable Objects
8:22 - Persistent Systems
9:18 - Audio System
9:38 - Resource System
10:44 - Unit hierarchy
14:33 - Utilities
15:00 - Rest of Folders
15:18 - That's it (+announcement)
Рекомендации по теме
Комментарии
Автор

Great video, but there seems to be a mistake in StaticInstance class On the Singleton class, there should be a return method inside the if (Instance != null) statement. Otherwise, the base.awake method is still being called, and the previously created static instance ref is overriden by the StaticInstance class's Awake method. But still, the structure is amazing. Keep it up!

Laurynaspupsta
Автор

I think one of the most important tips I received in this video was during your intro, "as you learn as a developer it will adapt and evolve to your style"
I had been confusing myself trying to force other developers' styles of architecture into my projects, what I *should* be focusing on is taking advice from other devs to evolve a style that's suitable for the way that *I* think.

Really enjoyed this video, learned a handful of other helpful things as well!

Pixelhurricane
Автор

It's quite rare too see a tutorial on architecture, so thanks a lot for this!

Happy holidays mate!

ZahhibbDev
Автор

Great Video, I follow a very similar structure. The only real standout differences is that those "separator" style gameobjects with dashes etc, if you put them on the editor only layer they will be auto stripped from the project which cleans up the build hierarchy, and the other one is that I personally try to avoid "resource loading" style code at runtime if possible. In the case of populating a repository of units etc, if they are not going to be loaded from a remote source I have all the info I need at edit time to populate the arrays myself. So I usually write a little helper function that uses the search syntax in unity to find, load and populate an array with matching content. so for example, a context menu button that has _array = ResourceLoader.Load("t:prefab l:unit boss") which would then find all prefabs with a unit label with boss in the name, get their resource guids, resource load them and pop them into the array for me.

Oh, and instead of using the _ on the scripts folder I make a generic "_project" folder that I treat as the "real" root. so it has its own data folder for scriptables, its own prefab folder etc. That being said, I subscribe to the belief that the unity project view is NOT a folder structure but an asset database and so I don't try too hard to wrangle the folder structure, but empower myself to be able to use it through targeted naming and use of labels and other search utilities.

Again, great video. It's always a joy to see other people orbit some of the same patterns and practices, it means we are all coming to similar conclusions so their must be a kernel of value in them.

JasonStorey
Автор

Few spoken mistakes in this video with corrected annotations. Needed to rush it out before "Merry Christmas" became too irrelevant heh.

Love you guys! Enjoy.

Tarodev
Автор

Can you make a video on decision making? Like good questions to ask yourself and how to resolve them. Example: should this class be a monobehavior, a scriptable object or OG c#? Flowed by some indicators you can look for and an example / fixing a bad example

mrOverYeff
Автор

This was something I seriously needed as a self-thought developer, and there are few (maybe no other) examples of architecture out there that's in my league... Thank you very much and you've got a sub.

windwalkerrangerdm
Автор

we need more of this kind of tutorials. great work

mehmedcavas
Автор

This is great content man. There's so much out there for the beginner it's really refreshing to see well made tutorials that cover this intermediate kind of content.

sprungo
Автор

Nice, there were a few things I've been doing but some of them went completely over my head. I've heard more and more about scriptables so inevitably I'll need to dive into them. Thanks for the rundown

BlueJeebs
Автор

Wow. Busts out ALL the awesome tricks it took years for me to learn and a few new ones! Amazing, mate.

tylerheenan
Автор

Looking festive af bro! Thanks for the Architecture advice. The neater it is, the sweeter it is

VirtuwolfGames
Автор

I've been hopping around between different Unity tutorial channels and I think I finally found my home. This video has been incredibly helpful for me, thank you.

greghcarr
Автор

I like that you put the commment at 15:18. I recently switched to using that approach and i really like it. It makes it much easier to find the stuff you need when working on a feature, especially since the different file types all have their own icons, so if youre in a hero folder, its very easy to locate all the sounds for that hero for example

alexcubed
Автор

I love your videos! This video is just what i was looking for to have a quick understanding of how to structure my games. Keep up the videos i know you are making someones life a lot easier!

hectorcruz
Автор

I'm new to Unity and making games but work in data & analytics professionally. This video has helped FAR MORE than any tutorial. I really need to understand a good workflow and architecture before diving into learning Unity itself and C#, from this video I feel I have a good base to start on a game when coupled along with a detailed game plan of what I want the end product to look like and have. Thanks so much!

helenvillian
Автор

Always happy to see a Unity video promoting some proper programming patterns

Caphalem
Автор

Been using Unity for about 2 weeks now and this is what i needed! Watching the video and reading through the code/assets set off so many light-bulbs in my head, I finally have a high level overview of how a simple game would flow. Thank you so much!

xxann
Автор

Thank you! I upgraded my "Projects' Architecture" almost instantly from "v.0.2a to v.2.0" ;) after watching this video. Great job!

Pharaxiel
Автор

Great video! I always struggle with architecture so that was very interesting :)

ObviousDev