Unity Architecture for Noobs - Game Structure

Unity Architecture for Noobs - Game Structure

Tarodev

2 года назад

185,972 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Laurynas Pupsta
Laurynas Pupsta - 17.01.2022 11:50

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!

Ответить
Liam Needham
Liam Needham - 08.10.2023 03:24

This is the exact tutorial I've needed. I find it so easy to come up with ideas for games and visualize what that game will end up looking like, and impossible to understand any of the structure I need to build. Every tutorial has their own structure that they follow without explaining, or they stick to very basic stuff without ever teaching you how to implement a structure.

I now know what I'm missing, what I need to learn about and what I can figure out through trial and error. So instead of searching "how do I actually make the games I design", I know that I can at the very least build a structure with this in mind, tweak the structure to suit the game better if need be, and start actually making the games.

It's like being a painter and never being taught how to use a canvas or a brush - sure you can throw the paint at a sheet of paper and call it art, but if you want to paint something in particular, you need to know what frame you are working within.

Ответить
Niranjan Wagh
Niranjan Wagh - 14.09.2023 14:55

This is the video I was waiting for for long long time. I will be watching it several time in upcoming days to understand each part.
Please consider making more videos like this in future. In each video you can deep dive into Managers, Setup, Enviroment, Canvases and System.
I know you have videos on most of these topics already. But most of them are oriented for turn based games.
Again Thanks for this video. It helped me overcome my initial barrier of game development journey.

Ответить
kelskye
kelskye - 13.09.2023 08:01

I've been learning Unity by tutorials, and I've found it frustrating that the tutorials are so focused in getting across specifics on how to do particular things in Unity that they only pay minimal attention to architectural concerns. I get that this is not to intimidate or discourage those who aren't from a programming background, but as a programmer it makes Unity feel like it's disordered by design. This has given me ideas for how I could impose a sense of order once I break away from the tutorials and into my own projects. Thank you!

Ответить
Moho Khachai
Moho Khachai - 30.08.2023 16:29

Snippet in vs

Ответить
Lupo
Lupo - 26.08.2023 23:55

I personally go with the famous stackoverflow suggestion of "have a preload scene" and its an even simpler approach to the base scene than what's displayed here. At work we do go with a similar take except there are dedicated systems for just about anything that is not experimental.

For solo dev I think the preload scene approach kept simple works wonders. It's literally one scene with one object that has DontDestroyOnLoad attached, and below it you can add your systems like you displayed.

I don't personally go down the path of state machine for game Manager but more of an "embrace the chaos that is game development" approach.

Whether it's loading, playing, showing an Ad, cloud save syncing or whatever, those systems are all reachable through a GlobalManager (attached to the preload DDOL object) and the preload will instantly load the splash, which will trigger startup tasks. Those tasks will call upon whatever dedicated systems are in place and if I want to check what each manager is doing I can simply ask them.

So the "Load" enum would be swapped by an entire StartupTaskManager that can give a lot more detail on the status of loading than a simple enum could allude to. You could also simply not have a startup manager (if you don't need one) and entire component simply won't exist and clutter your code unnecessarily.

I've pretty much always found state machines to come back and bite me in the ass because of limitations I inadvertently took on when designing them, so keeping things freeform makes more sense to me and I use enums to enclose all potential options of a more discrete system, such as creating an account on the cloud could have "requested, received, processing, completed, failed" and that's a restriction I do want to enforce for the client since it depends on the server.

Ответить
Serafim R.
Serafim R. - 25.07.2023 22:51

One question, as far as i know, because of generic static method there is may be problems, because static compiles earlier, am i right?

Ответить
Entikai
Entikai - 18.07.2023 13:56

The way I like to organize my folder structure is the same way it's organized in the hierarchy and prefabs. So all assets associated with player go into the player folder (scripts, graphics, audio). All assets associated with enemies go into the enemy folder. Basically, the way assets are organized in the hierarchy across all my prefabs, that's how they should be organized in the project panel in the folders. And if a script is reusable and shared, it goes into the reusable folders.
The advantage of this is that in Unity you typically work on one prefab at a time. And when you work on player prefab, you want to find player related assets as fast as possible - ideally all in one place.

Ответить
Entikai
Entikai - 18.07.2023 12:52

Hey Taro, would you ever make a Udemy style long intermediate tutorial where you show how to make a game the right way! Not the prototype-grade code, but the production-grade.

Ответить
input_001 _
input_001 _ - 01.07.2023 12:35

Loved this video thank you

Ответить
Villian
Villian - 28.06.2023 02:27

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!

Ответить
Sanghyun Cho
Sanghyun Cho - 16.06.2023 06:07

"DestroyChildren which sounds pretty horrible" XD

Ответить
bunnybreaker
bunnybreaker - 26.04.2023 13:21

I love everything about this video. Subbed for the head tree and intro statement alone 😉👍🏽

Ответить
Davidi Mollettini
Davidi Mollettini - 11.04.2023 22:24

Interessante

Ответить
Mumbolian
Mumbolian - 04.04.2023 12:49

Hey, I may not be understanding something simple - Shouldn't the Game manager be the PersistentSingleton instead? Wouldn't you want that to not be destroyed between scenes?

Ответить
Bocdagla
Bocdagla - 27.03.2023 17:26

First of all great tutorial on architecture in Unity; But i've recently seen in the "unity open projects" that they are using a "Scriptable Object" architecture in order to work with added scenes and i fail to find that anywhere else. It would be cool if you could make a video on that matter!

Ответить
Xander
Xander - 16.03.2023 00:26

That lovely game manager just made my eyes wet :)

Ответить
Eleonora Hackman
Eleonora Hackman - 15.03.2023 02:20

This is so interesting and good to know! Thank you for this!

Ответить
prod. Jake Karno
prod. Jake Karno - 12.03.2023 21:41

Top quality advice, thanks

Ответить