Пікірлер
@rasmusfoxman4096
@rasmusfoxman4096 5 күн бұрын
I think I would have tried to use animationplayer. Disable the player inputs and just call the players commands in animation player. That way you can also just make a new animation for each cutscene.
@easy_taco4651
@easy_taco4651 21 күн бұрын
great explenation!
@SquibbyJ
@SquibbyJ 29 күн бұрын
Thank you for explaining this in a video, I was reading documentation and it just wasn't clicking and as soon as you demonstrated I was able to work it how I needed to. Very helpful!
@FernandoPujol
@FernandoPujol Ай бұрын
Thanks for the video David. I'm new developing games and I have been using the singleton pattern. Essentially for each object I create (player, levers, coins) I create a "controller" (singleton) script with essentially the variables and functions that I will need later for the actual scene script to consume. I'm not sure if what I'm doing is correct. I'm worried about later performance or code structure in general to turn into a mess. Any suggestions?
@MoogieSRO
@MoogieSRO Ай бұрын
Call me simple, but I just don't get how splitting up player input from a single script you can read through into 7 different scripts you have to page between just to follow the logic of making an attack is supposed to be a better system. There HAS to be a less convoluted way to do this.
@Steve-sf8fv
@Steve-sf8fv 12 күн бұрын
You could just have a series of Boolean variables in the player script that trigger movement functions alongside inputs. Then add a “command” node with a trigger (collision, area node, etc) that shifts the player variables. For more complex cinematics you can use timers, multiple area triggers, etc. So like what he’s doing, but without all the extra scripts and steps.
@Steve-sf8fv
@Steve-sf8fv 12 күн бұрын
@export Var iscontrolled:= false @export Var goright:=false Func right(): if iscontrolled: if goright: player.position.x+=1 goright=false else: if Input.is_action_pressed(“right”): player.position.x+=1 This is off the top of my head for what you’d see in the player script. The control node’s script would just be sequences of variable changing on timers or something else, and this could probably be optimized, but is a general idea
@KucheKlizma
@KucheKlizma 3 күн бұрын
I'm even simpler, I read the book and curated bits of the godot docs and I have heard of callbacks and lambdas.
@poleve5409
@poleve5409 Ай бұрын
the singleton pattern sucks. any other design choice is better.
@lautaromendieta9086
@lautaromendieta9086 Ай бұрын
Can this pattern be combined with a state machine? Would you recommend it?
@GameDevWDavid
@GameDevWDavid Ай бұрын
Yeah, I don't see why not. One should mix all the patterns that one considers necessary so that the code is flexible, clean and clear. And yes, I would mix it with a state machine.
@Flamebamboo
@Flamebamboo Ай бұрын
Thank you :)
@GameDevWDavid
@GameDevWDavid Ай бұрын
You're welcome!
@erkintek
@erkintek Ай бұрын
So if my game makes 100$ how much should I pay with Godot and unity 😮 or 1000$s
@htspencer9084
@htspencer9084 Ай бұрын
Would be nice to show other scripts registering with the master script. This reduces the child coupling. And allows for dynamic children as well.
@htspencer9084
@htspencer9084 Ай бұрын
And allows for a many to many relationship :)
@dibaterman
@dibaterman 2 ай бұрын
Technically script classes are resources which are in effect singletons. The Script Resource itself only has 1 version of itself in the project period. So making a static instance of the scripts instance would store the instance in the resource at runtime. Now why you would want to do this... to rage against the machine?
@whatever7338
@whatever7338 2 ай бұрын
Observer pattern should really be object1.emit(someEvent), and object2.observe(someEvent, callback). This is more like getting access to both object1 and object2 and connecting them together in some unrelated place which kind of misses the whole point. I should be able to easily subscribe multiple objects to the same event in their classes by just calling some subscribe method.
@ThatSommeS
@ThatSommeS Ай бұрын
You can, if you create a third script, a signal handler of sorts as an Autoload script. Use that to emit and connect to signals
@Strategiusz
@Strategiusz 4 ай бұрын
The singleton antipattern.
@joggerjoe
@joggerjoe 4 ай бұрын
ty for this video. helped a lot for my first gamejam. wanted to have ai-controlled characters. made a base-character getting controlled by different types of controller. works fine.😊
@GameDevWDavid
@GameDevWDavid 4 ай бұрын
Thank you for watching!
@plur_ndbn
@plur_ndbn 5 ай бұрын
1:32 this is not true, using signals is literally like: func _physics_process(delta): for o in all_objects: if area_collided_with_object(o): call_body_entered(o) # it more complex in reality, checking collision mask and layers, but similar it still continiously checking all colliders to understand when to emit signal
@GameDevWDavid
@GameDevWDavid 4 ай бұрын
We are mixing concepts. One thing is that you are looking in each frame to see if there are collisions, another thing is that you are asking in each frame if there are collisions (to the component that detects them). With signals you avoid the second, not the first.
@uncarpinchomatero
@uncarpinchomatero 6 ай бұрын
One question about this pattern. Suppose its not an action game but a turn based rpg. Would you have a controller for the map scene and a controller for the battle scene? Would it be best to use the same controller with all the commands and then just filter what you use in each scene?
@GameDevWDavid
@GameDevWDavid 6 ай бұрын
The specific case and needs would have to be studied, but if the map scene and the battle scene are different components, each with its own peculiarities, yes, each one should have an independent controller adapted to its needs.
@Afreshio
@Afreshio 6 ай бұрын
really good explanation!
@GameDevWDavid
@GameDevWDavid 6 ай бұрын
Thank you!
@brandonjacksoon
@brandonjacksoon 6 ай бұрын
Liked and sibscribed! Thanks mate!
@GameDevWDavid
@GameDevWDavid 6 ай бұрын
You're welcome!
@longuemire748
@longuemire748 6 ай бұрын
Thank you for this tutorial But why use a container controller in 8:53 if you can only use one command at a time? Is there a reason rather than storing the command in a simple variable?
@longuemire748
@longuemire748 6 ай бұрын
@@GameDevWDavid Thank you:)
@ogames_studio
@ogames_studio 7 ай бұрын
Thank you for showcasing my game ❤
@UnderdogDen
@UnderdogDen 7 ай бұрын
That Underdog dude must be pretty cool 👀
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Well yeah, I think the guy knows what he's doing 😁
@vinipossatto9586
@vinipossatto9586 7 ай бұрын
Amazing video!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Thx!!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
🌟 Want more creations made with Godot? Here you have another 8: kzfaq.info/get/bejne/iJhgqauLnrKsqpc.html
@Evitrea
@Evitrea 7 ай бұрын
5:15 You can just write set_player_bullets.emit(PlayerStats.remaining_bullets) so that the editor checks the spelling for you, Godot 4 made signal a first class object for this reason
@TayoEXE
@TayoEXE 7 ай бұрын
Your philosophy "Call down, signal up" makes a lot of sense of how to simply work through the use cases in your mind. I like how short, simple, and clear this video is. Here's a like from me! I also like how you mention when it's appropriate to add dependencies. Having the World scene have dependencies since it should always have or expect certain nodes but using signals for children that may or may not be used in such a world (such as if you have multiple worlds or they are used elsewhere) to just throw a "Hey, I did this. Somebody handle it." makes a lot of logical sense. I tend to work through these things myself, but it's usually not a clean method in mind like this, so this helps!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Thanks for your like! And I'm glad the video was useful to you! 😊
@fudo5944
@fudo5944 7 ай бұрын
I rarely comment and most of the time I am just a simple lurker. But your videos are amazing! Keep up the good work!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Thank you for leaving your comment and for watching the video!
@darkrozen4110
@darkrozen4110 7 ай бұрын
is it possible to do this through scenes? I have a player scene and I want to emit a signal to my main scene, but I have to send it through an autoload script for it to work.
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Yes, of course, if both nodes are present in the node tree then it is possible to connect them to each other using signals, it is not necessary to use Autoload.
@DavidSerranoIO
@DavidSerranoIO 5 ай бұрын
@@nahouiramzi3449 if 2 nodes are present in the node tree, it is possible to connect them with signals.
@simpson6700
@simpson6700 7 ай бұрын
this is so confusing. i used this in a pong game as exercise. in the main menu i select 1 player or 2 player. depending on the choice i set player 2 to the AI or to a player. it's fine with AI, but the player2 is where i struggle. as a bandaid fix i simply duplicated the human controller and changed the variables for the keys. it's fine in such a simple game, but it's undesirable, since if i make changes to the human controller in the future i also have to make changes in the duplicate. i tried extending the human controller, but then i'm one inheritance layer too deep and can't reference the HumanController2 script in the same way that i reference the HumanController script.
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Why do you have to duplicate HumanController?
@atmancheater9657
@atmancheater9657 Ай бұрын
@@simpson6700 Why don't you just create two different HumanController instances?
@Rossvanzyl
@Rossvanzyl 7 ай бұрын
I believe you can also emit the signal with the syntax of `player_has_jumped.emit(count)` which is a bit cleaner than passing the name of the signal as a string!
@Sirlegna
@Sirlegna 7 ай бұрын
I noticed when using the autoload, if I call the script in a node within the game. Then it doesn't retain the singleton property of single instance.
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
What do you mean exactly?
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
@@Sirlegna Yes, correct. It is not a Singleton in the pure sense of the technical term, but it is what we have for now in Godot.
@myme1474
@myme1474 7 ай бұрын
First time ever I've heard someone use Phonk as their background music in a tutorial, and I'm mega vibing with it
@ryoon2k
@ryoon2k 7 ай бұрын
i was confused at what a "Singleton pattern" was, turns out I was using it in godot for my Global variables
@Rhiyuu
@Rhiyuu 7 ай бұрын
Something is not quite clear for me: if we pay a one year licence et publish a game on Switch, once our licence has expired, does the game stays available on the platform ?
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
In this video I am talking about the porting tool, that is, the software you use to make your Godot game run on a console. Then, regardless of this, you have your contracts with the different companies that allow you to have your game on their consoles. If you stop paying for the porting tool, the only thing that happens is that you can't use it anymore, but your game is still on the console since you have that deal with a different company (Nintendo, Sony, etc.).
@samuraikina5908
@samuraikina5908 7 ай бұрын
I do this as well on my game. Also using Core as main scene and then instantiate and queue free levels is good too. Its similar as well for performance
@samuraikina5908
@samuraikina5908 7 ай бұрын
@@kishirisu1268 what you mean? What im describing its even suggested on docs
@mbg4681
@mbg4681 7 ай бұрын
Happy New Year! Thanks for the new tut!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Thank you so much! And happy New Year!
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
🌟 If you liked this video, I recommend that you also watch another one in which I explain the Observer Pattern and how to use signals in Godot: kzfaq.info/get/bejne/q7R0qrmpxM7SdXU.html
@403gtfo
@403gtfo 7 ай бұрын
Very handy and clean way to have separate child scenes talk without have to load sibling nodes constantly. I never knew it had a pattern name, love ya work.
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Thank you 😊
@dueddel
@dueddel 7 ай бұрын
The village scene reminded me more of the Alien vs Predator game from 2000 rather than the games you mentioned (like Skyrim etc.). It's just because of the fast movement and the FOV, I guess, it looks a bit like playing an alien in AvP. :D
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
Yes, I also loved it as soon as I saw it, very immersive.
@user-vm8fz8yt5x
@user-vm8fz8yt5x 8 ай бұрын
Can compare with Defold ?
@GameDevWDavid
@GameDevWDavid 7 ай бұрын
I think Defold's porting tools are currently free, if I remember correctly.
@Marandal
@Marandal 8 ай бұрын
Good information. i'm glad Godot's got this porting service
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
Yes, it is definitely good news!
@__Rizzler__
@__Rizzler__ 8 ай бұрын
not bad
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
thx!
@paulooliveiracastro
@paulooliveiracastro 8 ай бұрын
The good part here is: if another company manages to do that, they can compete and offer the same service with a different pricing scheme or better fees. Unity and Unreal are tied to what their company offers.
@FeniksGaming
@FeniksGaming 8 ай бұрын
Subscriptions suck. Flat fee is only fair way. Why not look at Game Maker instead as direct competition where there is flat fee. There is no point in prazing what is not consumer friendly practice
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
For a product that is alive, that receives constant updates, it is very difficult to set a flat fee. It would involve calculating in the future and charging you a lot of money, it doesn't make sense. The subscription model is the fairest since you are going to pay WHILE you use the product (a product that is constantly updated and requires constant work).
@angulinhiduje6093
@angulinhiduje6093 8 ай бұрын
absolutely phenomenal lightweight video. im working on my first project and was looking on how to implement grid based tactics characters. characters can get captured by either team so this makes that aspect very intuitive. i just changed player_controller to character controller and command all characters on the screen like that. and even better if i want them to walk to certain spots on the map after special events i just have a neutral AI that just sends a grid coordinate and lets the player code handle the pathfinding. thank you!
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
The Command Pattern works like a charm in board/grid games as you mentioned. I'm glad it was useful to you! And thank you very much for watching the video!
@StaleCookies
@StaleCookies 8 ай бұрын
if you don't want to pay for external services to port then keep learning I guess haha
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
I suppose so, but tuning an engine like Godot to integrate with the console manufacturers' SDK should not be an easy task. In any case, if you are at the point of wanting to deploy for consoles, the price they ask cannot be a problem.
@ulrich-tonmoy
@ulrich-tonmoy 8 ай бұрын
Now its just a matter of time till Godot or W4 do something like Unity Runtime fee
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
I don't think that's going to happen.
@SethbotStar
@SethbotStar 8 ай бұрын
Might be nicer for indie developers if they had a sort of per project port option rather than only having subscriptions. If i only need to use a service once, i should only have to pay for it once. Interesting that they have that, but yeah.
@jacksontriffon5064
@jacksontriffon5064 8 ай бұрын
Yeah, agreed. Fairly sure even large companies do porting through contracts on a per project basis
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
Well, as I understand it, that is possible. Simply buy the pack for one year, then pay no more, and you already have the porting tool to use throughout that year.
@JACKRIDERPLAYZ
@JACKRIDERPLAYZ 8 ай бұрын
​@@jacksontriffon5064yes but that is different since it's with a publisher
@CarTastic-fv6eo
@CarTastic-fv6eo 3 ай бұрын
In this case its just far simpler use UE as it is royality free under 1 mln and support all consoles available on market.
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
👉 Take a look at these 8 fantastic creations that the Godot community has created: kzfaq.info/get/bejne/iJhgqauLnrKsqpc.html
@Boildroid
@Boildroid 8 ай бұрын
So far so good
@GameDevWDavid
@GameDevWDavid 8 ай бұрын
Thanks!!