Using Composition to Make More Scalable Games in Godot

preview_player
Показать описание
Ever heard the phrase "prefer composition over inheritance" but don't know what it means with respect to Godot? In this video, I cover how I use composition in my game to create content in an efficient and robust way.

📖 Learn Godot with my Udemy courses!

🎮 Pick up one of my games:

#Godot #gamedev
Рекомендации по теме
Комментарии
Автор

This! I'm a web developer, and I was scared to start a game dev project because I didn't understand what the architecture of the Godot project should be. Some YouTube videos recommended inheritance, but that seemed so clunky to me. This video is just what I needed. The community needs more videos like this. That focus on teaching you how to build a complex project in a right way, and not just simple step by step tutorials.

TS-bypg
Автор

Just the first 5 seconds of this video are probably the best piece of advice for Godot ever: you should think of your reusable nodes as if you were extending the engine itself. This way of thinking has made working in Godot so much quicker and more fun for me!

Fupicat
Автор

Single Responsibility Principle, where everything should only do one thing well in its own specific context. Excellent explanation of how this works. Very useful, thanks.

nrwl
Автор

The best instructions/instructors teach you a way of thinking. A lot of programmers are trained in the OOP paradigm (myself included), so inheritance feels "natural" at first until it turns into a complicated mess.

This makes a lot of sense to me, and it emphasizes breaking down a big project into smaller manageable pieces, like building a room-sized skyscraper in Lego.

MMuraseofSandvich
Автор

Love it. Godot has made me a firm believer in the concept of composition in software design, not just in games but also in the regular applications I help make at my job. One thing I found also to be nifty about Godot is being able to use Resources for much of your business logic. It makes it super easy to make unit tests by just making a scene with a single Node and give it the Reaources you want to test in its script... I'm geeking out. Godot is awesome.

kiyasuihito
Автор

This is actually beautiful. Pure art in software architecture form

Algardraug
Автор

its always good seeing these kind of tutorials for godot bc its generally easy to get started but building good pratices comes a long way to organize the project and one day finish them.Good stuff.

gustavoalmeidadaribeira
Автор

Very useful tutorial. I've been using composition for a couple of my nodes. I found it tedious to create at first but it makes creating new content later much faster and easier. I picked up a few tips from your video, thanks for sharing :)

vidvad
Автор

This might've been one of the most helpful videos I've found on Godot, I'm very used to working with Java so I was thinking about nodes as if they were Java classes instead of "building blocks" Like how I've seen other Godot devs call them. The example of creating a component and then having it be a field required by another component was particularly helpful in understanding how to use these, thank you so mucH!

blurmarsh
Автор

Thank you for editing your video down! So many other tutorial videos are unedited, full of "umms", "ahhs", and long pauses that make it a chore to get information out of. This video was quick, to the point, and well-presented.

FalconFetus
Автор

This makes more sense to me, thank you. The issue I have with inheritance is that I'm not sure what common data a given base Object/Entity will need before I start exploring possible mechanics/variables, so I end up swip-swapping stuff around until it makes sense. The nice thing about this component approach is that you can manage the grouped data a bit easier in the scene tree.

Lately I've been struggling with where to put custom Resources, because you can make a Resource "local to Scene" and mutate the variables away from their defaults, however, I feel like that could get out of hand quickly if I forgot which Scene changed things around.

fighterwing
Автор

This makes a lot of sense. It also creates a lot less spaghetti and what you might call "over building" than just inheritance.

anicepineapple
Автор

Wow. Ive heard about composition, signals, singletons/global variables, custom resources, and groups before, but the way i structured my current project is less than elegant and not as modular as i needed. In 5 minutes you opened my eyes. Tomorrow, i have a lot of refactoring to do.

ThaFritz
Автор

im from an industrial controls background and this video made it finally click for me - the composition method is the same as function block method. you design a function block with generic inputs and outputs and some kind of logic inside. and then you can repeteadly use it throughout the logic controller, as seperate instances for many different objects. makes coding a lot easier but also makes understanding very easy, as once you learn ONE function block (or component in this case) you know how the majority of your game is operating!

leagueoflanky
Автор

Wow. These are the concepts I want to see more of for game development. It's a slightly older video, but it's still very relevant and important to using a proper scalable system. I would absolutely love to see more content like this.

ShiloBuff
Автор

Literally the best coding tutorial I ever see, and I am not talking about only Godot nor only game development. The way you manage to use composition, which is a hard concept, is brillant.

dylandoamaral
Автор

This channel is goldmine. You're one of the few godot youtuber who actually know what he's doing and know how to architecture a project beyond toy projects.

georgezimmer
Автор

This is a very specific example with great explanation. Thanks a lot.

troidepanhseden
Автор

This is a great way of framing an approach to coding in Godot. I come from a web development / software development background, and I've almost always done inheritance. I found this video on my quest to code with inheritance and came to understand I was neglecting functionality of the Godot engine. Thanks for helping me understand that.

seanmcgrady
Автор

One of the tutorial channels that are actually fun to watch. I usually feel stressed while watching tutorials but this video felt relaxing

rdigit